update: 增加密码校验
This commit is contained in:
parent
f3fd202083
commit
7402e4ee5c
|
@ -32,7 +32,7 @@
|
||||||
clearable
|
clearable
|
||||||
:customStyle="{}"
|
:customStyle="{}"
|
||||||
border="none"
|
border="none"
|
||||||
:maxlength="item.key === 'password' ? 6 : -1"
|
:maxlength="item.key === 'password' ? 8 : -1"
|
||||||
@change="(e:any) => {handleInput(e, item)}"
|
@change="(e:any) => {handleInput(e, item)}"
|
||||||
:disabled="item.type === 'select'"
|
:disabled="item.type === 'select'"
|
||||||
:disabledColor="['性别', '用户角色'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
|
:disabledColor="['性别', '用户角色'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
|
||||||
|
@ -82,6 +82,12 @@ const handleInput = (e: any, item: any) => {
|
||||||
model1.formData[item.key] = temp;
|
model1.formData[item.key] = temp;
|
||||||
}, 10);
|
}, 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>({
|
const model1 = reactive<any>({
|
||||||
formData: {
|
formData: {
|
||||||
|
@ -205,6 +211,15 @@ const save = () => {
|
||||||
return;
|
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) => {
|
check().then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
startSave();
|
startSave();
|
||||||
|
|
Loading…
Reference in New Issue