imgSubmit(id) {
axios({
method: 'get',
url: `${process.env.VUE_APP_BASE_API}/ranking/GetRankEveryImage`,
responseType: 'arraybuffer',
headers: { 'Authorization': 'Bearer ' + getToken() },
params: {
id: id
}
}).then(res => {
var src = 'data:image/jpg;base64,' + btoa(new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), ''))
this.srcImg = src // 图片回显
var link = document.createElement('a')
link.href = src
link.download = '排行榜.jpg'
link.click()
})
},
网友评论