+22
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user