Commit dfaf32e5 authored by 皮倩雯's avatar 皮倩雯

修改用户管理用户鉴权功能

parent 92907699
Pipeline #32458 skipped with stages
...@@ -35,16 +35,15 @@ const AddUserModal = props => { ...@@ -35,16 +35,15 @@ const AddUserModal = props => {
message: '提交失败', message: '提交失败',
description: '登录名不支持中文!', description: '登录名不支持中文!',
}); });
} else if (password.length < 6) { }else if (password === '') {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
description: '密码至少为6位,且包含数字和字母!', description: '密码不能为空!',
}); });
} }else if (password.length < 6) {
else if (password === '') {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
description: '密码不能为空!', description: '密码至少为6位,且包含数字和字母!',
}); });
}else if (userName === '') { }else if (userName === '') {
notification.error({ notification.error({
......
...@@ -339,7 +339,7 @@ const UserManage = () => { ...@@ -339,7 +339,7 @@ const UserManage = () => {
<Form form={form}> <Form form={form}>
<Item> <Item>
<Radio.Group <Radio.Group
defaultValue={selectValue} value={selectValue}
onChange={onTypeChange} onChange={onTypeChange}
> >
<Space direction="vertical"> <Space direction="vertical">
...@@ -763,19 +763,21 @@ const UserManage = () => { ...@@ -763,19 +763,21 @@ const UserManage = () => {
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
setSelctValue(res.data); setSelctValue(res.data);
console.log(selectValue);
console.log(res.data); console.log(res.data);
} }
}); });
}; };
const onTypeChange = value => { const onTypeChange = value => {
console.log(value); setSelctValue(value.target.value);
setSelctValue(value);
}; };
const authUser = record => { const authUser = (record) => {
setCurrentUser(record); setCurrentUser(record);
AddUserAuthSetting({ userId: currentUser.userID }).then(res => { console.log(selectValue)
if (res.code == 0) { AddUserAuthSetting({
userId: record.userID,
userLevel: selectValue
}).then(res => {
if (res.code === 0) {
message.info('提交成功'); message.info('提交成功');
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment