新增getFileUrlFromServer方法

master
LiuJiaNan 2026-02-27 14:49:19 +08:00
parent a071b9ff40
commit a556fe8ae4
2 changed files with 16 additions and 1 deletions

View File

@ -272,6 +272,10 @@ export function getIndexColumn(pagination: false | BasePaginationConfig): {
* url
*/
export function getFileUrl(): string;
/**
* url
*/
export function getFileUrlFromServer(): Promise<void>;
/**
* base64File

View File

@ -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;
}