|
@@ -162,16 +162,19 @@ public class UserController {
|
|
|
int result = userService.insertRegister(user);
|
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
|
}
|
|
|
- @RequestMapping(value = "getUserStatus", method = RequestMethod.POST)
|
|
|
- @ApiOperation(value = "获取用户当前状态",notes = "返回0代表超时,其他代表用户被禁用了")
|
|
|
+ @RequestMapping(value = "getUserStatus")
|
|
|
+ @ApiOperation(value = "获取用户当前状态",notes = "返回0代表超时,1有其他用户登录了,其他用户被禁用")
|
|
|
public AjaxMessage<Integer> getUserStatus(@ApiParam(value = "accessToken", required = true)@RequestParam String accessToken) {
|
|
|
String key="offlineStatus:"+ accessToken;
|
|
|
byte[] bytes = redisUtil.get(key.getBytes());
|
|
|
- Optional<Integer> status = ByteArrayUtils.bytesToObject(bytes);
|
|
|
int result=0;
|
|
|
- if(status!=null){
|
|
|
+ if(bytes!=null){
|
|
|
+ Optional<Integer> status = ByteArrayUtils.bytesToObject(bytes);
|
|
|
result=status.get();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
|
}
|
|
|
|