Skip to content

Commit

Permalink
优化角色发布权限支持撤销授权
Browse files Browse the repository at this point in the history
  • Loading branch information
vapao committed Mar 31, 2023
1 parent f2d86ae commit 8f89e5a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions spug_web/src/pages/system/role/DeployPerm.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ class DeployPerm extends React.Component {
};

handleSubmit = () => {
if (lds.get(store.deployRel, 'envs', []).length === 0) {
return message.error('请至少设置一个环境权限')
} else if (lds.get(store.deployRel, 'apps', []).length === 0) {
return message.error('请至少设置一个应用权限')
const envs = lds.get(store.deployRel, 'envs', [])
const apps = lds.get(store.deployRel, 'apps', [])
if (!(envs.length === 0 && apps.length === 0)) {
if (envs.length === 0) return message.error('请至少设置一个环境权限')
if (apps.length === 0) return message.error('请至少设置一个应用权限')
}
this.setState({loading: true});
http.patch('/api/account/role/', {id: store.record.id, deploy_perms: store.deployRel})
http.patch('/api/account/role/', {id: store.record.id, deploy_perms: {envs, apps}})
.then(res => {
message.success('操作成功');
store.deployPermVisible = false;
Expand Down

0 comments on commit 8f89e5a

Please sign in to comment.