Browse Source

登录判断

pt
zhizhi wu 4 years ago
parent
commit
ea22a1881e
  1. 9
      cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java

9
cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java

@ -84,12 +84,13 @@ public class MustLoginAspect {
return result;
}
//必须登录,未登录直接返回未登录相关信息
if (response == null || response.getCode().intValue() != CodeEnum.SUCCESS.getCode().intValue()) {
return response;
}
if (response.getData() == null) {
if (response == null || response.getData() == null) {
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
}
if (response.getCode().intValue() != CodeEnum.SUCCESS.getCode().intValue()) {
return response;
}
JSONObject json = JSONObject.parseObject(JSON.toJSONString(response.getData()));
Long userId = json.getLong("id");
String userName = json.getString("userName");

Loading…
Cancel
Save