This commit is contained in:
luke 2025-06-09 14:03:55 +08:00
parent a8c8682920
commit 7886ec3267

View File

@ -1,6 +1,7 @@
package com.knowledge.base.infrastructure.north.controller;
import com.knowledge.base.application.service.UserAppService;
import com.knowledge.base.infrastructure.config.ConstantConfig;
import com.knowledge.base.infrastructure.north.dto.role.UserRoleDTO;
import com.knowledge.base.infrastructure.north.dto.user.UserDTO;
import com.knowledge.base.infrastructure.north.dto.user.UserTokenDTO;
@ -21,7 +22,7 @@ public class UserQueryController {
@GetMapping("/check")
public ResponseEntity<?> check(
@CookieValue(value = "token", required = false) String cookieToken,
@CookieValue(value = ConstantConfig.COOKIE_KEY, required = false) String cookieToken,
@RequestHeader(value = "Authorization", required = false) String headerToken
) {
String token = headerToken != null ? headerToken : cookieToken;
@ -33,7 +34,7 @@ public class UserQueryController {
@GetMapping("/username")
public ResponseEntity<?> getUsernameByToken(
@CookieValue(value = "token", required = false) String cookieToken,
@CookieValue(value = ConstantConfig.COOKIE_KEY, required = false) String cookieToken,
@RequestHeader(value = "Authorization", required = false) String headerToken
) {
String token = headerToken != null ? headerToken : cookieToken;