|
|
@ -24,6 +24,7 @@ import com.elink.esua.epdc.service.ResourceService; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
@ -33,6 +34,8 @@ import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
/** |
|
|
|
* 授权管理 |
|
|
@ -82,6 +85,14 @@ public class AuthController { |
|
|
|
//获取登录授权信息
|
|
|
|
AuthorizationDTO authorization = authService.login(login); |
|
|
|
|
|
|
|
if (authorization!=null && StringUtils.isNotEmpty(authorization.getToken())){ |
|
|
|
String check = "^(?=.{10})(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\\d)(?=.*?[*?!&¥$%^#,./@\";:><\\[\\]}{\\-=+_\\\\|》《。,、?’‘“”~ `]).*$"; |
|
|
|
Pattern pattern = Pattern.compile(check); |
|
|
|
Matcher matcher = pattern.matcher(login.getPassword()); |
|
|
|
if (!matcher.matches()){ |
|
|
|
return new Result<AuthorizationDTO>().error("长度不小于10个字符且必须包含大小写、数字、特殊符号', '密码复杂度不符合要求,请前往修改!"); |
|
|
|
} |
|
|
|
} |
|
|
|
return new Result<AuthorizationDTO>().ok(authorization); |
|
|
|
} |
|
|
|
|
|
|
|