|
@@ -3,7 +3,9 @@ package com.zanxiang.game.module.sdk.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.zanxiang.game.module.base.pojo.enums.BanStatusEnum;
|
|
|
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
|
|
|
import com.zanxiang.game.module.base.util.DateUtils;
|
|
|
+import com.zanxiang.game.module.mybatis.entity.Game;
|
|
|
import com.zanxiang.game.module.mybatis.entity.GameExt;
|
|
|
import com.zanxiang.game.module.mybatis.entity.User;
|
|
|
import com.zanxiang.game.module.mybatis.entity.UserToken;
|
|
@@ -55,6 +57,9 @@ public class UserTokenServiceImpl extends ServiceImpl<UserTokenMapper, UserToken
|
|
|
@Autowired
|
|
|
private IUserLoginLogService userLoginLogService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IGameService gameService;
|
|
|
+
|
|
|
@Override
|
|
|
public ResultVO<Long> cpTokenCheck(String appId, Long userId, String token, String sign) {
|
|
|
//查询登录签名
|
|
@@ -100,6 +105,11 @@ public class UserTokenServiceImpl extends ServiceImpl<UserTokenMapper, UserToken
|
|
|
@Override
|
|
|
public Boolean userTokenExpireTimeCheck(UserData userData) {
|
|
|
log.error("缓存token验证请求 userData : {}", JsonUtil.toString(userData));
|
|
|
+ //微信小游戏, 解决前端没有checkSession的问题, 临时方案, 每次都重新登录
|
|
|
+ Game game = gameService.getById(userData.getGameId());
|
|
|
+ if (game == null || Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getId())) {
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
//判断是否存在用户id或者token是否存在
|
|
|
if (userData.getUserId() == null || Strings.isBlank(userData.getToken())) {
|
|
|
return Boolean.FALSE;
|