Commit 33502dd9 authored by 李超鹏's avatar 李超鹏

token 添加前缀

parent fba728e6
Pipeline #7455 canceled with stages
......@@ -3,6 +3,7 @@ package cc.shenjiying.ai.manager;
import cc.shenjiying.ai.client.QuickSearchApi;
import cc.shenjiying.ai.dto.QuickSearchResponse;
import cc.shenjiying.ai.dto.VipInfoDTO;
import io.quarkus.runtime.util.StringUtil;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.eclipse.microprofile.rest.client.inject.RestClient;
......@@ -15,6 +16,12 @@ public class ChannelTokenService {
QuickSearchApi quickSearchApi;
public VipInfoDTO getVip(String channel, String token) {
if (StringUtil.isNullOrEmpty(token)) {
return null;
}
if (!token.startsWith("Bearer ")) {
token = "Bearer " + token;
}
QuickSearchResponse response = quickSearchApi.getVip(token);
if (response.getCode() == 0) {
return response.getData();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment