This commit is contained in:
chenjianxing 2020-06-11 15:33:44 +08:00
commit 875e132d99
5 changed files with 14 additions and 1 deletions

View File

@ -101,6 +101,10 @@ public class UserService {
private void checkUserParam(User user) {
if (StringUtils.isBlank(user.getId())) {
MSException.throwException(Translator.get("user_id_is_null"));
}
if (StringUtils.isBlank(user.getName())) {
MSException.throwException(Translator.get("user_name_is_null"));
}

View File

@ -8,6 +8,7 @@ error=error
connection_failed=Connection failed
#user related
user_email_already_exists=User email already exists
user_id_is_null=User ID cannot be null
user_name_is_null=User name cannot be null
user_email_is_null=User email cannot be null
password_is_null=Password cannot be null

View File

@ -7,6 +7,7 @@ row=行
error=出错
#user related
user_email_already_exists=用户邮箱已存在
user_id_is_null=用户ID不能为空
user_name_is_null=用户名不能为空
user_email_is_null=用户邮箱不能为空
password_is_null=密码不能为空

View File

@ -8,6 +8,7 @@ error=出錯
connection_failed=連接失敗
#user related
user_email_already_exists=用戶郵箱已存在
user_id_is_null=用戶ID不能為空
user_name_is_null=用戶名不能為空
user_email_is_null=用戶郵箱不能為空
password_is_null=密碼不能為空

View File

@ -336,7 +336,13 @@
rule: {
id: [
{required: true, message: this.$t('user.input_id'), trigger: 'blur'},
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'}
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'},
{
required: true,
pattern: /^[a-zA-Z0-9]+$/,
message: this.$t('user.special_characters_are_not_supported'),
trigger: 'blur'
}
],
name: [
{required: true, message: this.$t('user.input_name'), trigger: 'blur'},