From a556fe8ae4c1c01b4c2ed2748f6a0fbaaf279adb Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Fri, 27 Feb 2026 14:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EgetFileUrlFromServer=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.d.ts | 4 ++++ src/utils/index.js | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/utils/index.d.ts b/src/utils/index.d.ts index f8a1e40..fc26660 100644 --- a/src/utils/index.d.ts +++ b/src/utils/index.d.ts @@ -272,6 +272,10 @@ export function getIndexColumn(pagination: false | BasePaginationConfig): { * 获取文件url */ export function getFileUrl(): string; +/** + * 从服务器获取文件url + */ +export function getFileUrlFromServer(): Promise; /** * base64转File对象 diff --git a/src/utils/index.js b/src/utils/index.js index 62155a5..0967f5f 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,3 +1,4 @@ +import { request } from "@cqsjjb/jjb-common-lib/http.js"; import dayjs from "dayjs"; import { ID_NUMBER } from "../regular"; @@ -555,5 +556,15 @@ export function normalizeEmptyHtml(html) { * 获取文件url */ export function getFileUrl() { - return process.env.app["fileUrl"]; + return window.fileUrl || process.env.app["fileUrl"]; +} + +/** + * 从服务器获取文件url + */ +export async function getFileUrlFromServer() { + if (window.fileUrl) + return; + const { data } = await request("/basicInfo/imgFiles/getImagePath", "get"); + window.fileUrl = data; }