新增getFileUrlFromServer方法
parent
a071b9ff40
commit
a556fe8ae4
|
|
@ -272,6 +272,10 @@ export function getIndexColumn(pagination: false | BasePaginationConfig): {
|
||||||
* 获取文件url
|
* 获取文件url
|
||||||
*/
|
*/
|
||||||
export function getFileUrl(): string;
|
export function getFileUrl(): string;
|
||||||
|
/**
|
||||||
|
* 从服务器获取文件url
|
||||||
|
*/
|
||||||
|
export function getFileUrlFromServer(): Promise<void>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* base64转File对象
|
* base64转File对象
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { request } from "@cqsjjb/jjb-common-lib/http.js";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { ID_NUMBER } from "../regular";
|
import { ID_NUMBER } from "../regular";
|
||||||
|
|
||||||
|
|
@ -555,5 +556,15 @@ export function normalizeEmptyHtml(html) {
|
||||||
* 获取文件url
|
* 获取文件url
|
||||||
*/
|
*/
|
||||||
export function getFileUrl() {
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue