|
@@ -68,6 +68,7 @@ export const postFile = (url: string, data: Record<string, any>) => {
|
|
|
}
|
|
|
|
|
|
const l = `${resourceURLS[SCENE_TYPE.fuse]}${url}`;
|
|
|
+ console.log(l)
|
|
|
return after(
|
|
|
fetch(l, {
|
|
|
headers: window.platform.getHeaders(),
|
|
@@ -136,14 +137,13 @@ const after = async (fet: Promise<Response>) => {
|
|
|
throw `${res.message},即将退出`;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if ([4008, 4010, 7012].includes(res.code)) {
|
|
|
setTimeout(() => {
|
|
|
window.platform.login(res.code !== 7012);
|
|
|
}, 1000);
|
|
|
throw res.message;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (res.code !== 0) {
|
|
|
bus.emit("requestError", res);
|
|
|
}
|
|
@@ -317,17 +317,19 @@ export const saveTabulationData = genLoading(
|
|
|
}
|
|
|
);
|
|
|
|
|
|
-export const uploadResourse = genLoading(async (file: File) => {
|
|
|
- const url = await postFile(`fusion/upload/file`, { file });
|
|
|
+export const uploadResourse = genLoading(
|
|
|
+ async (file: File) => await postFile(`fusion/upload/file`, { file })
|
|
|
+);
|
|
|
+
|
|
|
+export const getResource = (url: string) => {
|
|
|
if (url.includes("//")) {
|
|
|
return url;
|
|
|
- }
|
|
|
- if (import.meta.env.DEV && import.meta.env.VITE_STATIC) {
|
|
|
+ } else if (import.meta.env.DEV && import.meta.env.VITE_STATIC) {
|
|
|
return `${import.meta.env.VITE_STATIC}${url}`;
|
|
|
} else {
|
|
|
return url;
|
|
|
}
|
|
|
-});
|
|
|
+};
|
|
|
|
|
|
export const getTableTemp = () => {
|
|
|
let table: Record<string, string>;
|