gemercheung 1 rok temu
rodzic
commit
646e9dc68e

+ 39 - 5
packages/qjkankan-editor/src/pages/Edit.vue

@@ -7,8 +7,8 @@
 import AppLayout from "@/framework/EditorAppLayout.vue";
 import { mapGetters } from "vuex";
 import browser from "@/utils/browser";
-import { exchangeId } from "@/api";
-
+import { exchangeId, checkWork, getPanoInfo, checkLogin } from "@/api";
+import { LoginDetector, OnlineDetector } from "@/utils/starter";
 export default {
   components: {
     AppLayout,
@@ -31,23 +31,57 @@ export default {
     const res = await exchangeId({
       id: id
     })
+
     if (token) {
       localStorage.setItem('token', token)
     }
-    const { id: resID, num } = res.data
+
+
+    const { id: resID, num, calcStatus } = res.data
     const isCam = String(num).length > 0
     let urlRes = `./edit.html?id=${resID}&lang=${lang}#/base`
     if (isCam) {
       urlRes = `./edit.html?id=${resID}&lang=${lang}&from=cam#/base`
     }
+    if (calcStatus === 0) {
+      this.$alert({
+        content: this.$i18n.t('common.calcing'),
+      });
+      return
+    }
     console.log('res', urlRes)
     location.replace(urlRes);
-  },
-  mounted() {
+  //检验是不是该用户作品
+  checkWork({
+      val: 1,
+    }).then((res) => {
+      if (res.data) {
+        checkLogin().then((response) => {
+          if (response.code == 3005) {
+            this.$store.commit("UpdateIsShowState", false);
+            this.$bus.emit("canLoad", false);
+            return this.$alert({ content: "当前无操作权限" });
+          } else {
+            this.$bus.emit("canLoad", true);
+            LoginDetector.valid();
+          }
+        });
+      } else {
+        return this.$alert({ content: "该作品已被删除" });
+      }
+    });
 
+    getPanoInfo().then(() => {
+      this.$store.commit("UpdateIsShowState", true);
+      OnlineDetector.valid();
+    });
 
+  },
+  mounted() {
     document.title = this.$i18n.t("gather.editpage_name");
     window.store = this.$store;
+
+  
     window.addEventListener(
       "beforeunload",
       (e) => {

+ 27 - 27
packages/qjkankan-editor/src/router/editorRouter.js

@@ -38,34 +38,34 @@ OnlineDetector.register(
   (detector) => new Promise((resolve) => detector.resolve(resolve))
 );
 
-setTimeout(() => {
-  //检验是不是该用户作品
-  checkWork({
-    val: 1,
-  }).then((res) => {
-    if (res.data) {
-      checkLogin().then((response) => {
-        if (response.code == 3005) {
-          store.commit("UpdateIsShowState", false);
-          vue.$bus.emit("canLoad", false);
-          return vue.$alert({ content: "当前无操作权限" });
-        } else {
-          vue.$bus.emit("canLoad", true);
-          LoginDetector.valid();
-        }
-      });
-    } else {
-      return vue.$alert({ content: "该作品已被删除" });
-    }
-  });
+// setTimeout(() => {
+//   //检验是不是该用户作品
+//   checkWork({
+//     val: 1,
+//   }).then((res) => {
+//     if (res.data) {
+//       checkLogin().then((response) => {
+//         if (response.code == 3005) {
+//           store.commit("UpdateIsShowState", false);
+//           vue.$bus.emit("canLoad", false);
+//           return vue.$alert({ content: "当前无操作权限" });
+//         } else {
+//           vue.$bus.emit("canLoad", true);
+//           LoginDetector.valid();
+//         }
+//       });
+//     } else {
+//       return vue.$alert({ content: "该作品已被删除" });
+//     }
+//   });
 
-  getPanoInfo().then(() => {
-    store.commit("UpdateIsShowState", true);
-    // if(response&&response.status == 1){
-    // }
-    OnlineDetector.valid();
-  });
-}, 2000);
+//   getPanoInfo().then(() => {
+//     store.commit("UpdateIsShowState", true);
+//     // if(response&&response.status == 1){
+//     // }
+//     OnlineDetector.valid();
+//   });
+// }, 2000);
 
 const router = new Router({
   routes: routes,