(url: string, params?: T): Promise {
return httpRequest
({ method: "delete", url, params })
}
-export { httpRequest, httpGet, httpPost, httpPut, httpDelete, axiosRequest }
+/** 单独抽离的 文件下载 工具函数 */
+async function downloadFile(url: string, fileName?: string): Promise {
+ const { data, headers } = await axios.get(url, { responseType: "blob" })
+ if (!fileName) {
+ const fn1 = headers["content-disposition"]
+ if (fn1) {
+ fileName = fn1.replace(/\w+;filename=(.*)/, "$1")
+ } else {
+ fileName = uuidv4().replace(/-/g, "")
+ }
+ }
+ const urlObject = window.URL || window.webkitURL
+ const downloadUrl = urlObject.createObjectURL(data)
+ const link = document.createElement("a")
+ link.href = downloadUrl
+ link.download = fileName!
+ document.body.appendChild(link)
+ link.click()
+ document.body.removeChild(link)
+ urlObject.revokeObjectURL(downloadUrl)
+}
+
+/** 单独抽离的 文件下载 工具函数 */
+function getFileBlob(url: string): Promise {
+ // 单独处理自定义请求/响应回掉
+ return new Promise((resolve, reject) => {
+ axios
+ .get(url, { responseType: "blob" })
+ .then((resp) => {
+ const { data, headers } = resp
+ const blob = new Blob([data], { type: headers["content-type"] })
+ resolve(blob)
+ })
+ .catch((error) => reject(error))
+ })
+}
+
+export { httpRequest, httpGet, httpPost, httpPut, httpDelete, axiosRequest, downloadFile, getFileBlob }
diff --git a/platform-web-ui/src/views/sys/tenant/index.vue b/platform-web-ui/src/views/sys/tenant/index.vue
index 16350b4..c2be24d 100644
--- a/platform-web-ui/src/views/sys/tenant/index.vue
+++ b/platform-web-ui/src/views/sys/tenant/index.vue
@@ -91,7 +91,11 @@
-
+ 跳转客户系统
+
+ 生成二维码
+
+
重置数据
@@ -118,6 +122,24 @@
+
+
+
+
+ {{ qrCodeDialog.link }}
+
+
+
+
+
+
+
@@ -251,7 +273,7 @@