|
|
@@ -308,12 +308,10 @@ public class MirrorController {
|
|
|
public void midjourneyMirror(@PathVariable Long relationId,HttpServletResponse response) throws IOException {
|
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
String userToken = midjourneyAccountService.getMidjourneyUserToken(userId, relationId);
|
|
|
- Cookie cookie = new Cookie("userToken", userToken);
|
|
|
- cookie.setMaxAge(31536000);
|
|
|
- cookie.setDomain(midjourneyHost);
|
|
|
- cookie.setPath("/");
|
|
|
- response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
- response.addCookie(cookie);
|
|
|
- response.sendRedirect("https://"+midjourneyHost+"/draw/web/");
|
|
|
+ String cookieValue = "userToken=" + userToken + "; Max-Age=31536000; Path=/; SameSite=None; Secure";
|
|
|
+ response.setHeader("Set-Cookie", cookieValue);
|
|
|
+ response.setHeader("Location", "https://" + midjourneyHost + "/draw/web/");
|
|
|
+ response.setStatus(HttpServletResponse.SC_FOUND);
|
|
|
+ response.getWriter().flush();
|
|
|
}
|
|
|
}
|