Merge pull request #3899 from dataease/pr@dev@perf_user_validate

perf(用户管理): 用户验证规则
This commit is contained in:
xuwei-fit2cloud 2022-11-28 12:56:51 +08:00 committed by GitHub
commit 2c05f9de6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -651,7 +651,7 @@ export default {
input_password: 'Please input a password', input_password: 'Please input a password',
input_phone: 'Please enter the phone number', input_phone: 'Please enter the phone number',
input_roles: 'Please select role', 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', special_characters_are_not_supported: 'Special characters are not supported',
mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number', mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number',
email_format_is_incorrect: 'The mailbox format is incorrect', email_format_is_incorrect: 'The mailbox format is incorrect',

View File

@ -652,7 +652,7 @@ export default {
input_roles: '請選擇角色', input_roles: '請選擇角色',
select_users: '請選擇用戶', select_users: '請選擇用戶',
select_gender: '請選擇性別', select_gender: '請選擇性別',
user_name_pattern_error: 'ID只能包含字母数字下划线以及-并以字母开头!', user_name_pattern_error: 'ID只能包含字母数字以及._-并以字母开头!',
special_characters_are_not_supported: '不支持特殊字符', special_characters_are_not_supported: '不支持特殊字符',
mobile_number_format_is_incorrect: '手機號碼格式不正確', mobile_number_format_is_incorrect: '手機號碼格式不正確',
email_format_is_incorrect: '郵箱格式不正確', email_format_is_incorrect: '郵箱格式不正確',

View File

@ -651,7 +651,7 @@ export default {
input_roles: '请选择角色', input_roles: '请选择角色',
select_users: '请选择用户', select_users: '请选择用户',
select_gender: '请选择性别', select_gender: '请选择性别',
user_name_pattern_error: 'ID只能包含字母数字下划线以及-并以字母开头!', user_name_pattern_error: 'ID只能包含字母数字以及._-并以字母开头!',
special_characters_are_not_supported: '不支持特殊字符', special_characters_are_not_supported: '不支持特殊字符',
mobile_number_format_is_incorrect: '手机号码格式不正确', mobile_number_format_is_incorrect: '手机号码格式不正确',
email_format_is_incorrect: '邮箱格式不正确', email_format_is_incorrect: '邮箱格式不正确',

View File

@ -264,8 +264,8 @@ export default {
}, },
{ {
required: true, required: true,
pattern: '^[a-zA-Z][a-zA-Z0-9_-]*$', pattern: '^[a-zA-Z][a-zA-Z0-9\._-]*$',
message: this.$t('user.special_characters_are_not_supported'), message: this.$t('user.user_name_pattern_error'),
trigger: 'blur' trigger: 'blur'
} }
], ],
@ -409,7 +409,7 @@ export default {
} }
}, },
validateNickname(rule, value, callback) { validateNickname(rule, value, callback) {
const pattern = "[\\u00A0\\s\"`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~@#¥%……&*()——+|{}【】‘;:”“'。,、?]" const pattern = "[\\u00A0\\s\"`~!@#$%^&*()+=|{}':;',\\[\\]<>/?~@#¥%……&*()——+|{}【】‘;:”“'。,、?]"
const regep = new RegExp(pattern) const regep = new RegExp(pattern)
if (regep.test(value)) { if (regep.test(value)) {