check_token 改为post接口

This commit is contained in:
zhangqinbin
2024-09-19 09:18:21 +08:00
parent a1fc736393
commit 29ca6d97b3
2 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.SecurityEntity;
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.fallback.UnifastOAuthClientFallbackFactory; import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.fallback.UnifastOAuthClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
/** /**
@ -18,4 +19,7 @@ public interface UnifastOAuthClient {
@GetMapping("oauth/check_token") @GetMapping("oauth/check_token")
SecurityEntity get(@RequestParam("token") String token); SecurityEntity get(@RequestParam("token") String token);
@PostMapping("oauth/check_token")
SecurityEntity getPost(@RequestParam("token") String token);
} }

View File

@ -180,7 +180,7 @@ public class UserInfoServiceImpl implements UserInfoService {
*/ */
private SecurityEntity getAuthentication(String token) { private SecurityEntity getAuthentication(String token) {
try { try {
return client.get(token); return client.getPost(token);
} catch (Exception e) { } catch (Exception e) {
log.error("Authentication Token: {}", token); log.error("Authentication Token: {}", token);
log.error(e.getMessage()); log.error(e.getMessage());