上传添加时间戳
continuous-integration/drone/push Build is passing

This commit is contained in:
熊飞
2024-01-18 11:17:54 +08:00
parent 033a34cf1e
commit 8081b33a97
2 changed files with 211 additions and 178 deletions
+22 -1
View File
@@ -24,7 +24,28 @@ async function ossGenerateSTS() {
switch (res.Result.ObjectStoreUse) {
case 'AliyunOSS':
Vue.prototype.OSSclientConfig.bucket = Vue.prototype.OSSclientConfig.bucketName
Vue.prototype.OSSclient = new OSS(Vue.prototype.OSSclientConfig)
let OSSclient = new OSS(Vue.prototype.OSSclientConfig)
Vue.prototype.OSSclient = {
put: function (objectName, object) {
return new Promise(async (resolve, reject) => {
try {
objectName = objectName + '_' + new Date().getTime()
let res = await OSSclient.put(objectName, object)
if (res && res.url) {
resolve({
name: objectName,
url: Vue.prototype.OSSclientConfig.viewEndpoint + objectName
})
} else {
reject()
}
} catch (e) {
console.log(e)
reject()
}
})
}
}
break
case 'MinIO':
let minioClient = new Minio.Client(Vue.prototype.OSSclientConfig);