|
@@ -3,6 +3,7 @@ import {
|
|
|
userLogin,
|
|
|
uploadFile as uploadFileUrl,
|
|
|
setLoginHook,
|
|
|
+ newupload,
|
|
|
userInfo,
|
|
|
} from "@/request";
|
|
|
import { encodePwd } from "@/util";
|
|
@@ -10,6 +11,7 @@ import { user } from "./user";
|
|
|
import { refreshRole } from "./role";
|
|
|
import { changSaveLocal } from "@/util/localUtil";
|
|
|
import { appConstant } from "@/app";
|
|
|
+import { router } from "@/router";
|
|
|
import { ref, watchEffect } from "vue";
|
|
|
function randomWord(randomFlag, min, max?) {
|
|
|
let str = '';
|
|
@@ -150,7 +152,9 @@ if (user.value.token) {
|
|
|
}
|
|
|
|
|
|
export const uploadFile = async (file: File) => {
|
|
|
- return (await axios.post<string>(uploadFileUrl, { file })).data;
|
|
|
+ const route = router.currentRoute.value;
|
|
|
+ const url = route.name !== 'drawShareFile'?uploadFileUrl:newupload
|
|
|
+ return (await axios.post<string>(url, { file })).data;
|
|
|
};
|
|
|
|
|
|
|