|
|
|
@ -1,23 +1,23 @@
|
|
|
|
|
import request from '@/utils/request';
|
|
|
|
|
// OSS签名
|
|
|
|
|
export function sign(serviceName, configId) {
|
|
|
|
|
// return request({
|
|
|
|
|
// url: '/oss/oss/generateOssSignature',
|
|
|
|
|
// method: 'POST',
|
|
|
|
|
// data: {
|
|
|
|
|
// serviceName,
|
|
|
|
|
// configId,
|
|
|
|
|
// },
|
|
|
|
|
// });
|
|
|
|
|
console.info(serviceName, configId);
|
|
|
|
|
return {
|
|
|
|
|
accessId: 'LTAI4GHRNb5Xn2w5NeHVbR4c',
|
|
|
|
|
policy: 'eyJleHBpcmF0aW9uIjoiMjAyMi0wNC0xNVQyMDowODoyNi4zMTlaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJ0ZXN0LyJdXX0=',
|
|
|
|
|
signature: 'okaB3sNp3vzyfM0S3ypudaUAZ+0=',
|
|
|
|
|
dir: 'test/',
|
|
|
|
|
host: 'https://msb-edu-dev.oss-cn-beijing.aliyuncs.com',
|
|
|
|
|
expire: '1650053306',
|
|
|
|
|
};
|
|
|
|
|
return request({
|
|
|
|
|
url: '/oss/oss/generateOssSignature',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data: {
|
|
|
|
|
serviceName,
|
|
|
|
|
configId,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
// console.info(serviceName, configId);
|
|
|
|
|
// return {
|
|
|
|
|
// accessId: 'LTAI4GHRNb5Xn2w5NeHVbR4c',
|
|
|
|
|
// policy: 'eyJleHBpcmF0aW9uIjoiMjAyMi0wNC0xNVQyMDowODoyNi4zMTlaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJ0ZXN0LyJdXX0=',
|
|
|
|
|
// signature: 'okaB3sNp3vzyfM0S3ypudaUAZ+0=',
|
|
|
|
|
// dir: 'test/',
|
|
|
|
|
// host: 'https://msb-edu-dev.oss-cn-beijing.aliyuncs.com',
|
|
|
|
|
// expire: '1650053306',
|
|
|
|
|
// };
|
|
|
|
|
}
|
|
|
|
|
// 上传文件
|
|
|
|
|
export async function upload(serviceName, configId, file) {
|
|
|
|
@ -34,5 +34,8 @@ export async function upload(serviceName, configId, file) {
|
|
|
|
|
url: oss.host,
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data,
|
|
|
|
|
headers: {
|
|
|
|
|
oss: true,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|