add front end code (#27)

This commit is contained in:
KevinHuSh
2024-01-17 09:37:01 +08:00
committed by GitHub
parent 3859fce6bf
commit 6b8fc2ce1f
89 changed files with 21430 additions and 0 deletions

View File

@ -0,0 +1,53 @@
import { message } from 'antd';
import { addParam } from '@/utils';
import kbService from '@/services/kbService';
const Model = {
namespace: 'kSModel',
state: {
isShowPSwModal: false,
isShowTntModal: false,
loading: false,
tenantIfo: {}
},
subscriptions: {
setup({ dispatch, history }) {
history.listen(location => {
});
}
},
effects: {
* createKb({ payload = {}, callback }, { call, put }) {
const { data, response } = yield call(kbService.createKb, payload);
const { retcode, data: res, retmsg } = data
if (retcode === 0) {
message.success('创建知识库成功!');
callback && callback(res.kb_id)
}
},
* updateKb({ payload = {}, callback }, { call, put }) {
const { data, response } = yield call(kbService.updateKb, payload);
const { retcode, data: res, retmsg } = data
if (retcode === 0) {
message.success('更新知识库成功!');
}
},
*getKbDetail({ payload = {}, callback }, { call, put }) {
const { data, response } = yield call(kbService.get_kb_detail, payload);
const { retcode, data: res, retmsg } = data
if (retcode === 0) {
// localStorage.setItem('userInfo',res.)
callback && callback(res)
}
},
},
reducers: {
updateState(state, { payload }) {
return {
...state,
...payload
};
}
}
};
export default Model;