diff --git a/docker/deploy.md b/docker/deploy.md index b57c808..8743595 100644 --- a/docker/deploy.md +++ b/docker/deploy.md @@ -31,4 +31,9 @@ docker run -d -p 3001:80 -p 3002:443 --network task-manager --restart unless-sto # 复制证书到云服务器 scp -r cert/ root@121.36.71.28:/usr/local/software/nginx-1.28.0/ + +scp -r out/ root@121.36.71.28:/usr/share/nginx/html + +cp -rf ./* ../ + ``` \ No newline at end of file diff --git a/docker/nginx-yun.conf b/docker/nginx-yun.conf index 2d3f5ef..b62c73a 100644 --- a/docker/nginx-yun.conf +++ b/docker/nginx-yun.conf @@ -72,7 +72,28 @@ http { try_files $uri $uri.html $uri/ =404; # try_files $uri $uri/ =404; } + # 第二个页面的配置 + location /todo { + # 关键配置:禁用重定向中的端口和绝对路径 + absolute_redirect off; + port_in_redirect off; + # 指定根目录 + alias /usr/share/nginx/html/todo; + index index.html index.htm; + + # 正确的文件查找逻辑:所有路由都返回 index.html + try_files $uri $uri/ /todo/index.html; + + # 安全头部 + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + + # 确保不会重定向到带端口的URL + add_header X-Forwarded-Host $host; + add_header X-Forwarded-Port 443; + add_header X-Forwarded-Proto https; + } # 第二个页面的配置 location ^~ /mobile/ { # index index.html index.htm; @@ -95,19 +116,9 @@ http { client_body_buffer_size 16k; client_max_body_size 100M; } - location ^~ /todoWeb/ { - # 预检请求的处理 - if ($request_method = 'OPTIONS') { - return 204; - } - # rewrite ^/todo-server/(.*)$ /$1 break; - proxy_pass http://localhost:8092/; - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - client_body_buffer_size 16k; - client_max_body_size 100M; - } + + + location ^~ /security-server/ { # 预检请求的处理 if ($request_method = 'OPTIONS') { diff --git a/next.config.mjs b/next.config.mjs index 84a5181..a015e2b 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,5 +1,11 @@ /** @type {import('next').NextConfig} */ +const isProduction = process.env.NODE_ENV === 'production' const nextConfig = { + // 核心配置:构建前清空输出目录 + cleanDistDir: true, + basePath: isProduction ? "/todo" : '', + // 静态文件前缀 + assetPrefix: isProduction ? "/todo" : '', // Middleware cannot be used with "output: export". output: 'export', // Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html` @@ -7,15 +13,14 @@ const nextConfig = { // Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href` // skipTrailingSlashRedirect: true, - // Optional: Change the output directory `out` -> `dist` - distDir: 'docker/out', + distDir: 'docker/outd', // 严格模式下react-beautiful-dnd无法使用 reactStrictMode:false, eslint: { // Warning: This allows production builds to successfully complete even if // your project has ESLint errors. - // ignoreDuringBuilds: true, + ignoreDuringBuilds: true, }, }; diff --git a/src/app/page.tsx b/src/app/page.tsx index bc54a2f..8942f45 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -17,6 +17,8 @@ export default function Home() { }else { replace("/task/project") } + }else if (pathName =="/"){ + replace("/task/project") } }else { replace("/login") diff --git a/src/components/CalHeader.tsx b/src/components/CalHeader.tsx index d91c7b6..5e5b29b 100644 --- a/src/components/CalHeader.tsx +++ b/src/components/CalHeader.tsx @@ -1,6 +1,5 @@ -import React, {Fragment} from 'react'; +import React from 'react'; import {DateHeaderProps} from "react-big-calendar"; -import {solarToLunar} from "lunar-calendar"; import {lunarDateShow} from "@/utils/timeFormatUtil"; // 定义为 React 函数组件 diff --git a/src/lib/login/service.ts b/src/lib/login/service.ts index e594ec5..9f4a588 100644 --- a/src/lib/login/service.ts +++ b/src/lib/login/service.ts @@ -13,5 +13,5 @@ export const askLoginAPI = (data:{}):Promise>> =>{ - return httpReq.get(process.env.NEXT_PUBLIC_SECURITY_REQUEST_URL + "/V2/wx/login/refreshToken") + return httpReq.post(process.env.NEXT_PUBLIC_SECURITY_REQUEST_URL + "/V2/wx/login/refreshToken") } \ No newline at end of file diff --git a/src/lib/task/calendar/data.tsx b/src/lib/task/calendar/data.tsx index 8bdb949..00ba4ed 100644 --- a/src/lib/task/calendar/data.tsx +++ b/src/lib/task/calendar/data.tsx @@ -5,4 +5,5 @@ export interface TaskEvent extends Event { state?:any; taskType?:string; priority?:any; + description?:string; } diff --git a/src/ui/task/calendar/CalShow.tsx b/src/ui/task/calendar/CalShow.tsx index 7ee7ebb..0d091db 100644 --- a/src/ui/task/calendar/CalShow.tsx +++ b/src/ui/task/calendar/CalShow.tsx @@ -170,8 +170,8 @@ const CalShow: React.FC = () => { if (responseD.status.success) { let result: TaskEvent[] = responseD.data.content.map(taskState => { return { - start: taskState.expectedStartTime?dayjs(taskState.expectedStartTime).toDate():dayjs(taskState.expectedEndTime).startOf('day').toDate(), - end: taskState.expectedEndTime?dayjs(taskState.expectedEndTime).toDate():dayjs(taskState.expectedStartTime).endOf('day').toDate(), + start: taskState.expectedStartTime ? dayjs(taskState.expectedStartTime).toDate() : dayjs(taskState.expectedEndTime).startOf('day').toDate(), + end: taskState.expectedEndTime ? dayjs(taskState.expectedEndTime).toDate() : dayjs(taskState.expectedStartTime).endOf('day').toDate(), title:
@@ -193,7 +193,8 @@ const CalShow: React.FC = () => { id: taskState.id, state: taskState.state, priority: taskState.priority, - taskType: taskState.taskType + taskType: taskState.taskType, + description:taskState.description } }); console.log('responseD.data.content:', result) @@ -406,6 +407,21 @@ const CalShow: React.FC = () => { } setRange({...range}) } + + const toolTipShow = (event:TaskEvent) =>{ + console.log("toolTipShow", event) + let result="" + if (view!='month'){ + result += "\n" + } + result += "计划:"+event.name + if (event.description){ + result += "\n描述:"+event.description + } + return result; + } + + return
{open && { dateHeader: CalHeader } }} + tooltipAccessor={toolTipShow} />
} diff --git a/src/utils/timeFormatUtil.ts b/src/utils/timeFormatUtil.ts index 4a1c07f..80f469c 100644 --- a/src/utils/timeFormatUtil.ts +++ b/src/utils/timeFormatUtil.ts @@ -247,7 +247,7 @@ function lunarDateShow(date:Date){ if(lunarDate.term){ return lunarDate.term; } - if(lunarDate.lunarFestival){ + if(lunarDate.lunarFestival && lunarDate.lunarMonthName.indexOf("闰")==-1){ return lunarDate.lunarFestival; } if(lunarDate.solarFestival){