axios的引用(vscode环境)
1、安装 cnpm install axios -S2、引用 main.jsimportaxiosfrom'axios';Vue.prototype.$axios=axios3/使用me.$axios.get(me.baseURL+"verify/imgs"//,{//responseType:"arraybuffer"//仅在返回二进制流byte使用//})...
1、安装 cnpm install axios -S
2、引用 main.js
import axios from 'axios';
Vue.prototype.$axios = axios
3/使用
me.$axios
.get(me.baseURL + "verify/imgs"
//, {
// responseType: "arraybuffer"//仅在返回二进制流byte使用
//}
)
.then(response => {
return (
"data:image/png;base64," +
btoa(
new Uint8Array(response.data).reduce(
(data, byte) => data + String.fromCharCode(byte),
""
)
)
);
})
.then(response => {
me.verimgPath=response;
});
更多推荐
所有评论(0)