Compare commits
No commits in common. "cf8fdda4b67262da8b0aa2c219e084441b8d3b38" and "12aef3fcea068ad59635ca124e2819993c4807b8" have entirely different histories.
cf8fdda4b6
...
12aef3fcea
|
@ -1,6 +1,3 @@
|
|||
# 前缀为NEXT_PUBLIC_才可以被浏览器使用
|
||||
# NEXT_PUBLIC_TODO_REQUEST_URL=http://localhost:8092
|
||||
# NEXT_PUBLIC_SECURITY_REQUEST_URL=http://localhost:8091
|
||||
|
||||
NEXT_PUBLIC_TODO_REQUEST_URL=http://localhost:80/todo-server
|
||||
NEXT_PUBLIC_SECURITY_REQUEST_URL=http://localhost:80/security-server
|
||||
NEXT_PUBLIC_TODO_REQUEST_URL=http://localhost:8092
|
||||
NEXT_PUBLIC_SECURITY_REQUEST_URL=http://localhost:8091
|
|
@ -17,18 +17,6 @@ http {
|
|||
server {
|
||||
listen 3001;
|
||||
|
||||
# 设置允许跨域的域,* 表示允许任何域,也可以设置特定的域,has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
# 允许的方法
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
# 允许的头信息字段
|
||||
add_header 'Access-Control-Allow-Headers' 'User-Agent,Keep-Alive,Content-Type,Authorization,Origin' always;
|
||||
# 缓存时间
|
||||
add_header 'Access-Control-Max-Age' 1728000 always;
|
||||
# 预检请求的处理
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 204;
|
||||
}
|
||||
# 服务器名称
|
||||
server_name localhost;
|
||||
# 访问日志路径
|
||||
|
@ -43,10 +31,6 @@ http {
|
|||
# try_files $uri $uri/ =404;
|
||||
}
|
||||
location ^~ /todo-server/ {
|
||||
# 预检请求的处理
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 204;
|
||||
}
|
||||
# rewrite ^/todo-server/(.*)$ /$1 break;
|
||||
proxy_pass http://huayu-platform-todo:8092/;
|
||||
proxy_set_header Host $http_host;
|
||||
|
@ -54,12 +38,20 @@ http {
|
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
client_body_buffer_size 16k;
|
||||
client_max_body_size 100M;
|
||||
}
|
||||
location ^~ /security-server/ {
|
||||
# 预检请求的处理
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Origin, Authorization, Content-Type, Accept, X-Requested-With';
|
||||
|
||||
# 如果请求方法为 OPTIONS,则直接返回 204 状态码
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Origin, Authorization, Content-Type, Accept, X-Requested-With';
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
location ^~ /security-server/ {
|
||||
# rewrite ^/security-server/(.*)$ /$1 break;
|
||||
proxy_pass http://huayu-platform-security:8091/;
|
||||
proxy_set_header Host $http_host;
|
||||
|
@ -68,12 +60,19 @@ http {
|
|||
client_body_buffer_size 16k;
|
||||
client_max_body_size 100M;
|
||||
|
||||
}
|
||||
location /task/ {
|
||||
# 预检请求的处理
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Origin, Authorization, Content-Type, Accept, X-Requested-With';
|
||||
|
||||
# 如果请求方法为 OPTIONS,则直接返回 204 状态码
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Origin, Authorization, Content-Type, Accept, X-Requested-With';
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
location /task/ {
|
||||
rewrite ^/task/(.*)$ /task/$1.html break;
|
||||
}
|
||||
# 静态文件缓存配置
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import { Skeleton } from "antd";
|
||||
|
||||
export default function Loading() {
|
||||
return <Skeleton></Skeleton>;
|
||||
return <div>/Loading...</div>;
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
import { Skeleton } from "antd";
|
||||
|
||||
export default function Loading() {
|
||||
return <Skeleton></Skeleton>;
|
||||
return <div>/login/Loading...</div>;
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
'use client'
|
||||
import {ProConfigProvider} from "@ant-design/pro-components";
|
||||
import React, {lazy, Suspense} from "react";
|
||||
import Page from "@/ui/login/Page";
|
||||
// import Page from "@/ui/login/Page";
|
||||
import Loading from "@/app/loading";
|
||||
// const Page = lazy(() => import('@/ui/login/Page'));
|
||||
const Page = lazy(() => import('@/ui/login/Page'));
|
||||
export default function Login() {
|
||||
|
||||
return (
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
ProFormText,
|
||||
} from '@ant-design/pro-components';
|
||||
|
||||
import {Divider, Space, Tabs, message, theme, Modal, Button, Skeleton} from 'antd';
|
||||
import {Divider, Space, Tabs, message, theme, Modal, Button} from 'antd';
|
||||
import React, {CSSProperties, Suspense, useCallback, useEffect, useLayoutEffect} from 'react';
|
||||
import {useState} from 'react';
|
||||
import {CaptchaLoginSuccess, LoginObject} from "@/lib/login/definitions";
|
||||
|
@ -358,7 +358,7 @@ export default function Page() {
|
|||
忘记密码
|
||||
</a>
|
||||
</div>
|
||||
</LoginFormPage>:<Skeleton />}
|
||||
</LoginFormPage>:<Loading/>}
|
||||
</div>
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue