From 534009594e93ce7e65cfc88434e946ff7e64edc2 Mon Sep 17 00:00:00 2001 From: vapao Date: Sat, 22 Apr 2023 23:29:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A9=98=E8=89=B2=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=9D=83=E9=99=90=E6=94=AF=E6=8C=81=E6=92=A4=E9=94=80?= =?UTF-8?q?=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/pages/system/role/DeployPerm.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spug_web/src/pages/system/role/DeployPerm.js b/spug_web/src/pages/system/role/DeployPerm.js index 65019ab..4370af1 100644 --- a/spug_web/src/pages/system/role/DeployPerm.js +++ b/spug_web/src/pages/system/role/DeployPerm.js @@ -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;