对比代码
fetchAccessToken(){
return this.readAccessToken()
.then(async res =>{
const res=await this.getAccessToken()
resolve(res)
})
}
fetchAccessToken(){
return this.readAccessToken()
.then(async res =>{
this.getAccessToken()
.then(res=>{
resolve(res)
})
})
}
图片上传时赋初始值时只能是这种格式
async upload(file) {
console.log(file)
let reponse = await self.$axios.get(urllist.qrUpload.getSignature, {}); //索要签名
console.log(reponse)
const acc = JSON.parse(reponse.data.data);
this.addressOss = acc.host; //上传地址
var key = uuidv1();
this.dataOss = {
key: acc.dir + key,
policy: acc.policy,
OSSAccessKeyId: acc.accessid,
success_action_status: "200",
Signature: acc.signature
}; //上传额外参数
this.local_files.push({ filename: file.name, name: this.dataOss.key });
},