zhangzengfei
2021-11-29 d1c9bf22b12323d6ee1ba1ed6e7f6acc7e5b9e1f
修复token过期无法退出的bug
2个文件已修改
14 ■■■■■ 已修改文件
src/utils/request.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.js
@@ -27,6 +27,7 @@
  console.log(code, msg);
  switch (code) {
    case invalidCode:
      console.log(code);
      Vue.prototype.$baseMessage(msg || `后端接口${code}异常`, "error");
      store.dispatch("user/resetAccessToken").catch(() => {});
      if (loginInterception) {
@@ -34,9 +35,13 @@
      }
      break;
    case noPermissionCode:
      console.log(code);
      store.dispatch("user/logout").then(() => {
      router.push({ path: "/login" }).catch(() => {});
      });
      break;
    default:
      console.log(code);
      Vue.prototype.$baseMessage(msg || `后端接口${code}异常`, "error");
      break;
  }
src/views/project/index.vue
@@ -74,7 +74,6 @@
      stripe
      :data="list"
      :element-loading-text="elementLoadingText"
      :height="height"
      @selection-change="setSelectRows"
      @expand-change="expandChange"
    >
@@ -84,6 +83,9 @@
            :data="props.row.pkgList"
            :show-header="false"
            style="width: 100%"
            row-class-name="expand-row"
            :highlight-current-row="false"
          >
          >
            <el-table-column prop="fileName"></el-table-column>
            <el-table-column prop="version" width="150"></el-table-column>
@@ -370,3 +372,8 @@
  },
};
</script>
<style>
.el-table .expand-row {
  background-color: oldlace;
}
</style>