From fa29905c7cb6916570782bb0a838b87e057cf0b3 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Tue, 6 Jan 2026 19:36:37 -0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BF=AE=E5=A4=8D=E5=9F=BA=E7=A1=80?= =?UTF-8?q?URL=E9=85=8D=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将VITE_APP_BASE_URL默认值设置为'/',避免环境变量未定义时请求失败 --- .gitea/workflows/docker.yml | 4 ++-- src/utils/request/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml index a254841..a6d8fcb 100644 --- a/.gitea/workflows/docker.yml +++ b/.gitea/workflows/docker.yml @@ -12,7 +12,7 @@ on: env: - VITE_APP_BASE_URL: https://h.hifastapp.com + VITE_APP_BASE_URL: / SSH_HOST: ${{ vars.PRO_SSH_HOST }} SSH_PORT: ${{ vars.PRO_SSH_PORT }} SSH_USER: ${{ vars.PRO_SSH_USER }} @@ -42,7 +42,7 @@ jobs: - name: Build dist with Unified Script env: - VITE_APP_BASE_URL: "https://h.hifastapp.com" + VITE_APP_BASE_URL: "/" run: | chmod +x scripts/ci-build.sh ./scripts/ci-build.sh diff --git a/src/utils/request/index.ts b/src/utils/request/index.ts index eafe3c5..ca5666d 100644 --- a/src/utils/request/index.ts +++ b/src/utils/request/index.ts @@ -1,6 +1,6 @@ import Request from './core' export * from './core' -const baseUrl = import.meta.env.VITE_APP_BASE_URL +const baseUrl = import.meta.env.VITE_APP_BASE_URL || '/' const request = new Request({ baseURL: baseUrl,