⚡ bug fix
This commit is contained in:
parent
11f5acd056
commit
fd73d1bf00
|
|
@ -74,6 +74,7 @@ const proxy = {
|
||||||
'POST /api/blade-user/grant': fakeSuccess,
|
'POST /api/blade-user/grant': fakeSuccess,
|
||||||
'POST /api/blade-user/reset-password': fakeSuccess,
|
'POST /api/blade-user/reset-password': fakeSuccess,
|
||||||
'POST /api/blade-user/submit': fakeSuccess,
|
'POST /api/blade-user/submit': fakeSuccess,
|
||||||
|
'POST /api/blade-user/update': fakeSuccess,
|
||||||
'POST /api/blade-user/remove': fakeSuccess,
|
'POST /api/blade-user/remove': fakeSuccess,
|
||||||
|
|
||||||
// 支持值为 Object 和 Array
|
// 支持值为 Object 和 Array
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,13 @@ export function USER_SUBMIT(payload) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function USER_UPDATE(payload) {
|
||||||
|
return {
|
||||||
|
type: `${USER_NAMESPACE}/update`,
|
||||||
|
payload,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export function USER_REMOVE(payload) {
|
export function USER_REMOVE(payload) {
|
||||||
return {
|
return {
|
||||||
type: `${USER_NAMESPACE}/remove`,
|
type: `${USER_NAMESPACE}/remove`,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import router from 'umi/router';
|
import router from 'umi/router';
|
||||||
import { USER_NAMESPACE } from '../actions/user';
|
import { USER_NAMESPACE } from '../actions/user';
|
||||||
import { query as queryUsers, list, submit, detail, remove, grant } from '../services/user';
|
import { query as queryUsers, list, submit, update, detail, remove, grant } from '../services/user';
|
||||||
import { select as tenants } from '../services/tenant';
|
import { select as tenants } from '../services/tenant';
|
||||||
import { tree as roles } from '../services/role';
|
import { tree as roles } from '../services/role';
|
||||||
import { tree as depts } from '../services/dept';
|
import { tree as depts } from '../services/dept';
|
||||||
|
|
@ -116,6 +116,13 @@ export default {
|
||||||
router.push('/system/user');
|
router.push('/system/user');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
*update({ payload }, { call }) {
|
||||||
|
const response = yield call(update, payload);
|
||||||
|
if (response.success) {
|
||||||
|
message.success('提交成功');
|
||||||
|
router.push('/system/user');
|
||||||
|
}
|
||||||
|
},
|
||||||
*remove({ payload }, { call }) {
|
*remove({ payload }, { call }) {
|
||||||
const {
|
const {
|
||||||
data: { keys },
|
data: { keys },
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { connect } from 'dva';
|
||||||
import Panel from '../../../components/Panel';
|
import Panel from '../../../components/Panel';
|
||||||
import func from '../../../utils/Func';
|
import func from '../../../utils/Func';
|
||||||
import styles from '../../../layouts/Sword.less';
|
import styles from '../../../layouts/Sword.less';
|
||||||
import { USER_CHANGE_INIT, USER_DETAIL, USER_INIT, USER_SUBMIT } from '../../../actions/user';
|
import { USER_CHANGE_INIT, USER_DETAIL, USER_INIT, USER_UPDATE } from '../../../actions/user';
|
||||||
import { tenantMode } from '../../../defaultSettings';
|
import { tenantMode } from '../../../defaultSettings';
|
||||||
|
|
||||||
const FormItem = Form.Item;
|
const FormItem = Form.Item;
|
||||||
|
|
@ -45,7 +45,7 @@ class UserEdit extends PureComponent {
|
||||||
deptId: func.join(values.deptId),
|
deptId: func.join(values.deptId),
|
||||||
birthday: func.format(values.birthday),
|
birthday: func.format(values.birthday),
|
||||||
};
|
};
|
||||||
dispatch(USER_SUBMIT(params));
|
dispatch(USER_UPDATE(params));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,13 @@ export async function submit(params) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function update(params) {
|
||||||
|
return request('/api/blade-user/update', {
|
||||||
|
method: 'POST',
|
||||||
|
body: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function detail(params) {
|
export async function detail(params) {
|
||||||
return request(`/api/blade-user/detail?${stringify(params)}`);
|
return request(`/api/blade-user/detail?${stringify(params)}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user