mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 18:15:56 +08:00
update 退出登录功能 token失效 getUsername可能会抛异常的情况
Signed-off-by: Liang <le_yiang@163.com>
This commit is contained in:
parent
0c54416040
commit
84beb0a6ba
@ -125,6 +125,8 @@ public class SysLoginService {
|
||||
*/
|
||||
public void logout() {
|
||||
try {
|
||||
//此处应该先检查token是否有效 否则getUsername 可能会抛异常
|
||||
StpUtil.checkLogin();
|
||||
String username = LoginHelper.getUsername();
|
||||
StpUtil.logout();
|
||||
asyncService.recordLogininfor(username, Constants.LOGOUT, MessageUtils.message("user.logout.success"), ServletUtils.getRequest());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user