Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
html
/
jinmao-community-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
158bf17d
authored
May 27, 2021
by
袁晓帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改IE下不能下载和不能的导出问题2
parent
c090f1e3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
src/components/page/IOC/sellCarport.vue
+8
-0
No files found.
src/components/page/IOC/sellCarport.vue
View file @
158bf17d
...
...
@@ -203,6 +203,14 @@ export default {
}
}).
then
(
res
=>
{
let
blob
=
new
Blob
([
res
.
data
],
{
type
:
"application/vnd.ms-excel"
});
// res就是接口返回的文件流了
if
(
window
.
navigator
.
msSaveBlob
)
{
//IE以及IE内核的浏览器
try
{
window
.
navigator
.
msSaveBlob
(
blob
);
//response为接口返回数据,这里请求的时候已经处理了,如果没处理需要在此之前自行处理var data = new Blob([response.data]) 注意这里需要是数组形式的,fileNm就是下载之后的文件名
// window.navigator.msSaveOrOpenBlob(response, fileNm); //此方法类似上面的方法,区别可自行百度
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
let
objectUrl
=
URL
.
createObjectURL
(
blob
);
window
.
location
.
href
=
objectUrl
;
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment