♻️ Refactoring code. 重构 TokenEndpoint 修改 mapping path

This commit is contained in:
冷冷 2024-04-04 21:14:53 +08:00
parent baa890379b
commit 72d385bd0f
3 changed files with 139 additions and 134 deletions

View File

@ -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
*/

View File

@ -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);
/**

View File

@ -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 {