临时凭证获取

uat_us
DESKTOP-6C3NK6N\WXS 2024-09-13 10:23:24 +08:00
parent fa395f54b2
commit 0f29a2971c
1 changed files with 8 additions and 1 deletions

View File

@ -15,7 +15,14 @@ Vue.prototype.OSSclientConfig = {
async function ossGenerateSTS() { async function ossGenerateSTS() {
let res = await GetObjectStoreToken() let res = null;
if (localStorage.getItem('stsToken')) {
res = JSON.parse(localStorage.getItem('stsToken'))
} else {
res = await GetObjectStoreToken()
localStorage.setItem('stsToken', JSON.stringify(res))
}
// res.Result.ObjectStoreUse = 'AWS'; // res.Result.ObjectStoreUse = 'AWS';
Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] } Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] }
Vue.prototype.OSSclientConfig.ObjectStoreUse = res.Result.ObjectStoreUse; Vue.prototype.OSSclientConfig.ObjectStoreUse = res.Result.ObjectStoreUse;