网管过滤器,用户id穿透到下游

This commit is contained in:
2026-02-04 16:54:44 +08:00
parent a6a5d42bea
commit 2e18a8a419
6 changed files with 70 additions and 9 deletions
@@ -3,10 +3,7 @@ package top.crushtj.xiaoyi.auth.controller;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import top.crushtj.framework.biz.operationlog.aspect.ApiOperationLog;
import top.crushtj.framework.common.response.Response;
import top.crushtj.xiaoyi.auth.model.vo.user.UserLoginReqVO;
@@ -36,7 +33,7 @@ public class UserController {
@PostMapping("/logout")
@ApiOperationLog(description = "用户登出")
public Response<Void> logout() {
public Response<Void> logout(@RequestHeader("userId") String userId) {
// todo 实现用户登出逻辑
return Response.success();
}
@@ -14,6 +14,7 @@ sa-token:
token-prefix: Bearer
# token 有效期(单位:秒) 默认30天,-1 代表永久有效
timeout: 2592000
# timeout: 60
# token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
active-timeout: -1
# 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)