gemercheung 1 ano atrás
pai
commit
67607e4262

+ 15 - 0
packages/qjkankan-editor/src/api/index.js

@@ -1028,3 +1028,18 @@ export function getQrCode(data, ok, no) {
 export function getCamWorksList(data, ok, no) {
   return http.postJson(`${URL_FILL}/manage/work/sceneWorkList`, data, ok, no);
 }
+
+/**
+ * 检查作品id
+ * @param {*} data
+ * @param {*} ok
+ * @param {*} no
+ */
+export function exchangeId(data, ok, no) {
+  return http.postJson(
+    `${URL_FILL}/web/common/getIdInfo`,
+    data,
+    ok,
+    no
+  );
+}

+ 26 - 1
packages/qjkankan-editor/src/pages/Edit.vue

@@ -5,8 +5,9 @@
 </template>
 <script>
 import AppLayout from "@/framework/EditorAppLayout.vue";
-import { ref, reactive, defineComponent } from "vue-demi";
 import { mapGetters } from "vuex";
+import browser from "@/utils/browser";
+import { exchangeId } from "@/api";
 
 export default {
   components: {
@@ -23,7 +24,28 @@ export default {
       }
     },
   },
+  async beforeMount() {
+    const id = browser.urlQueryValue('id');
+    const lang = browser.urlQueryValue("lang") || 'zh'
+    const token = browser.urlQueryValue('token');
+    const res = await exchangeId({
+      id: id
+    })
+    if (token) {
+      localStorage.setItem('token', token)
+    }
+    const { id: resID, num } = 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`
+    }
+    console.log('res', urlRes)
+    location.replace(urlRes);
+  },
   mounted() {
+
+
     document.title = this.$i18n.t("gather.editpage_name");
     window.store = this.$store;
     window.addEventListener(
@@ -54,6 +76,7 @@ body,
   position: relative;
   z-index: 0;
 }
+
 body {
   margin: 0;
   color: #fff;
@@ -63,11 +86,13 @@ body {
   user-select: none;
   font-family: OpenSans, sans-serif;
 }
+
 ul {
   list-style: none;
   margin: 0;
   padding: 0;
 }
+
 img {
   border: 0;
   outline: 0;

+ 1 - 1
packages/qjkankan-view/src/apis/index.js

@@ -63,7 +63,7 @@ export function checkWork(ok, no) {
 }
 
 /**
- * 检查作品是否可用
+ * 检查作品id
  * @param {*} data
  * @param {*} ok
  * @param {*} no