tangning 7 ay önce
ebeveyn
işleme
38984f8ac1
2 değiştirilmiş dosya ile 12 ekleme ve 2 silme
  1. 2 2
      src/assets/style/public.scss
  2. 10 0
      src/request/index.ts

+ 2 - 2
src/assets/style/public.scss

@@ -312,7 +312,7 @@ body {
 }
 
 .el-message-box__status {
-  top: -31px !important;
+  top: -13px !important;
 }
 
 .el-message-box__title span::before {
@@ -424,7 +424,7 @@ body {
 }
 
 .el-message-box__header {
-  padding       : 34px;
+  padding       : 0 34px;
   padding-bottom: 0;
 }
 

+ 10 - 0
src/request/index.ts

@@ -1,4 +1,5 @@
 import axios, { AxiosResponse } from "axios";
+import { ElMessage, ElMessageBox } from "element-plus";
 import qs from "qs";
 import { openLoading, closeLoading } from "./loading";
 import { openErrorMsg } from "./errorMsg";
@@ -88,6 +89,15 @@ axios.interceptors.request.use(async (config) => {
 
 const responseInterceptor = (res: AxiosResponse<any, any>) => {
   closeLoading();
+  if (res.data.code === 4010){
+    ElMessageBox.alert("您没有访问权限", "提示", {
+      confirmButtonText: "我知道了",
+      type: "warning",
+      showClose: false
+    }).then(async () => {
+      window.open(window.location.origin + "/admin/#/login");
+    });
+  };
   if (!successCode.includes(res.data.code)) {
     let errMsg = res.data.msg || res.data.message;
     openErrorMsg(errMsg);