1. 去掉img的自带边框,当src为空的时候不显示图片的默认边框:
img[src=''] {
opacity: 0;
}
2. 文件下载:
export async function downLoadFile1(paramList, url) {
let downloadParams = {
data: JSON.stringify(paramList),
}
await axios({
method: 'post',
url: config.rootPath + url,
data: qs.stringify(downloadParams),
headers: {
'Content-Type': 'application/x-www-form-urlencoded', //将表单数据传递转化为form-data类型
// 'Content-Type': 'application/json',
},
withCredentials: true,
responseType: 'blob',
// headers:{ 'Content-Type': 'application/json; application/octet-stream'},
})
.then((response) => {
console.log(response)
const { headers, data } = response
// let fileName = headers['content-type'