tangning 4 months ago
parent
commit
d285686b73
3 changed files with 21 additions and 21 deletions
  1. 14 14
      src/request/index.ts
  2. 6 7
      src/view/case/draw/index.vue
  3. 1 0
      src/view/case/draw/slider.vue

+ 14 - 14
src/request/index.ts

@@ -54,8 +54,8 @@ axios.interceptors.request.use(async (config) => {
   if (!token && !~notLoginUrls.indexOf(config.url)) {
     // router.replace({ name: RouteName.login });
     let redirect = encodeURIComponent(`${window.location.href}`);
-    // window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
-    // throw "用户未登录";
+    window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
+    throw "用户未登录";
   }
   config.headers.token = token;
   config.headers['caseid'] = caseId;
@@ -102,16 +102,16 @@ const responseInterceptor = (res: AxiosResponse<any, any>) => {
     const { setLoginShow, loginShow } = getLogin();
     console.log("4010",loginShow,'loginShow', res);
     setLoginShow(true)
-    throw res.data.msg;
-    // console.log("4010",loginShow,'loginShow', res);
-    // setLoginShow(true);
-    // ElMessageBox.alert("您没有访问权限", "提示", {
-    //   confirmButtonText: "我知道了",
-    //   type: "warning",
-    //   showClose: false
-    // }).then(async () => {
-    //   window.open(window.location.origin + "/admin/#/statistics/scene");
-    // });
+    // throw res.data.msg;
+    console.log("4010",loginShow,'loginShow', res);
+    setLoginShow(true);
+    ElMessageBox.alert("您没有访问权限", "提示", {
+      confirmButtonText: "我知道了",
+      type: "warning",
+      showClose: false
+    }).then(async () => {
+      window.open(window.location.origin + "/admin/#/statistics/scene");
+    });
   };
   if (!successCode.includes(res.data.code) && res.config?.responseType != "blob") {
     let errMsg = res.data.msg || res.data.message;
@@ -122,8 +122,8 @@ const responseInterceptor = (res: AxiosResponse<any, any>) => {
       errMsg === "token已经失效,请重新登录"
     ) {
       let redirect = encodeURIComponent(`${window.location.href}`);
-      // window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
-      // router.replace({ name: RouteName.login });
+      window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
+      router.replace({ name: RouteName.login });
       getAuth().clear();
     }
     throw res.data.msg;

+ 6 - 7
src/view/case/draw/index.vue

@@ -67,8 +67,8 @@ const list = ref({
 });
 const fmtId = ref(0);
 const pmtId = ref(0);
-const board = ref(null);
-const state = ref({});
+// const board = ref(null);
+// const state = ref({});
 const ognFilesUrl = ref('')
 const dom = ref<HTMLCanvasElement>();
 const props = computed(() => {
@@ -87,6 +87,8 @@ const props = computed(() => {
     };
   }
 });
+
+const {board, state} = useBoard(props);
 async function getList() {
   updateByTreeFileLists(props.caseId).then(res => {
     let newlist =  res.find(ele => ele.filesTypeName == '三录材料')?.childrenList || [];
@@ -94,11 +96,8 @@ async function getList() {
     pmtId.value = list.value.xct.find(ele => ele.filesTypeName == '平面图').filesTypeId
     fmtId.value = list.value.xct.find(ele => ele.filesTypeName == '方位图').filesTypeId
     console.log('list.value', list.value)
-    if(pmtId.value || fmtId.value) {
-      const boardData = useBoard(props);
-      board.value = boardData.board;
-      state.value = boardData.state;
-    }
+    // if(pmtId.value || fmtId.value) {
+    // }
   })
 }
 const backPageHandler = () => {

+ 1 - 0
src/view/case/draw/slider.vue

@@ -112,6 +112,7 @@ const cover = reactive(
 );
 
 const coverUploadHandler = async () => {
+  console.log('props', props);
   if (
     props.existsBgImage &&
     (await confirm("重新上传将替换当前图体,确定要上传吗?", "继续上传"))