Browse Source

运营端验证码报错提示修改,运营端同一个账号做登录强踢

dev
wangchao 5 years ago
parent
commit
f4a0f74142
  1. 3
      epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java
  2. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 4
      epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java

3
epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.service.impl;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -248,7 +249,7 @@ public class LoginServiceImpl implements LoginService {
//1、验证码是否正确
boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha());
if (!flag) {
return new Result<UserTokenResultDTO>().error(ErrorCode.CAPTCHA_ERROR);
return new Result<UserTokenResultDTO>().error(EpmetErrorCode.ERR10019.getCode());
}
//2、账号是否存在
//获取用户信息

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -9,6 +9,7 @@ public enum EpmetErrorCode {
ERR10005(10005, "token不能为空"),
ERR10006(10006, "登录超时,请重新登录"),
ERR10007(10007, "当前帐号已在别处登录"),
ERR10019(10019, "验证码不正确"),
ERR401(401, "未授权"),
VALIDATE_ERROR(7000, "数据校验异常"),
SERVER_ERROR(8000, "服务器开小差了..."),

4
epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java

@ -100,6 +100,10 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpA
// 政府端
GovTokenDto govTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, GovTokenDto.class);
validateTokenDto(govTokenDto, token);
} else if(AppClientConstant.APP_OPER.equals(baseTokenDto.getApp())){
//运营端
TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, TokenDto.class);
validateTokenDto(resiTokenDto, token);
}
//当前登录用户userId,添加到header中

Loading…
Cancel
Save