perf(用户管理): 用户验证规则

This commit is contained in:
fit2cloud-chenyw 2022-11-28 12:44:51 +08:00
parent 7443493b3a
commit d61d0f013c
4 changed files with 6 additions and 6 deletions

View File

@ -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',

View File

@ -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: '郵箱格式不正確',

View File

@ -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: '邮箱格式不正确',

View File

@ -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)) {