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