From e070d6b578f36798a566feb2899a807202c179ef Mon Sep 17 00:00:00 2001 From: x_z Date: Sat, 25 Jun 2022 10:48:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=A4=84=E7=90=86=E5=B7=A5=E5=85=B7=E6=96=B9=E6=B3=95?= =?UTF-8?q?=202.=E7=94=A8=E6=88=B7=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=96=B9=E6=B3=95=E6=B7=BB=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/strUtil.js | 7 +++++++ src/views/userManage/admin/authAdmin.vue | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/utils/strUtil.js diff --git a/src/utils/strUtil.js b/src/utils/strUtil.js new file mode 100644 index 0000000..255ec28 --- /dev/null +++ b/src/utils/strUtil.js @@ -0,0 +1,7 @@ +//封装字符串相关的方法 +export function isBlank(value) { + value = value.trim(); + if (value === "" || value === null || value === "string") { + return true; + } +} diff --git a/src/views/userManage/admin/authAdmin.vue b/src/views/userManage/admin/authAdmin.vue index 211af95..3e53fa2 100644 --- a/src/views/userManage/admin/authAdmin.vue +++ b/src/views/userManage/admin/authAdmin.vue @@ -195,6 +195,7 @@ import { import store from "../../../store/index"; import {findConfig} from "@/api/thrsys/spsSyncStatus"; +import {isBlank} from "@/utils/strUtil"; const formJson = { id: "", @@ -364,6 +365,20 @@ export default { } }, formSubmit() { + if (isBlank(this.formData.userName)) { + this.$message.error("用户账号不能为空"); + return; + } else if (isBlank(this.formData.passWord)) { + this.$message.error("密码不能为空") + return; + }else if (isBlank(this.formData.employeeName)) { + this.$message.error("用户名称不能为空"); + return; + } else if (this.formData.roles.length === 0) { + this.$message.error("未指定角色!") + return; + } + this.$refs["dataForm"].validate(valid => { if (valid) { this.formLoading = true; From 0d449eb395ea0ebba4380c0ebc770272a3f0b406 Mon Sep 17 00:00:00 2001 From: x_z Date: Sat, 25 Jun 2022 13:14:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=EF=BC=8C=E7=BC=96=E8=BE=91=E5=BC=B9=E7=AA=97=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=B8=85=E9=99=A4=EF=BC=8C=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/userManage/admin/authAdmin.vue | 898 +++++++++++------------ 1 file changed, 449 insertions(+), 449 deletions(-) diff --git a/src/views/userManage/admin/authAdmin.vue b/src/views/userManage/admin/authAdmin.vue index 3e53fa2..6d0eef6 100644 --- a/src/views/userManage/admin/authAdmin.vue +++ b/src/views/userManage/admin/authAdmin.vue @@ -1,196 +1,197 @@