我想通过AXIOS使用FPDF生成PDF。我正在使用Axios将Framework从EXTjs替换为Vue。它曾经可以在extjs-ajax中使用,但是在使用Axios时可以使用。
它不再产生PDF输出。我认为有些东西阻止了输出。
我尝试了blob,但它还会生成不可接受的空PDF。 https://gist.github.com/javilobo8/097c30a233786be52070986d8cdb1743
JS文件
var bodyFormData = new FormData();
bodyFormData.set('loan_no', loanDetailno);
bodyFormData.set('auth', _AUTH_KEY);
axios.post('/report_amortizationschedule',
bodyFormData, {
headers: {
'Content-Type': 'multipart/form-data'}
},)
.then((response) => {
console.log(response.data)
})
响应头
HTTP/1.1 200 OK
Date: Wed, 26 Jun 2019 09:24:30 GMT
Server: Apache/2.4.23 (Win64) PHP/5.5.38
X-Powered-By: PHP/5.5.38
Content-Length: 2230
Content-Disposition: attachment; filename="Amortization_Schedule_20190626.pdf"
Cache-Control: private, max-age=0, must-revalidate
Pragma: public
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/x-download
请求标头
Host: frontend
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://frontend/home?method=post&auth=7bff8f2a4c972ac09478b1b8f41f7656355bb5dd
Content-Type: multipart/form-data; boundary=---------------------------61883022732719
Content-Length: 283
Connection: keep-alive
我想在Axios上使用fpdf。