后端压力大,前端分忧。
/*用微信小程序token拿二维码*/ async fetchMINIQRcode({commit,state},params){ var instance = axios.create({ responseType: ‘blob‘, //返回数据的格式,可选值为arraybuffer,blob,document,json,text,stream,默认值为json }) let data = await instance.post(‘https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=‘ + params.access_token, params.params).then(res => res.data) return data; } //拿值 MINI if (MINI) { var blob = new Blob([MINI], { type: ‘application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8‘ }); t.QRcode = URL.createObjectURL(blob); t.QRcode_col = true; }