接口优化
This commit is contained in:
@@ -6,6 +6,8 @@ import com.emotion.dto.response.AuthResponse;
|
||||
import com.emotion.dto.response.CaptchaResponse;
|
||||
import com.emotion.dto.response.UserInfoResponse;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 认证服务接口
|
||||
*
|
||||
@@ -64,12 +66,12 @@ public interface AuthService {
|
||||
boolean logout(String userId, String token);
|
||||
|
||||
/**
|
||||
* 用户登出(通过令牌)
|
||||
* 用户登出(通过请求)
|
||||
*
|
||||
* @param token 访问令牌
|
||||
* @param request HTTP请求
|
||||
* @return 是否登出成功
|
||||
*/
|
||||
boolean logoutByToken(String token);
|
||||
boolean logoutByToken(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 刷新访问令牌
|
||||
@@ -79,6 +81,14 @@ public interface AuthService {
|
||||
*/
|
||||
AuthResponse refreshToken(String refreshToken);
|
||||
|
||||
/**
|
||||
* 验证访问令牌
|
||||
*
|
||||
* @param request HTTP请求
|
||||
* @return 是否有效
|
||||
*/
|
||||
boolean validateToken(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 验证访问令牌
|
||||
*
|
||||
@@ -126,4 +136,4 @@ public interface AuthService {
|
||||
* @return 是否存在
|
||||
*/
|
||||
boolean existsByPhone(String phone);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user