diff --git a/src/api/file.js b/src/api/file.js index bfa0b01..702e25b 100644 --- a/src/api/file.js +++ b/src/api/file.js @@ -2,11 +2,12 @@ * @Author: ch * @Date: 2022-07-07 17:27:04 * @LastEditors: ch - * @LastEditTime: 2022-07-11 17:24:09 + * @LastEditTime: 2022-07-11 17:34:08 * @Description: file content */ import { ElMessage } from '@/plugins/element-plus'; import request from '@/utils/request'; +import { CreateUUID } from '@/utils/utils'; // OSS签名 export function sign(serviceName, configId) { return request({ @@ -40,7 +41,7 @@ export async function upload(serviceName, configId, file, cancelToken, suffix) { oss = await payCenterSign(); } const data = new FormData(); - const name = file.uid + _suffix; + const name = CreateUUID() + _suffix; data.append('name', name); data.append('key', `${oss.dir}${name}`); data.append('policy', oss.policy);