|
|
@@ -28,6 +28,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.Cookie;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
@@ -311,7 +312,10 @@ public class MirrorController {
|
|
|
public Result<String> midjourneyMirror(@PathVariable Long relationId) throws IOException {
|
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
String userToken = midjourneyAccountService.getMidjourneyUserToken(userId, relationId);
|
|
|
- response.setHeader("userToken", userToken);
|
|
|
+ Cookie cookie = new Cookie("userToken", userToken);
|
|
|
+ cookie.setMaxAge(31536000);
|
|
|
+ cookie.setPath("/");
|
|
|
+ response.addCookie(cookie);
|
|
|
response.sendRedirect(midjourneyHost+"/draw/web/");
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(userToken);
|
|
|
}
|