长城汽车软件包管理平台
whychdw
2025-04-27 37c0df01e23bf7a4c946bd6a798bf433965d1731
内容提交
4个文件已修改
11 ■■■■ 已修改文件
src/layout/components/NavBar/components/NavbarRight.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/user.store.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/downloadFile.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/compoents/downloadFile.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/NavBar/components/NavbarRight.vue
@@ -77,6 +77,10 @@
      })
      .then(() => {
        router.push(`/login?redirect=${route.fullPath}`);
      })
      .catch(() => {
        tagsViewStore.delAllViews();
        router.push(`/login?redirect=${route.fullPath}`);
      });
  });
}
src/store/modules/user.store.ts
@@ -58,6 +58,7 @@
          resolve();
        })
        .catch((error) => {
          clearSessionAndCache();
          reject(error);
        });
    });
src/utils/downloadFile.ts
@@ -1,4 +1,4 @@
function downloadFile(url: string) {
function downloadFile(url: string, fileName: string) {
  return new Promise<void>((resolve, reject) => {
    let baseUrl = "";
    if (process.env.NODE_ENV === "development") {
@@ -12,7 +12,7 @@
    // 1. 预检文件是否存在
    fetch(link.href, { method: "HEAD" })
      .then(() => {
        link.download = "文件";
        link.download = fileName;
        document.body.appendChild(link); // 添加到 DOM
        link.click();
        window.URL.revokeObjectURL(url);
src/views/dashboard/compoents/downloadFile.vue
@@ -60,7 +60,7 @@
  if (!formEl) return;
  formEl.validate((valid, fields) => {
    if (valid) {
      downloadFile(props.data.fileUrl)
      downloadFile(props.data.fileUrl, props.data.fileName)
        .then(() => {
          ElMessage({
            message: "下载成功!!!",