| | |
| | | import axios from "axios";
|
| | | import axios from "axios";
|
| | | import { ElLoading, ElMessage } from "element-plus";
|
| | | import { saveAs } from "file-saver";
|
| | | import { getToken } from "@/utils/auth";
|
| | |
| | | saveAs(text, name, opts) {
|
| | | saveAs(text, name, opts);
|
| | | },
|
| | | byUrl(url, filename) {
|
| | | // 将URL中的preview替换成download
|
| | | const downloadUrl = url.replace(/preview/g, 'download')
|
| | | const link = document.createElement('a')
|
| | | link.href = downloadUrl
|
| | | link.download = filename || ''
|
| | | document.body.appendChild(link)
|
| | | link.click()
|
| | | document.body.removeChild(link)
|
| | | },
|
| | | async printErrMsg(data) {
|
| | | const resText = await data.text();
|
| | | const rspObj = JSON.parse(resText);
|