第一种:location.href 进行文件下载,在当前窗口进行文件下载
download(id){ var urls = "api/file/dataexport/?id="+val.id; window.location.href = urls; },
第二种:window.open进行文件下载,默认会跳转到新窗口进行文件下载
download(id){ var urls = "api/file/dataexport/?id="+id; window.open(urls); },
第三种:带参数打开新窗口
$window.open("api/file/dataexport/?id="+id );
第四种:获取参数
var afterUrl = window.location.search.substring(1);(问号以后的字符串)
var afterEqual = afterUrl.substring(afterUrl.indexof('=')+1).toUpperCase();(等号以后的字符串,及你所要的参数)
---------------------
错误方式:
this.$http.post/get('api/file/dataexport/',data)