|
|
@@ -24,7 +24,7 @@ public class WebApiServiceImpl implements WebApiService {
|
|
|
private IBzPlayerService playerService;
|
|
|
|
|
|
@Resource
|
|
|
- private StringRedisTemplate redisTemplate;
|
|
|
+ private StringRedisTemplate stringRedisTemplate;
|
|
|
|
|
|
@Override
|
|
|
public LoginResultDto login(LoginInfoDto loginInfo) {
|
|
|
@@ -37,7 +37,7 @@ public class WebApiServiceImpl implements WebApiService {
|
|
|
|
|
|
String toEncode = UUID.randomUUID().toString().concat(String.valueOf(loginInfo.getTimestamp()));
|
|
|
String token = EncodeUtils.customBase64Encode(toEncode);
|
|
|
- redisTemplate.opsForValue().set(TOKEN_PRIFIX.concat(loginInfo.getCardNo()),token);
|
|
|
+ stringRedisTemplate.opsForValue().set(TOKEN_PRIFIX.concat(loginInfo.getCardNo()),token);
|
|
|
LoginResultDto loginResultDto = new LoginResultDto();
|
|
|
loginResultDto.setToken(token);
|
|
|
loginResultDto.setCardNo(loginResultDto.getCardNo());
|
|
|
@@ -52,13 +52,13 @@ public class WebApiServiceImpl implements WebApiService {
|
|
|
BzPlayer player = playerService.getOne(queryWrapper,false);
|
|
|
Assert.notNull(player,"No player found");
|
|
|
|
|
|
- String token = redisTemplate.opsForValue().get(TOKEN_PRIFIX.concat(logoutDto.getCardNo()));
|
|
|
+ String token = stringRedisTemplate.opsForValue().get(TOKEN_PRIFIX.concat(logoutDto.getCardNo()));
|
|
|
if(null!=token){
|
|
|
if(!token.equals(logoutDto.getToken())){
|
|
|
throw new RuntimeException("Illegal request for user: " + logoutDto.getCardNo());
|
|
|
}
|
|
|
}
|
|
|
- redisTemplate.delete(TOKEN_PRIFIX.concat(logoutDto.getCardNo()));
|
|
|
+ stringRedisTemplate.delete(TOKEN_PRIFIX.concat(logoutDto.getCardNo()));
|
|
|
}
|
|
|
|
|
|
|