补全登录退出接口并统一登出路径

This commit is contained in:
2026-04-12 13:05:46 +08:00
parent 2e6c59cfb6
commit 05f47b92a8
3 changed files with 12 additions and 10 deletions
@@ -3,14 +3,10 @@ package com.guo.learningprogresstracker.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import com.guo.learningprogresstracker.exception.AppException;
import com.guo.learningprogresstracker.service.LoginService;
import com.guo.learningprogresstracker.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class LoginServiceImpl implements LoginService {
@Autowired
private UserService userService;
@Override
public String login(String userId) throws AppException {
@@ -18,4 +14,9 @@ public class LoginServiceImpl implements LoginService {
//todo Token只在此处使用了,属于后续优化点
return StpUtil.getTokenInfo().getTokenValue();
}
@Override
public void logout() {
StpUtil.logout();
}
}