From 665dd09e11b40a39337914a3d83fa7d283150c1c Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 21 Jun 2026 10:39:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Pages=20=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E5=8C=85=E4=B8=8A=E4=BC=A0=E6=8A=A5=E3=80=8C=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E8=B6=85=E6=97=B6=EF=BC=8C=E8=AF=B7=E7=A8=8D=E5=90=8E?= =?UTF-8?q?=E9=87=8D=E8=AF=95=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog/index.md | 2 ++ .../(main)/pages/components/deployment-upload-dialog.tsx | 6 +++--- frontend/lib/services/core/config.ts | 5 +++++ frontend/lib/services/openflare/pages.service.ts | 2 ++ frontend/lib/services/upload/upload.service.ts | 2 ++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/changelog/index.md b/docs/changelog/index.md index c4ca6347..56a9689b 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -22,6 +22,8 @@ sidebar: false ### 修复 +- 修复 Pages 部署包上传报「请求超时,请稍后重试」:上传请求使用独立 10 分钟超时(覆盖默认 15 秒),并在大文件上传完成后提示服务端处理中。 + - 修复应用日志异常膨胀:Agent 配置同步加锁避免并发重复上报,成功且版本/checksum 未变时跳过重复 apply 日志;Server 入库前对相同成功记录去重;Flared 配置未变更时不再上报 apply 日志。 - 修复应用日志页「清空」无效果:原按钮仅重置筛选;新增「清空日志」入口并对接 `/api/v1/d/apply-logs/cleanup`,支持确认后删除全部记录。 diff --git a/frontend/app/(main)/pages/components/deployment-upload-dialog.tsx b/frontend/app/(main)/pages/components/deployment-upload-dialog.tsx index 29846e1b..de30025a 100644 --- a/frontend/app/(main)/pages/components/deployment-upload-dialog.tsx +++ b/frontend/app/(main)/pages/components/deployment-upload-dialog.tsx @@ -141,10 +141,10 @@ export function DeploymentUploadDialog({ {uploadProgress !== null ? (
- 上传进度 - {uploadProgress}% + {uploadProgress >= 100 ? "服务端处理中" : "上传进度"} + {uploadProgress >= 100 ? "请稍候" : `${uploadProgress}%`}
- + = 100 ? 100 : uploadProgress} />
) : null} diff --git a/frontend/lib/services/core/config.ts b/frontend/lib/services/core/config.ts index bbaba6b7..ce3a2a5a 100644 --- a/frontend/lib/services/core/config.ts +++ b/frontend/lib/services/core/config.ts @@ -21,6 +21,11 @@ export const apiConfig = { baseURL: getApiBaseUrl(), /** 超时时间(毫秒) */ timeout: 15000, + /** + * 文件上传超时(毫秒)。 + * Pages 部署包上限 100 MiB,需覆盖上传 + 服务端解压校验与入库时间。 + */ + uploadTimeout: 10 * 60 * 1000, /** 携带凭证 */ withCredentials: true, } as const; diff --git a/frontend/lib/services/openflare/pages.service.ts b/frontend/lib/services/openflare/pages.service.ts index 5ff6858a..8bf823be 100644 --- a/frontend/lib/services/openflare/pages.service.ts +++ b/frontend/lib/services/openflare/pages.service.ts @@ -1,6 +1,7 @@ import type {AxiosProgressEvent, InternalAxiosRequestConfig} from 'axios'; import apiClient from '@/lib/services/core/api-client'; +import {apiConfig} from '@/lib/services/core/config'; import type {ApiResponse} from '@/lib/services/core'; import {OpenFlareBaseService} from './base.service'; @@ -94,6 +95,7 @@ export class PagesService extends OpenFlareBaseService { this.getFullPath(path), formData, { + timeout: apiConfig.uploadTimeout, headers: { 'Content-Type': 'multipart/form-data' }, onUploadProgress: (event: AxiosProgressEvent) => { if (!onProgress || !event.total) return; diff --git a/frontend/lib/services/upload/upload.service.ts b/frontend/lib/services/upload/upload.service.ts index f7381637..fdd37c9c 100644 --- a/frontend/lib/services/upload/upload.service.ts +++ b/frontend/lib/services/upload/upload.service.ts @@ -1,5 +1,6 @@ import type {InternalAxiosRequestConfig} from 'axios'; +import {apiConfig} from '../core/config'; import {BaseService} from '../core/base.service'; import type {ListUploadsResponse, Upload, UploadImageResponse} from './types'; @@ -23,6 +24,7 @@ export class UploadService extends BaseService { } return this.post('', formData, { + timeout: apiConfig.uploadTimeout, headers: { 'Content-Type': 'multipart/form-data' }, } as InternalAxiosRequestConfig); }