returnjinx 1 месяц назад
Родитель
Сommit
81d2af66b9

+ 143 - 32
packages/qjkankan-editor/src/api/index.js

@@ -33,7 +33,14 @@ export function getUserInfo(ok, no) {
  * @param {*} no
  */
 export function getPanoInfo(data, ok, no) {
-  return http.get(`${ossUrl}/720yun_fd_manage/${data || number()}/someData.json?_=${Math.random()}`, {}, ok, no);
+  return http.get(
+    `${ossUrl}/720yun_fd_manage/${
+      data || number()
+    }/someData.json?_=${Math.random()}`,
+    {},
+    ok,
+    no
+  );
 }
 /**
  * 获取全景列表
@@ -42,7 +49,12 @@ export function getPanoInfo(data, ok, no) {
  * @param {*} no
  */
 export function getSceneList(workId, ok, no) {
-  return http.get(`${URL_FILL}/work/edit/navigation/scene/list?workId=${workId}`, {}, ok, no);
+  return http.get(
+    `${URL_FILL}/work/edit/navigation/scene/list?workId=${workId}`,
+    {},
+    ok,
+    no
+  );
 }
 /**
  * 获取作品自定义logo
@@ -60,7 +72,12 @@ export function getWorkLogo(data, ok, no) {
  * @param {*} no
  */
 export function getSceneInfomation(data, ok, no) {
-  return http.get(`/api/scene/getInfo?num=${data.id}&_=${Math.random()}`, {}, ok, no);
+  return http.get(
+    `/api/scene/getInfo?num=${data.id}&_=${Math.random()}`,
+    {},
+    ok,
+    no
+  );
 }
 
 /**
@@ -70,7 +87,12 @@ export function getSceneInfomation(data, ok, no) {
  * @param {*} no
  */
 export function getTabList(data, ok, no) {
-  return http.get(`${URL_FILL}/manage/catalog/getCatalog/${number()}`, data, ok, no);
+  return http.get(
+    `${URL_FILL}/manage/catalog/getCatalog/${number()}`,
+    data,
+    ok,
+    no
+  );
 }
 
 /**
@@ -80,7 +102,12 @@ export function getTabList(data, ok, no) {
  * @param {*} no
  */
 export function getTabSceneList(data, ok, no) {
-  return http.get(`${URL_FILL}/manage/catalog/getScene/${data.catalogId}`, {}, ok, no);
+  return http.get(
+    `${URL_FILL}/manage/catalog/getScene/${data.catalogId}`,
+    {},
+    ok,
+    no
+  );
 }
 
 /**
@@ -398,8 +425,17 @@ export function searchInAll3DScenes(data, ok) {
     // ),
   ]).then((res) => {
     console.log(res);
-    let total = res[0].data.total + res[1].data.total + res[2].data.total + res[3].data.total;
-    let list = [...res[0].data.list, ...res[1].data.list, ...res[2].data.list, ...res[3].data.list];
+    let total =
+      res[0].data.total +
+      res[1].data.total +
+      res[2].data.total +
+      res[3].data.total;
+    let list = [
+      ...res[0].data.list,
+      ...res[1].data.list,
+      ...res[2].data.list,
+      ...res[3].data.list,
+    ];
     ok({
       code: 0,
       data: {
@@ -417,7 +453,12 @@ export function searchInAll3DScenes(data, ok) {
  * @param {*} no
  */
 export function getIndex(data, ok, no) {
-  return http.get(`${URL_FILL}/manage/scene/getIndex/${number()}`, data, ok, no);
+  return http.get(
+    `${URL_FILL}/manage/scene/getIndex/${number()}`,
+    data,
+    ok,
+    no
+  );
 }
 
 /**
@@ -427,7 +468,12 @@ export function getIndex(data, ok, no) {
  * @param {*} no
  */
 export function saveIndexInfo(data, ok, no) {
-  return http.post(`${URL_FILL}/manage/scene/setIndex/${data.id}/${number()}`, "", ok, no);
+  return http.post(
+    `${URL_FILL}/manage/scene/setIndex/${data.id}/${number()}`,
+    "",
+    ok,
+    no
+  );
 }
 
 /**
@@ -507,7 +553,12 @@ export function saveUseHots(data, ok, no) {
  * @param {*} no
  */
 export function deleteIndexInfo(data, ok, no) {
-  return http.get(`${URL_FILL}/manage/scene/removeIndex/${number()}`, data, ok, no);
+  return http.get(
+    `${URL_FILL}/manage/scene/removeIndex/${number()}`,
+    data,
+    ok,
+    no
+  );
 }
 
 /**
@@ -527,7 +578,12 @@ export function getSceneInfo(data, ok, no) {
  * @param {*} no
  */
 export function getWebTabList(data, ok, no) {
-  return http.get(`${URL_FILL}/web/common/getCatalog/${number()}`, data, ok, no);
+  return http.get(
+    `${URL_FILL}/web/common/getCatalog/${number()}`,
+    data,
+    ok,
+    no
+  );
 }
 
 /**
@@ -538,11 +594,21 @@ export function getWebTabList(data, ok, no) {
  */
 export function checkWork(data, ok, no) {
   let visit = "";
-  if (window.location.pathname.indexOf("showMobile.html") > -1 || window.location.pathname.indexOf("show.html") > -1) {
+  if (
+    window.location.pathname.indexOf("showMobile.html") > -1 ||
+    window.location.pathname.indexOf("show.html") > -1
+  ) {
     visit = 1111;
   }
   console.log("checkWork", data);
-  return http.get(`${URL_FILL}/web/common/checkWork/${number()}${visit ? "?visit=" + visit : ""}`, data, ok, no);
+  return http.get(
+    `${URL_FILL}/web/common/checkWork/${number()}${
+      visit ? "?visit=" + visit : ""
+    }`,
+    data,
+    ok,
+    no
+  );
 }
 
 /**
@@ -552,7 +618,12 @@ export function checkWork(data, ok, no) {
  * @param {*} no
  */
 export function getWebTabSceneList(data, ok, no) {
-  return http.get(`${URL_FILL}/web/common/getScene/${data.catalogId}`, {}, ok, no);
+  return http.get(
+    `${URL_FILL}/web/common/getScene/${data.catalogId}`,
+    {},
+    ok,
+    no
+  );
 }
 
 /**
@@ -570,7 +641,12 @@ export function checkLogin() {
  * 检测素材状态
  */
 export function checkMStatus(data, ok, no) {
-  return http.get(`${URL_FILL}/manage/fodder/checkStatus/${data.ids.join(",")}`, { islongpolling: data.islongpolling }, ok, no);
+  return http.get(
+    `${URL_FILL}/manage/fodder/checkStatus/${data.ids.join(",")}`,
+    { islongpolling: data.islongpolling },
+    ok,
+    no
+  );
 }
 
 /**
@@ -611,7 +687,12 @@ export function getWebIndex(data, ok, no) {
  * @param {*} no
  */
 export function getAllVrList(data, ok, no) {
-  return http.get(`${URL_FILL}/manage/scene/findByWork/${number()}`, data, ok, no);
+  return http.get(
+    `${URL_FILL}/manage/scene/findByWork/${number()}`,
+    data,
+    ok,
+    no
+  );
 }
 
 /**
@@ -734,10 +815,22 @@ export function getMaterialList(data, ok, no) {
  * @param {*} no
  */
 export function uploadMaterialOld(data, subdata, ok, no, onProgress) {
-  return http.uploadFile(`${URL_FILL}/manage/fodder/upload/${subdata.type}/${subdata.uid}`, data, ok, no, onProgress);
+  return http.uploadFile(
+    `${URL_FILL}/manage/fodder/upload/${subdata.type}/${subdata.uid}`,
+    data,
+    ok,
+    no,
+    onProgress
+  );
 }
 export function uploadMaterial(data, ok, no, onProgress) {
-  return http.uploadFile(`${URL_FILL}/manage/fodder/uploadDir`, data, ok, no, onProgress);
+  return http.uploadFile(
+    `${URL_FILL}/manage/fodder/uploadDir`,
+    data,
+    ok,
+    no,
+    onProgress
+  );
 }
 
 /**
@@ -781,18 +874,20 @@ function folderTreeSortRoutine(folderList) {
 
 // 获取目录结构
 export function getFolderTree(data) {
-  return http.getJson(`${URL_FILL}/manage/dir/getTree/${data.type}`).then((res) => {
-    if (res.code === 0 && Array.isArray(res.data)) {
-      const temp = {
-        name: "根目录",
-        id: 1,
-        children: res.data,
-      };
-      res.data = temp;
-      postOrderTraversal(res.data, folderTreeSortRoutine);
-    }
-    return res;
-  });
+  return http
+    .getJson(`${URL_FILL}/manage/dir/getTree/${data.type}`)
+    .then((res) => {
+      if (res.code === 0 && Array.isArray(res.data)) {
+        const temp = {
+          name: "根目录",
+          id: 1,
+          children: res.data,
+        };
+        res.data = temp;
+        postOrderTraversal(res.data, folderTreeSortRoutine);
+      }
+      return res;
+    });
 }
 
 // 素材库中新增文件夹
@@ -1012,7 +1107,12 @@ export function workHotSave(data, ok, no) {
 
 export function initialSet(data, ok, no) {
   !data.workId && (data.workId = number());
-  return http.postJson(`${URL_FILL}/work/edit/navigation/scene/initial/set`, data, ok, no);
+  return http.postJson(
+    `${URL_FILL}/work/edit/navigation/scene/initial/set`,
+    data,
+    ok,
+    no
+  );
 }
 
 // /**
@@ -1027,7 +1127,12 @@ export function initialSet(data, ok, no) {
  */
 export function navigationSave(data, ok, no) {
   !data.workId && (data.workId = number());
-  return http.postJson(`${URL_FILL}/work/edit/navigation/navigation/save`, data, ok, no);
+  return http.postJson(
+    `${URL_FILL}/work/edit/navigation/navigation/save`,
+    data,
+    ok,
+    no
+  );
 }
 /**
  * 保存遮罩
@@ -1043,6 +1148,12 @@ export function explanationSave(data, ok, no) {
   !data.workId && (data.workId = number());
   return http.postJson(`${URL_FILL}/work/edit/explanation/save`, data, ok, no);
 }
+/**
+ * 获取作品信息
+ */
+export function Logout(data, ok, no) {
+  return http.getJson(`${URL_FILL}/admin/logout`, data, ok, no);
+}
 
 // /**
 //  * 导航新增分组

+ 32 - 32
packages/qjkankan-editor/src/components/userInfo.vue

@@ -2,27 +2,31 @@
   <div class="user-info">
     <template v-if="userAvatar && userNickName">
       <img class="avatar" :src="userAvatar" alt="" />
-      <div class="nickName">{{userNickName}}</div>
+      <div class="nickName">{{ userNickName }}</div>
       <i class="iconfont icon-show_drop-down"></i>
       <ul class="menu">
-        <li><span @click="onClickPersonalCenter">{{personal_center}}</span></li>
-        <li><span class="warn" @click="onClickLogout" >{{logout}}</span></li>
+        <li>
+          <span @click="onClickPersonalCenter">{{ personal_center }}</span>
+        </li>
+        <li>
+          <span class="warn" @click="onClickLogout">{{ logout }}</span>
+        </li>
       </ul>
     </template>
     <template v-else>
       <div class="loginAndRegis">
-        <span @click="onClickLogin">{{login}}</span>
+        <span @click="onClickLogin">{{ login }}</span>
         |
-        <span @click="onClickRegister">{{register}}</span>
+        <span @click="onClickRegister">{{ register }}</span>
       </div>
     </template>
   </div>
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import {i18n} from "@/lang"
-
+import { mapGetters } from "vuex";
+import { i18n } from "@/lang";
+import { Logout } from "@/api";
 export default {
   data() {
     return {
@@ -30,35 +34,31 @@ export default {
       logout: i18n.t("personal_center.logout"),
       login: i18n.t("personal_center.login"),
       register: i18n.t("personal_center.register"),
-
-    }
+    };
   },
   computed: {
-    ...mapGetters([
-      'userAvatar',
-      'userNickName'
-    ]),
+    ...mapGetters(["userAvatar", "userNickName"]),
   },
   methods: {
-    onClickLogin(){
-      window.location.href = '/#/login/login?from=%2F'
+    onClickLogin() {
+      window.location.href = "/#/login/login?from=%2F";
     },
-    onClickRegister(){
-      window.location.href = '/#/login/register?from=%2F'
+    onClickRegister() {
+      window.location.href = "/#/login/register?from=%2F";
     },
     onClickPersonalCenter() {
-      window.location.href = '/#/information'
+      window.location.href = "/#/information";
     },
     onClickLogout() {
-      localStorage.setItem('token', '')
-      localStorage.setItem('info', '')
-      window.location.href = '/#/'
-    }
+      Logout(null, () => {
+        localStorage.setItem("token", "");
+        localStorage.setItem("info", "");
+        window.location.href = "/#/";
+      });
+    },
   },
-  mounted() {
-  }
-}
-
+  mounted() {},
+};
 </script>
 
 <style lang="less" scoped>
@@ -98,7 +98,7 @@ export default {
     box-shadow: 0px 2px 12px 0px rgba(50, 50, 51, 0.12);
     top: 50px;
     right: -10px;
-    &:hover{
+    &:hover {
       display: block;
     }
     // 菜单的箭头
@@ -116,7 +116,7 @@ export default {
     li {
       display: block;
       padding: 11px 20px;
-      border-bottom: solid 1px #EBEDF0;
+      border-bottom: solid 1px #ebedf0;
       &:last-child {
         border-bottom: none;
       }
@@ -126,8 +126,8 @@ export default {
         cursor: pointer;
         word-break: keep-all;
         &.warn {
-          color: #FA5555;
-        }  
+          color: #fa5555;
+        }
       }
     }
   }
@@ -140,4 +140,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 4 - 0
packages/qjkankan-editor/vue.config.js

@@ -48,6 +48,10 @@ module.exports = {
         target: proxy_url,
         changeOrigin: true,
       },
+      "/admin": {
+        target: proxy_url,
+        changeOrigin: true,
+      },
       "/api": {
         target: process.env.VUE_APP_PROXY_URL_ROOT,
         changeOrigin: true,