1018653686@qq.com преди 1 година
родител
ревизия
6886055198
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/controller/open/OpenWesiteUserController.java

+ 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("两次密码不一致");
         }