修改增加校验token方法

parent fbe0fc3e
......@@ -432,8 +432,16 @@ public class UserController implements IBaseController {
*/
@RequestMapping("/exists_token")
public JsonResult checkToken(@RequestParam String token) {
if(StringUtils.isEmpty(token)){
return JsonResult.buildSuccessResult(null,false);
}
if(token.contains("*")){
return JsonResult.buildSuccessResult(null,false);
}
String tokenKey = Constants.SESSION_PREFIX + token;
return JsonResult.buildSuccessResult(null, stringRedisTemplate.hasKey(tokenKey));
String tokenKey2 = Constants.Session.USER_SESSION_CACHE + token;
return JsonResult.buildSuccessResult(null, stringRedisTemplate.hasKey(tokenKey)||stringRedisTemplate.hasKey(tokenKey2));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment