Compare commits
2 Commits
12aef3fcea
...
cf8fdda4b6
Author | SHA1 | Date |
---|---|---|
|
cf8fdda4b6 | |
|
a760fbfb1f |
|
@ -1,3 +1,6 @@
|
||||||
# 前缀为NEXT_PUBLIC_才可以被浏览器使用
|
# 前缀为NEXT_PUBLIC_才可以被浏览器使用
|
||||||
NEXT_PUBLIC_TODO_REQUEST_URL=http://localhost:8092
|
# NEXT_PUBLIC_TODO_REQUEST_URL=http://localhost:8092
|
||||||
NEXT_PUBLIC_SECURITY_REQUEST_URL=http://localhost:8091
|
# 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
|
|
@ -17,6 +17,18 @@ http {
|
||||||
server {
|
server {
|
||||||
listen 3001;
|
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;
|
server_name localhost;
|
||||||
# 访问日志路径
|
# 访问日志路径
|
||||||
|
@ -31,6 +43,10 @@ http {
|
||||||
# try_files $uri $uri/ =404;
|
# try_files $uri $uri/ =404;
|
||||||
}
|
}
|
||||||
location ^~ /todo-server/ {
|
location ^~ /todo-server/ {
|
||||||
|
# 预检请求的处理
|
||||||
|
if ($request_method = 'OPTIONS') {
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
# rewrite ^/todo-server/(.*)$ /$1 break;
|
# rewrite ^/todo-server/(.*)$ /$1 break;
|
||||||
proxy_pass http://huayu-platform-todo:8092/;
|
proxy_pass http://huayu-platform-todo:8092/;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
|
@ -38,20 +54,12 @@ http {
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
client_body_buffer_size 16k;
|
client_body_buffer_size 16k;
|
||||||
client_max_body_size 100M;
|
client_max_body_size 100M;
|
||||||
|
|
||||||
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/ {
|
location ^~ /security-server/ {
|
||||||
|
# 预检请求的处理
|
||||||
|
if ($request_method = 'OPTIONS') {
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
# rewrite ^/security-server/(.*)$ /$1 break;
|
# rewrite ^/security-server/(.*)$ /$1 break;
|
||||||
proxy_pass http://huayu-platform-security:8091/;
|
proxy_pass http://huayu-platform-security:8091/;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
|
@ -60,19 +68,12 @@ http {
|
||||||
client_body_buffer_size 16k;
|
client_body_buffer_size 16k;
|
||||||
client_max_body_size 100M;
|
client_max_body_size 100M;
|
||||||
|
|
||||||
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/ {
|
location /task/ {
|
||||||
|
# 预检请求的处理
|
||||||
|
if ($request_method = 'OPTIONS') {
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
rewrite ^/task/(.*)$ /task/$1.html break;
|
rewrite ^/task/(.*)$ /task/$1.html break;
|
||||||
}
|
}
|
||||||
# 静态文件缓存配置
|
# 静态文件缓存配置
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { Skeleton } from "antd";
|
||||||
|
|
||||||
export default function Loading() {
|
export default function Loading() {
|
||||||
return <div>/Loading...</div>;
|
return <Skeleton></Skeleton>;
|
||||||
}
|
}
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { Skeleton } from "antd";
|
||||||
|
|
||||||
export default function Loading() {
|
export default function Loading() {
|
||||||
return <div>/login/Loading...</div>;
|
return <Skeleton></Skeleton>;
|
||||||
}
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
'use client'
|
'use client'
|
||||||
import {ProConfigProvider} from "@ant-design/pro-components";
|
import {ProConfigProvider} from "@ant-design/pro-components";
|
||||||
import React, {lazy, Suspense} from "react";
|
import React, {lazy, Suspense} from "react";
|
||||||
// import Page from "@/ui/login/Page";
|
import Page from "@/ui/login/Page";
|
||||||
import Loading from "@/app/loading";
|
import Loading from "@/app/loading";
|
||||||
const Page = lazy(() => import('@/ui/login/Page'));
|
// const Page = lazy(() => import('@/ui/login/Page'));
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
ProFormText,
|
ProFormText,
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
|
|
||||||
import {Divider, Space, Tabs, message, theme, Modal, Button} from 'antd';
|
import {Divider, Space, Tabs, message, theme, Modal, Button, Skeleton} from 'antd';
|
||||||
import React, {CSSProperties, Suspense, useCallback, useEffect, useLayoutEffect} from 'react';
|
import React, {CSSProperties, Suspense, useCallback, useEffect, useLayoutEffect} from 'react';
|
||||||
import {useState} from 'react';
|
import {useState} from 'react';
|
||||||
import {CaptchaLoginSuccess, LoginObject} from "@/lib/login/definitions";
|
import {CaptchaLoginSuccess, LoginObject} from "@/lib/login/definitions";
|
||||||
|
@ -358,7 +358,7 @@ export default function Page() {
|
||||||
忘记密码
|
忘记密码
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</LoginFormPage>:<Loading/>}
|
</LoginFormPage>:<Skeleton />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
Loading…
Reference in New Issue