From 57f575aa8462741a78eefb8abe9c1364fbe8640d Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 20 Jun 2024 10:16:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E8=A7=84=E5=88=99=E4=BF=AE=E6=94=B9=E5=85=81=E8=AE=B8=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E5=BC=80=E5=A4=B4=E8=87=B3=E5=B0=916=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 2 +- src/i18n/locales/zh-CN.ts | 2 +- src/utils/regular-utils.ts | 6 +++--- src/views/system/user/index.vue | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 5df3470f..5b540ab9 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -1609,7 +1609,7 @@ export default { loginIp: 'Login Address', loginTime: 'Login Time', status: 'Status', - userNameTip:'The account cannot start with a number and can contain uppercase and lowercase letters, numbers, and no less than 5 digits', + userNameTip:'The account number can only contain strings of uppercase letters, lowercase letters and numbers with a minimum length of 6 digits', passwdTip:'The password should contain at least uppercase and lowercase letters, numbers, special symbols, and no less than 6 digits', nickNameTip:'Nicknames no less than 2 digits', emailTip:'Please enter the correct email address', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 96236c4e..55ab5588 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1609,7 +1609,7 @@ export default { loginIp: '登录地址', loginTime: '登录时间', status: '用户状态', - userNameTip:'账号不能以数字开头,可包含大写小写字母,数字,且不少于5位', + userNameTip:'账号只能包含大写字母、小写字母和数字的字符串,长度至少为6位', passwdTip:'密码至少包含大小写字母、数字、特殊符号,且不少于6位', nickNameTip:'昵称不少于2位', emailTip:'请输入正确的邮箱地址', diff --git a/src/utils/regular-utils.ts b/src/utils/regular-utils.ts index 65a9fd52..f04c447e 100644 --- a/src/utils/regular-utils.ts +++ b/src/utils/regular-utils.ts @@ -19,9 +19,9 @@ export const regExpPort = /** * 有效账号格式 * - * 账号不能以数字开头,可包含大写小写字母,数字,且不少于5位 + * 账号只能包含大写字母、小写字母和数字的字符串,长度至少为6位 */ -export const regExpUserName = /^[a-zA-Z][a-z0-9A-Z]{4,}$/; +export const regExpUserName = /^[A-Za-z0-9]{6,}$/; /** * 有效密码格式 @@ -91,7 +91,7 @@ export function validURL(str: string) { } catch (error) { return false; } - + if (u.host.startsWith('.')) { return false; } diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index c6398f7b..55a13b0e 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -258,7 +258,7 @@ let modalState: ModalStateType = reactive({ phonenumber: '', postIds: [], roleIds: [], - sex: '1', + sex: '0', status: '0', remark: '', createTime: 0,