getVerificationCode() {
// 渲染文件流
axios.request({
url: '/api/v1/pub_captcha/',
responseType: 'blob',
method: 'get'
}).then(res => {
let blob = new Blob([res.data], {
type: "image/png"
});
let url = window.URL.createObjectURL(blob);
// 将图片转换成img标签可以识别的url
this.imgData = url;
}), (error) => {
this.$message({
type: 'warning',
message: '系统错误,请联系管理员!'
});
}
}
vue 获取文件流渲染 (如验证码)
最新推荐文章于 2025-05-22 17:21:15 发布