|
@@ -3,6 +3,7 @@ package com.zanxiang.game.module.sdk.adapter;
|
|
|
import com.zanxiang.game.module.base.pojo.enums.HttpStatusEnum;
|
|
|
import com.zanxiang.game.module.mybatis.entity.GameExt;
|
|
|
import com.zanxiang.game.module.sdk.annotation.ValidLogin;
|
|
|
+import com.zanxiang.game.module.sdk.exception.TokenExpireException;
|
|
|
import com.zanxiang.game.module.sdk.pojo.dto.UserTokenDTO;
|
|
|
import com.zanxiang.game.module.sdk.pojo.param.UserData;
|
|
|
import com.zanxiang.game.module.sdk.service.IGameExtService;
|
|
@@ -54,7 +55,7 @@ public class ArgumentAdapter implements HandlerMethodArgumentResolver {
|
|
|
String token = request.getHeader("token");
|
|
|
//需要登录, token不存在
|
|
|
if (b && Strings.isBlank(token)) {
|
|
|
- throw new BaseException(HttpStatusEnum.USER_NO_LOGIN.getMsg());
|
|
|
+ throw new TokenExpireException(HttpStatusEnum.USER_NO_LOGIN.getMsg());
|
|
|
}
|
|
|
//设备类型
|
|
|
Integer deviceType = Integer.valueOf(request.getHeader("deviceType"));
|
|
@@ -85,12 +86,12 @@ public class ArgumentAdapter implements HandlerMethodArgumentResolver {
|
|
|
UserTokenDTO userTokenDTO = userTokenService.getTokenInfoByTokenDevice(token, deviceType);
|
|
|
if (userTokenDTO == null) {
|
|
|
if (b) {
|
|
|
- throw new BaseException(HttpStatusEnum.USER_NO_LOGIN.getMsg());
|
|
|
+ throw new TokenExpireException(HttpStatusEnum.USER_NO_LOGIN.getMsg());
|
|
|
}
|
|
|
return data;
|
|
|
}
|
|
|
if (b && userTokenDTO.getUserId() == null) {
|
|
|
- throw new BaseException(HttpStatusEnum.USER_NO_LOGIN.getMsg());
|
|
|
+ throw new TokenExpireException(HttpStatusEnum.USER_NO_LOGIN.getMsg());
|
|
|
}
|
|
|
data.setUserId(userTokenDTO.getUserId());
|
|
|
data.setToken(userTokenDTO.getToken());
|