|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cyksj.web.controller.api;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.cyksj.common.annotation.NoSubmit;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
@@ -60,6 +61,15 @@ public class GptQuickLinkController {
|
|
|
@GetMapping("/get/chatGpt/page/{code}")
|
|
|
public Result<GptQuickLinkResp> getCharGptPageByCode(@PathVariable String code) {
|
|
|
GptQuickLinkResp resp = gptQuickLinkService.getQuickUrlByCode(code.trim());
|
|
|
+ if (resp.getState() == 4) {
|
|
|
+ Long userId = resp.getUserId();
|
|
|
+ String token = StpUserUtil.getTokenValueByLoginId(userId);
|
|
|
+ if (StrUtil.isEmpty(token)) {
|
|
|
+ StpUserUtil.login(resp.getUserId());
|
|
|
+ token = StpUserUtil.getTokenValue();
|
|
|
+ }
|
|
|
+ resp.setToken(token);
|
|
|
+ }
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(resp);
|
|
|
}
|
|
|
}
|