mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 12:48:58 +08:00
♻️ Refactoring code. 重构 TokenEndpoint 修改 mapping path
This commit is contained in:
parent
baa890379b
commit
72d385bd0f
@ -92,6 +92,7 @@ public class PigTokenEndpoint {
|
||||
|
||||
/**
|
||||
* 认证页面
|
||||
*
|
||||
* @param modelAndView
|
||||
* @param error 表单登录失败处理回调的错误信息
|
||||
* @return ModelAndView
|
||||
@ -124,6 +125,7 @@ public class PigTokenEndpoint {
|
||||
|
||||
/**
|
||||
* 退出并删除token
|
||||
*
|
||||
* @param authHeader Authorization
|
||||
*/
|
||||
@DeleteMapping("/logout")
|
||||
@ -138,6 +140,7 @@ public class PigTokenEndpoint {
|
||||
|
||||
/**
|
||||
* 校验token
|
||||
*
|
||||
* @param token 令牌
|
||||
*/
|
||||
@SneakyThrows
|
||||
@ -168,10 +171,11 @@ public class PigTokenEndpoint {
|
||||
|
||||
/**
|
||||
* 令牌管理调用
|
||||
*
|
||||
* @param token token
|
||||
*/
|
||||
@Inner
|
||||
@DeleteMapping("/{token}")
|
||||
@DeleteMapping("/remove/{token}")
|
||||
public R<Boolean> removeToken(@PathVariable("token") String token) {
|
||||
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
||||
if (authorization == null) {
|
||||
@ -194,6 +198,7 @@ public class PigTokenEndpoint {
|
||||
|
||||
/**
|
||||
* 查询token
|
||||
*
|
||||
* @param params 分页参数
|
||||
* @return
|
||||
*/
|
||||
|
@ -50,7 +50,7 @@ public interface RemoteTokenService {
|
||||
* @param from 内部调用标志
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/token/{token}")
|
||||
@DeleteMapping("/token/remove/{token}")
|
||||
R<Boolean> removeTokenById(@PathVariable("token") String token, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
|
@ -39,7 +39,7 @@ import java.util.Map;
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/token")
|
||||
@RequestMapping("/sys-token")
|
||||
@Tag(description = "token", name = "令牌管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysTokenController {
|
||||
|
Loading…
Reference in New Issue
Block a user