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();