mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-10 20:04:06 +08:00
优化代码
This commit is contained in:
parent
ad02bcad59
commit
57535a2ce7
@ -14,7 +14,6 @@ public class PlayEduFCtx {
|
||||
private static final String KEY_USER_ID = "user_id";
|
||||
private static final String KEY_USER = "user";
|
||||
private static final String KEY_JWT_JTI = "jwt_jti";
|
||||
private static final String KEY_TOKEN = "token";
|
||||
|
||||
public PlayEduFCtx() {
|
||||
}
|
||||
@ -59,12 +58,4 @@ public class PlayEduFCtx {
|
||||
public static String getJwtJti() {
|
||||
return (String) get(KEY_JWT_JTI);
|
||||
}
|
||||
|
||||
public static void setToken(String token) {
|
||||
put(KEY_TOKEN, token);
|
||||
}
|
||||
|
||||
public static String getToken() {
|
||||
return (String) get(KEY_TOKEN);
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public class LoginController {
|
||||
|
||||
@PostMapping("/logout")
|
||||
public JsonResponse logout() throws JwtLogoutException {
|
||||
jwtService.logout(RequestUtil.token(), SystemConstant.JWT_PRV_ADMIN_USER);
|
||||
jwtService.adminUserLogout(RequestUtil.token());
|
||||
return JsonResponse.success("success");
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class LoginController {
|
||||
|
||||
@PostMapping("/logout")
|
||||
public JsonResponse logout() throws JwtLogoutException {
|
||||
jwtService.userLogout(PlayEduFCtx.getToken());
|
||||
jwtService.userLogout(RequestUtil.token());
|
||||
ctx.publishEvent(new UserLogoutEvent(this, PlayEduFCtx.getUserId(), PlayEduFCtx.getJwtJti()));
|
||||
return JsonResponse.success();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user