fix:修复打包报错: top level await 的问题

This commit is contained in:
YunaiV
2025-04-22 18:49:31 +08:00
parent 5eee27218c
commit e9f2b5701c
8 changed files with 67 additions and 22 deletions

View File

@@ -4,7 +4,7 @@ import type { AxiosProgressEvent, InfraFileApi } from '#/api/infra/file';
import { computed, unref } from 'vue';
import { $t } from '@vben/locales';
import CryptoJS from 'crypto-js'
import axios from 'axios'
import { baseRequestClient } from '#/api/request';
import { uploadFile, getFilePresignedUrl, createFile } from '#/api/infra/file';
export function useUploadType({
@@ -78,7 +78,7 @@ export const useUpload = () => {
// 1.2 获取文件预签名地址
const presignedInfo = await getFilePresignedUrl(fileName)
// 1.3 上传文件
return axios
return baseRequestClient
.put(presignedInfo.uploadUrl, file, {
headers: {
'Content-Type': file.type