Commit d4bb723a authored by 黄奎's avatar 黄奎

导出修改

parent d301286e
......@@ -104,22 +104,7 @@ export function getFileExt(filename) {
*/
export function EduDownLoad(cmd, msg, fileName) {
return request({
url: cmd,
method: 'post',
data: msg,
headers:{
responseType: 'arraybuffer'
}
}).then(res => {
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel;charset=utf-8"
})
let url = URL.createObjectURL(blob);
let link = document.createElement('a');
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
})
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -476,45 +476,3 @@ export function getLocalStorage(){
return null;
}
}
export function apipost(cmd, msg, successCall, faildCall, isOnline){
var timestamp = (new Date()).valueOf();
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var token = "";
var key = "";
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
}
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"msg": msg,
"cmd": cmd,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"languageId": tempLanguage
}
// return reuest({
// method:'post',
// })
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
} else if (res.resultCode == 10005) {
} else {
successCall(res);
}
}, faildCall)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment