You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

30 lines
719 B

/**
* 阿里云oss配置
* */
import Util from '@/libs/util'
import store from '@/store'
export default async function () {
try {
let RE = localStorage.getItem('osc')
if (RE) {
RE = JSON.parse(RE)
} else {
Util.errorMsg('登录过期,请重新登录!')
setTimeout(() => {
store.dispatch('user/logout')
}, 1500)
}
return RE ? {
// oss账号信息
config: {
region: 'oss-cn-shenzhen',
accessKeyId: RE[0],
accessKeySecret: RE[1],
bucket: 'huoran'
},
// 上传成功url前置部分(成功回调没有返回url)
preUrl: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/'
} : {}
} catch (e) { }
}