补全登录退出接口并统一登出路径
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user