mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-26 11:51:55 +08:00
[feat] 透传鉴权结果到AI服务
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package com.ruoyi.auth.controller;
|
package com.ruoyi.auth.controller;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -82,7 +84,8 @@ public class TokenController
|
|||||||
* @return ResponseEntity: 返回一个空的响应体,表示令牌验证通过
|
* @return ResponseEntity: 返回一个空的响应体,表示令牌验证通过
|
||||||
*/
|
*/
|
||||||
@RequestMapping("verify")
|
@RequestMapping("verify")
|
||||||
public ResponseEntity<?> verifyToken() {
|
public ResponseEntity<?> verifyToken(HttpServletResponse response) {
|
||||||
|
response.setHeader("X-User-ID", String.valueOf(SecurityUtils.getUserId()));
|
||||||
// 返回一个HTTP 200 OK响应,表示令牌有效
|
// 返回一个HTTP 200 OK响应,表示令牌有效
|
||||||
return ResponseEntity.ok().build();
|
return ResponseEntity.ok().build();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user