Эх сурвалжийг харах

未激活消息提示调整

zhangjie 2 жил өмнө
parent
commit
9c83e9db9b

+ 6 - 1
src/plugins/axiosApp.js

@@ -106,7 +106,12 @@ _axiosApp.interceptors.response.use(
 
     // 登录失效 跳转登录页面
     if (status == 403 || status == 401) {
-      notifyInvalidTokenThrottled();
+      const exposeMsgs = ["系统授权信息已过期,请联系系统管理员激活!"];
+      let message = error.response.data.message;
+      message = exposeMsgs.includes(message)
+        ? message
+        : "登录失效,请重新登录!";
+      notifyInvalidTokenThrottled(message);
       removeToken();
       return Promise.reject(error);
     } else if (status == 405) {

+ 9 - 7
src/plugins/axiosNotice.js

@@ -2,10 +2,12 @@ import Vue from "vue";
 import throttle from "lodash-es/throttle";
 
 // function printErr(val) {
-export const notifyInvalidTokenThrottled = throttle(() => {
-  Vue.prototype.$notify({
-    showClose: true,
-    message: "登录失效,请重新登录!",
-    type: "error",
-  });
-}, 1000);
+export const notifyInvalidTokenThrottled = (message) => {
+  return throttle(() => {
+    Vue.prototype.$notify({
+      showClose: true,
+      message,
+      type: "error",
+    });
+  }, 1000)();
+};