Skip to content

Commit 86d16d0

Browse files
committed
通用下载方法新增config配置选项(I5PNXE)
1 parent 854b405 commit 86d16d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ruoyi-ui/src/utils/request.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,13 @@ service.interceptors.response.use(res => {
130130
)
131131

132132
// 通用下载方法
133-
export function download(url, params, filename) {
133+
export function download(url, params, filename, config) {
134134
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
135135
return service.post(url, params, {
136136
transformRequest: [(params) => { return tansParams(params) }],
137137
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
138-
responseType: 'blob'
138+
responseType: 'blob',
139+
...config
139140
}).then(async (data) => {
140141
const isLogin = await blobValidate(data);
141142
if (isLogin) {

0 commit comments

Comments
 (0)