feat:加载设置
This commit is contained in:
parent
12aef3fcea
commit
a760fbfb1f
|
@ -1,3 +1,6 @@
|
|||
# 前缀为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: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
|
|
@ -17,6 +17,18 @@ http {
|
|||
server {
|
||||
listen 3001;
|
||||
|
||||
# 设置允许跨域的域,* 表示允许任何域,也可以设置特定的域
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
# 允许的方法
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
# 允许的头信息字段
|
||||
add_header 'Access-Control-Allow-Headers' 'User-Agent,Keep-Alive,Content-Type';
|
||||
# 缓存时间
|
||||
add_header 'Access-Control-Max-Age' 1728000;
|
||||
# 预检请求的处理
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 204;
|
||||
}
|
||||
# 服务器名称
|
||||
server_name localhost;
|
||||
# 访问日志路径
|
||||
|
@ -38,18 +50,6 @@ http {
|
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
client_body_buffer_size 16k;
|
||||
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/ {
|
||||
# rewrite ^/security-server/(.*)$ /$1 break;
|
||||
|
@ -60,17 +60,6 @@ http {
|
|||
client_body_buffer_size 16k;
|
||||
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/ {
|
||||
rewrite ^/task/(.*)$ /task/$1.html break;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { Skeleton } from "antd";
|
||||
|
||||
export default function Loading() {
|
||||
return <div>/Loading...</div>;
|
||||
return <Skeleton></Skeleton>;
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
import { Skeleton } from "antd";
|
||||
|
||||
export default function Loading() {
|
||||
return <div>/login/Loading...</div>;
|
||||
return <Skeleton></Skeleton>;
|
||||
}
|
|
@ -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} from 'antd';
|
||||
import {Divider, Space, Tabs, message, theme, Modal, Button, Skeleton} 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>:<Loading/>}
|
||||
</LoginFormPage>:<Skeleton />}
|
||||
</div>
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue