From 7402e4ee5c278f3ce8b07156f5f5df738c36fb08 Mon Sep 17 00:00:00 2001 From: admin <> Date: Sat, 11 May 2024 14:32:42 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=A2=9E=E5=8A=A0=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pagesApp/components/addUser.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/pagesApp/components/addUser.vue b/src/pagesApp/components/addUser.vue index 1852f05..dd6b091 100644 --- a/src/pagesApp/components/addUser.vue +++ b/src/pagesApp/components/addUser.vue @@ -32,7 +32,7 @@ clearable :customStyle="{}" border="none" - :maxlength="item.key === 'password' ? 6 : -1" + :maxlength="item.key === 'password' ? 8 : -1" @change="(e:any) => {handleInput(e, item)}" :disabled="item.type === 'select'" :disabledColor="['性别', '用户角色'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" @@ -82,6 +82,12 @@ const handleInput = (e: any, item: any) => { model1.formData[item.key] = temp; }, 10); } + if (item.key === "password") { + const temp = e?.replace(valid.valid_no_cn, ""); + setTimeout(() => { + (model1.formData as any)[item.key] = temp; + }, 10); + } }; const model1 = reactive({ formData: { @@ -205,6 +211,15 @@ const save = () => { return; } } + if (model1.formData.password) { + if (!valid.valid_password.pattern.test(model1.formData.password)) { + uni.showToast({ + icon: "none", + title: valid.valid_password.message, + }); + return; + } + } check().then((res) => { if (res) { startSave();