代码优化

pull/167/head
dqjdda 2019-10-27 21:38:47 +08:00
parent 7fe31802a7
commit bb5cc6f6ce
1 changed files with 5 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import me.zhengjie.modules.security.utils.JwtTokenUtil;
import me.zhengjie.utils.SecurityUtils;
import me.zhengjie.utils.StringUtils;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AccountExpiredException;
@ -37,6 +38,9 @@ import javax.servlet.http.HttpServletRequest;
@Api(tags = "系统:系统授权接口")
public class AuthenticationController {
@Value("${jwt.online}")
private String onlineKey;
private final JwtTokenUtil jwtTokenUtil;
private final RedisService redisService;
@ -100,7 +104,7 @@ public class AuthenticationController {
captcha.setLen(2);
// 获取运算的结果5
String result = captcha.text();
String uuid = IdUtil.simpleUUID();
String uuid = onlineKey + IdUtil.simpleUUID();
redisService.saveCode(uuid,result);
return new ImgResult(captcha.toBase64(),uuid);
}