diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 22a06e33ad..d020e604cf 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -651,7 +651,7 @@ export default { input_password: 'Please input a password', input_phone: 'Please enter the phone number', input_roles: 'Please select role', - user_name_pattern_error: 'IDs can only contain alphanumeric underscores and - and start with a letter!', + user_name_pattern_error: 'IDs can only contain alphanumeric and ._- and start with a letter!', special_characters_are_not_supported: 'Special characters are not supported', mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number', email_format_is_incorrect: 'The mailbox format is incorrect', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 736c8ca685..3142da7f5f 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -652,7 +652,7 @@ export default { input_roles: '請選擇角色', select_users: '請選擇用戶', select_gender: '請選擇性別', - user_name_pattern_error: 'ID只能包含字母数字下划线以及-并以字母开头!', + user_name_pattern_error: 'ID只能包含字母数字以及._-并以字母开头!', special_characters_are_not_supported: '不支持特殊字符', mobile_number_format_is_incorrect: '手機號碼格式不正確', email_format_is_incorrect: '郵箱格式不正確', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index a151018127..25d540156e 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -651,7 +651,7 @@ export default { input_roles: '请选择角色', select_users: '请选择用户', select_gender: '请选择性别', - user_name_pattern_error: 'ID只能包含字母数字下划线以及-并以字母开头!', + user_name_pattern_error: 'ID只能包含字母数字以及._-并以字母开头!', special_characters_are_not_supported: '不支持特殊字符', mobile_number_format_is_incorrect: '手机号码格式不正确', email_format_is_incorrect: '邮箱格式不正确', diff --git a/frontend/src/views/system/user/UserEditer.vue b/frontend/src/views/system/user/UserEditer.vue index 4e7fe43bf9..391c15344b 100644 --- a/frontend/src/views/system/user/UserEditer.vue +++ b/frontend/src/views/system/user/UserEditer.vue @@ -264,8 +264,8 @@ export default { }, { required: true, - pattern: '^[a-zA-Z][a-zA-Z0-9_-]*$', - message: this.$t('user.special_characters_are_not_supported'), + pattern: '^[a-zA-Z][a-zA-Z0-9\._-]*$', + message: this.$t('user.user_name_pattern_error'), trigger: 'blur' } ], @@ -409,7 +409,7 @@ export default { } }, validateNickname(rule, value, callback) { - const pattern = "[\\u00A0\\s\"`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“'。,、?]" + const pattern = "[\\u00A0\\s\"`~!@#$%^&*()+=|{}':;',\\[\\]<>/?~!@#¥%……&*()——+|{}【】‘;:”“'。,、?]" const regep = new RegExp(pattern) if (regep.test(value)) {