Files
ragflow_python/web/src/pages/chat/model.ts

33 lines
573 B
TypeScript
Raw Normal View History

import { DvaModel } from 'umi';
2024-01-17 09:37:01 +08:00
export interface ChatModelState {
name: string;
2024-01-17 09:37:01 +08:00
}
const model: DvaModel<ChatModelState> = {
namespace: 'chatModel',
state: {
name: 'kate',
},
reducers: {
save(state, action) {
return {
...state,
...action.payload,
};
2024-01-17 09:37:01 +08:00
},
},
subscriptions: {
setup({ dispatch, history }) {
return history.listen((query) => {
console.log(query);
});
2024-01-17 09:37:01 +08:00
},
},
effects: {
*query({ payload }, { call, put }) {},
},
2024-01-17 09:37:01 +08:00
};
export default model;