Commit a10aa3d4 authored by 何金镒's avatar 何金镒

建发社区token必须存在才能对话

parent 1027c09e
...@@ -155,13 +155,16 @@ public class DifyControllerV2 { ...@@ -155,13 +155,16 @@ public class DifyControllerV2 {
if(StrUtil.isBlank(token.getCcuId())){ if(StrUtil.isBlank(token.getCcuId())){
return Flux.just("未绑定主机"); return Flux.just("未绑定主机");
} }
if(StrUtil.isBlank(token.getRefreshToken())){ if(StrUtil.isBlank(token.getAccessToken())){
// 没有建发的token,有效期7天 // 没有建发的token,有效期7天
String cdc_token = cdcHttpUtils.getCDCToken(token.getCcuId(), token.getCDCOwnerId()); String cdc_token = cdcHttpUtils.getCDCToken(token.getCcuId(), token.getCDCOwnerId());
token.setAccessToken(cdc_token); token.setAccessToken(cdc_token);
tokenService.updateById(token); tokenService.updateById(token);
} }
if(StrUtil.isBlank(token.getAccessToken())){
log.error("未获取到建发的token,结束对话");
return Flux.just("未绑定社区账号");
}
//workflows/run //workflows/run
String url = "http://172.17.12.12:8088/v1/chat-messages"; String url = "http://172.17.12.12:8088/v1/chat-messages";
......
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