|
@@ -4,6 +4,9 @@ import { MessageBox, Notification } from "element-ui";
|
|
|
import router from "../router";
|
|
|
import Vue from "vue";
|
|
|
|
|
|
+// 防止鉴权失效之后多次弹窗。
|
|
|
+let unauthMsgBoxIsShow = false;
|
|
|
+
|
|
|
const mdData = datas => {
|
|
|
return {
|
|
|
...datas,
|
|
@@ -44,12 +47,16 @@ const errorDataCallback = error => {
|
|
|
message = message.indexOf("###") !== -1 ? "参数错误" : message;
|
|
|
|
|
|
if (error.code === "106") {
|
|
|
+ if (unauthMsgBoxIsShow) return error;
|
|
|
+ unauthMsgBoxIsShow = true;
|
|
|
message = "身份验证失效,请重新登录";
|
|
|
MessageBox.confirm(message, "重新登陆?", {
|
|
|
- cancelButtonClass: "el-button--primary",
|
|
|
- confirmButtonClass: "el-button--default-act",
|
|
|
type: "warning",
|
|
|
+ closeOnClickModal: false,
|
|
|
+ closeOnPressEscape: false,
|
|
|
+ showClose: false,
|
|
|
callback: action => {
|
|
|
+ unauthMsgBoxIsShow = false;
|
|
|
if (action !== "confirm") return;
|
|
|
Vue.ls.clear();
|
|
|
router.push({ name: "Login" });
|