当前位置:网站首页>【js通过url下载文件】
【js通过url下载文件】
2022-07-02 00:30:00 【six-double-seven】
js通过url下载文件
- 下载文件的代码如下
exportTable(){
api.exportOrder(this.query)
.then(res => {
setTimeout(() => {
if (res && res.code === 1) {
const a = document.createElement('a');
a.href = res.exportUrl;
a.download = '文件名称';
document.body.appendChild(a);
a.click();
URL.revokeObjectURL(res.exportUrl);
a.remove();
this.$Message.success("下载完成");
}else {
this.$Message.error(res.msg);
}
}, 1000);
})
.catch(err => {
this.$Message.error('导出失败:' + err);
});
},
边栏推荐
- Window sorting functions rank and deny for SQL data analysis_ rank、raw_ Number and lag, lead window offset function [usage sorting]
- Linux centos7 installation Oracle11g super perfect novice tutorial
- Jielizhi, production line assembly link [chapter]
- 449 original code, complement code, inverse code
- USB-IF协会与各种接口的由来
- Take the enclave Park as a sample to see how Yuhua and Shaoshan play the song of Chang Zhu Tan integrated development
- [embedded system course design] a single key controls the LED light
- Shell process control
- The new version of graphic network PDF will be released soon
- I want to ask, which is the better choice for securities companies? I don't understand. Is it safe to open an account online now?
猜你喜欢

Leetcode skimming: binary tree 03 (post order traversal of binary tree)

Bc35 & bc95 onenet mqtt (old)

Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results

回顾数据脱敏系统

Leetcode 96 différents arbres de recherche binaires

export default 导出的对象,不能解构问题,和module.exports的区别

PWN attack and defense world cgpwn2

Barbie q! How to analyze the new game app?

使用多线程Callable查询oracle数据库

Ldr6035 smart Bluetooth audio can continuously charge and discharge mobile devices
随机推荐
Practical calculation of the whole process of operational amplifier hysteresis comparator
[template] adaptive Simpson integral
PHP reads ini or env type configuration
Relevant settings of wechat applet cache expiration time (recommended)
Leetcode skimming: stack and queue 03 (valid parentheses)
Kyushu cloud and Intel jointly released the smart campus private cloud framework, enabling new infrastructure for education
Vue force cleaning browser cache
leetcode96不同的二叉搜索樹
From 20s to 500ms, I used these three methods
Soft exam information system project manager_ Compiled abbreviations of the top ten management processes to help memory recitation - -- software test advanced information system project manager 054
Leetcode question brushing: stack and queue 07 (maximum value of sliding window)
SQL Server 安裝指南
SQL数据分析之流程控制语句【if,case...when详解】
Leetcode skimming: binary tree 03 (post order traversal of binary tree)
USB-IF协会与各种接口的由来
九州云与英特尔联合发布智慧校园私有云框架,赋能教育新基建
Mysql database driver (JDBC Driver) jar package download
It's nothing to be utilitarian!
在证券账户上买基金安全吗?哪里可以买基金
使用多线程Callable查询oracle数据库