mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
增加方法postPdf
This commit is contained in:
@@ -141,13 +141,25 @@ const postJson=function(baseURL,url,postData){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const postPdf=function(baseURL,url,postData){
|
||||||
|
return request({
|
||||||
|
baseURL,
|
||||||
|
url: url,
|
||||||
|
responseType: 'blob',
|
||||||
|
method: 'post',
|
||||||
|
data:postData,
|
||||||
|
headers:{'Content-Type':'application/pdf'},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 导出文件请求定义
|
// 导出文件请求定义
|
||||||
const postJsonToFile=function(baseURL,url,postData){
|
const postJsonToFile=function(baseURL,url,postData){
|
||||||
return request({
|
return request({
|
||||||
baseURL,
|
baseURL,
|
||||||
url: url,
|
url: url,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data:postData,
|
data:postData,
|
||||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
@@ -191,4 +203,5 @@ export default {
|
|||||||
postJsonToFile,
|
postJsonToFile,
|
||||||
put,
|
put,
|
||||||
putJson,
|
putJson,
|
||||||
|
postPdf,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user