| | |
| | | if (state) { |
| | | url1 = Vue.prototype.javaApi + '/img/' + text; |
| | | } else { |
| | | url1 = Vue.prototype.javaApi + '/word/' + text |
| | | if (text.startsWith("/word/")) { |
| | | url1 = Vue.prototype.javaApi + text |
| | | } else if (text.startsWith("word/")) { |
| | | url1 = Vue.prototype.javaApi + '/' + text |
| | | } else { |
| | | url1 = Vue.prototype.javaApi + '/word/' + text |
| | | } |
| | | } |
| | | // 使用 fetch 获取文件 |
| | | const response = await fetch(url1); |
| | |
| | | // 将文件转换为 Blob |
| | | const blob = await response.blob(); |
| | | // 使用 saveAs 保存文件 |
| | | saveAs(blob, filename); |
| | | saveAs(blob, name); |
| | | Message.success("数据导出成功"); |
| | | } catch (error) { |
| | | Message.error(error); |