|
@@ -7,6 +7,7 @@ import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
|
+import com.fs.common.utils.PatternUtils;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
@@ -154,6 +155,10 @@ public class CompanyUserController extends BaseController
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@Validated @RequestBody CompanyUser user)
|
|
|
{
|
|
|
+ if (!PatternUtils.checkPassword(user.getPassword())) {
|
|
|
+ return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
|
|
|
+ }
|
|
|
+
|
|
|
//判断用户数量是否已达到上线
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Integer count=companyUserService.selectCompanyUserCountByCompanyId(loginUser.getCompany().getCompanyId());
|
|
@@ -227,6 +232,9 @@ public class CompanyUserController extends BaseController
|
|
|
@PutMapping("/resetPwd")
|
|
|
public AjaxResult resetPwd(@RequestBody CompanyUser user)
|
|
|
{
|
|
|
+ if (!PatternUtils.checkPassword(user.getPassword())) {
|
|
|
+ return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
|
|
|
+ }
|
|
|
return toAjax(companyUserService.resetUserPwdByUserId(user.getUserId(), SecurityUtils.encryptPassword(user.getPassword())));
|
|
|
}
|
|
|
|