|
|
@@ -52,6 +52,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
private static final String RELAX_HOST = "http://43.154.230.104:8080";
|
|
|
private static final String FAST_HOST = "https://aigc.api4midjourney.com/api";
|
|
|
private static final String FAST_TOKEN = "14a6b469-7cb2-4b99-9238-676c7c5cffef";
|
|
|
+ private static final String RELAX_TOKEN = "5a9a3e9b-5a5e-4b6b-9a5a-9a5a5a5a5a5a";
|
|
|
|
|
|
private final MidjourneyUserConversationMapper conversationMapper;
|
|
|
|
|
|
@@ -276,7 +277,9 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
}
|
|
|
url = url + getActionUrl(action);
|
|
|
param.put("notifyHook",midjourneyHost +(EnvCommonService.active.equals(envCommonService.getEnv()) ? "/8081":"/8082") + "/api/applets/midjourney/notifyHook");
|
|
|
- String body = HttpRequest.post(url).body(Jsons.toJson(param)).header("Authorization", FAST_TOKEN).execute().body();
|
|
|
+ HttpRequest request = HttpRequest.post(url).body(Jsons.toJson(param));
|
|
|
+ request = mode == 1 ? request.header("Authorization", FAST_TOKEN) : request.header("mj-api-secret", RELAX_TOKEN);
|
|
|
+ String body = request.execute().body();
|
|
|
log.info("action body:{}", body);
|
|
|
SubmitResult submitResult = Jsons.parseObject(body, SubmitResult.class);
|
|
|
int code = submitResult.getCode();
|