update: 增加密码校验
This commit is contained in:
parent
f3fd202083
commit
7402e4ee5c
|
@ -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<any>({
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue