Procházet zdrojové kódy

登录鉴权等接口

1018653686@qq.com před 1 rokem
rodič
revize
6886055198

+ 4 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/controller/open/OpenWesiteUserController.java

@@ -1,6 +1,7 @@
 package com.fjhx.xmhjc.controller.open;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.StrUtil;
 import com.fjhx.xmhjc.anno.LoginValid;
@@ -42,6 +43,9 @@ public class OpenWesiteUserController {
         if(StrUtil.isBlank(websiteUsersDto.getUserName()) || StrUtil.isBlank(websiteUsersDto.getPassword())){
             throw new ServiceException("参数错误");
         }
+        if(Validator.hasChinese(websiteUsersDto.getUserName())){
+            throw new ServiceException("用户名含有不允许字符");
+        }
         if(!websiteUsersDto.getPassword().equals(websiteUsersDto.getConfirmPassword())){
             throw new ServiceException("两次密码不一致");
         }