引入axios
import axios from 'axios'
调接口
axios.get("http://10.200.1.244:8080/getPic", { responseType: "blob" })
.then(res => {
console.log(window.URL.createObjectURL(res.data));
this.imgUrl = window.URL.createObjectURL(res.data)
});
// config = { responseType: 'blob' }
//请求类型为二进制流
// src图片为imgUrl 使用window.URL.createObjectURL转换为图片