diff --git a/frontend/src/types/user.ts b/frontend/src/types/user.ts index d4f0fe9f..c3086c40 100644 --- a/frontend/src/types/user.ts +++ b/frontend/src/types/user.ts @@ -18,7 +18,7 @@ export interface BaseUserInfo { } export interface EditUserInfo extends BaseUserInfo { - password?: string; + passWord?: string; } export interface LoginUserInfo extends BaseUserInfo { diff --git a/frontend/src/widgets/UserList.vue b/frontend/src/widgets/UserList.vue index d1ae2579..16918090 100644 --- a/frontend/src/widgets/UserList.vue +++ b/frontend/src/widgets/UserList.vue @@ -172,7 +172,7 @@ const userDialog = ref({ await addUserApi().execute({ data: { username: formData.value.userName, - password: formData.value.password!, + password: formData.value.passWord!, permission: formData.value.permission } }); @@ -200,7 +200,7 @@ const userDialog = ref({ const formDataOrigin: EditUserInfo = { uuid: "", userName: "", - password: "", + passWord: "", loginTime: "", registerTime: "", instances: [], @@ -220,7 +220,7 @@ const baseRules: Record = { }; const addUserRules: Record = { ...baseRules, - password: [ + passWord: [ { required: true, message: t("请输入密码") @@ -229,7 +229,7 @@ const addUserRules: Record = { min: 9, max: 36, validator: async (_rule: Rule, value: string) => { - if (!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[0-9A-Za-z]{12,}$/.test(value)) + if (!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[0-9A-Za-z]{9,}$/.test(value)) throw new Error(t("9 到 36 个字符,必须包含大小写字母和数字")); }, trigger: "blur" @@ -238,7 +238,7 @@ const addUserRules: Record = { }; const editUserRules: Record = { ...baseRules, - password: [ + passWord: [ { required: false }, @@ -246,7 +246,7 @@ const editUserRules: Record = { min: 9, max: 36, validator: async (_rule: Rule, value: string) => { - if (value && !/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[0-9A-Za-z]{12,}$/.test(value)) + if (value && !/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[0-9A-Za-z]{9,}$/.test(value)) throw new Error(t("9 到 36 个字符,必须包含大小写字母和数字")); }, trigger: "blur" @@ -300,14 +300,14 @@ onMounted(async () => { - + {{ t("TXT_CODE_5c605130") }} {{ !isAddMode ? t("不填写则不更变原有值") : t("TXT_CODE_1f2062c7") }} - +