Selaa lähdekoodia

Merge branch 'dev' of http://192.168.0.115:3000/bill/4pc into dev

gemercheung 1 vuosi sitten
vanhempi
commit
7d5b6f0aee
9 muutettua tiedostoa jossa 25 lisäystä ja 189 poistoa
  1. 1 1
      .env
  2. 1 1
      .env.development
  3. 1 1
      .env.production
  4. 1 1
      .env.uat
  5. 0 1
      src/App.vue
  6. 2 4
      src/request/URL.ts
  7. 7 175
      src/request/index.ts
  8. 11 4
      src/store/scene.ts
  9. 1 1
      src/view/map/coord.vue

+ 1 - 1
.env

@@ -1,4 +1,4 @@
 VITE_QJ_URL=https://test.4dkankan.com/panorama
-VITE_LASER_URL=https://uat-laser.4dkankan.com/laser-4pc
+VITE_LASER_URL=https://uat-laser.4dkankan.com/4pc
 VITE_API=https://uat-sp.4dkankan.com/
 

+ 1 - 1
.env.development

@@ -1,3 +1,3 @@
 VITE_QJ_URL=https://test.4dkankan.com/panorama
-VITE_LASER_URL=https://uat-laser.4dkankan.com/laser-4pc
+VITE_LASER_URL=https://uat-laser.4dkankan.com/4pc
 VITE_API=https://uat-sp.4dkankan.com/

+ 1 - 1
.env.production

@@ -1,3 +1,3 @@
 VITE_QJ_URL=https://test.4dkankan.com/panorama
-VITE_LASER_URL=https://laser.4dkankan.com/laser-4pc
+VITE_LASER_URL=https://laser.4dkankan.com/4pc
 VITE_API=https://uat-sp.4dkankan.com/

+ 1 - 1
.env.uat

@@ -1,3 +1,3 @@
 VITE_QJ_URL=https://test.4dkankan.com/panorama
-VITE_LASER_URL=https://uat-laser.4dkankan.com/laser-4pc
+VITE_LASER_URL=https://uat-laser.4dkankan.com/4pc
 VITE_API=https://uat-sp.4dkankan.com/

+ 0 - 1
src/App.vue

@@ -37,7 +37,6 @@ lifeHook.push({
     if (exixts) {
       clearTimeout(timeout);
       timeout = setTimeout(() => {
-        console.log("close");
         loading!.close();
         loading = null;
         exixts = false;

+ 2 - 4
src/request/URL.ts

@@ -43,8 +43,7 @@ export const getUserInfoById = `/relics/user/info/:id`;
 export const userScenepage = `/relics/user/page`;
 
 export const getMsgAuthCode = `/relics/user/getMsgAuthCode`;
-export const changePassword = `/relics/user/changePassword`
-
+export const changePassword = `/relics/user/changePassword`;
 
 ///drawing
 
@@ -54,6 +53,5 @@ export const getDrawingDetail = `/relics/relics/drawing/info/:drawingId`;
 export const getDrawingInfoByRelicsId = `/relics/relics/drawing/infoByRelicsId/:drawingId`;
 export const updateDrawing = `/relics/relics/drawing/update`;
 
-
 //token
-export const getFdTokenByNum = `/relics/scene/getFdTokenByNum?num=`;
+export const getFdTokenByNum = `/relics/scene/getFdTokenByNum?num=`;

+ 7 - 175
src/request/index.ts

@@ -19,10 +19,11 @@ import {
   Device,
   // PolygonsAttrib,
 } from "./type";
+import { getFdTokenByNum } from "./URL";
 
 const error = throttle((msg: string) => ElMessage.error(msg), 2000);
 
-type Other = { params?: Param; paths?: Param, useResult?: boolean };
+type Other = { params?: Param; paths?: Param; useResult?: boolean };
 export const sendFetch = <T>(
   url: string,
   init: RequestInit,
@@ -47,9 +48,9 @@ export const sendFetch = <T>(
     ...init,
     headers: headers
       ? {
-        ...headers,
-        ...gHeaders,
-      }
+          ...headers,
+          ...gHeaders,
+        }
       : gHeaders,
   })
     .then((res) => {
@@ -192,173 +193,6 @@ export const relicsScenePosInfoFetch = (posId: number) =>
     { paths: { posId } }
   );
 
-// export const relicsPolyginsFetch = () => {
-//   return new Promise<PolygonsAttrib>((resolve) => {
-//     setTimeout(() => {
-//       resolve({
-//         lines: [
-//           {
-//             id: "1",
-//             pointIds: ["2666", "2667"],
-//           },
-//           {
-//             id: "2",
-//             pointIds: ["2667", "2669"],
-//           },
-//           {
-//             id: "3",
-//             pointIds: ["2669", "2674"],
-//           },
-//           {
-//             id: "4",
-//             pointIds: ["2674", "2675"],
-//           },
-//           {
-//             id: "5",
-//             pointIds: ["2675", "2676"],
-//           },
-//           {
-//             id: "6",
-//             pointIds: ["2676", "2673"],
-//           },
-//           {
-//             id: "7",
-//             pointIds: ["2673", "2672"],
-//           },
-//           {
-//             id: "8",
-//             pointIds: ["2672", "2670"],
-//           },
-//           {
-//             id: "9",
-//             pointIds: ["2677", "2678"],
-//           },
-//           {
-//             id: "10",
-//             pointIds: ["2678", "2679"],
-//           },
-//           {
-//             id: "11",
-//             pointIds: ["2679", "2680"],
-//           },
-//           {
-//             id: "12",
-//             pointIds: ["2680", "2681"],
-//           },
-//         ],
-//         polygons: [
-//           {
-//             id: "1",
-//             lineIds: ["1", "2", "3", "4", "5", "6", "7", "8"],
-//           },
-//           {
-//             id: "2",
-//             lineIds: ["9", "10", "11", "12"],
-//           },
-//         ],
-//         points: [
-//           {
-//             rtk: false,
-//             x: 115.949835199646,
-//             y: 30.0971239995873,
-//             id: "2666",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.949706558269,
-//             y: 30.0975243383135,
-//             id: "2667",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.950002555619,
-//             y: 30.0977552558535,
-//             id: "2668",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.949968744193,
-//             y: 30.097862045865,
-//             id: "2669",
-//           },
-//           {
-//             rtk: true,
-//             x: 115.950063977564,
-//             y: 30.0978879318173,
-//             id: "2670",
-//           },
-//           {
-//             rtk: true,
-//             x: 115.949964417593,
-//             y: 30.0978650571868,
-//             id: "2671",
-//           },
-//           {
-//             rtk: true,
-//             x: 115.950300839723,
-//             y: 30.0976756336231,
-//             id: "2672",
-//           },
-//           {
-//             rtk: true,
-//             x: 115.950437426448,
-//             y: 30.097269657442,
-//             id: "2673",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.95025353664198,
-//             y: 30.097554052476422,
-//             id: "2674",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.95021286828855,
-//             y: 30.09733715459145,
-//             id: "2675",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.95031589478391,
-//             y: 30.097000962869746,
-//             id: "2676",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.95100324233627,
-//             y: 30.09844929254667,
-//             id: "2677",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.95233898242569,
-//             y: 30.098492207890907,
-//             id: "2678",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.95227997382736,
-//             y: 30.097059908276954,
-//             id: "2679",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.95076720794296,
-//             y: 30.0971403745474,
-//             id: "2680",
-//           },
-//           {
-//             rtk: false,
-//             x: 115.95056336005783,
-//             y: 30.098095240956702,
-//             id: "2681",
-//           },
-//         ],
-//       });
-//     }, 500);
-//   });
-// };
-
 export type ScenePageProps = PageProps<{
   sceneCode?: string;
   sceneName?: string;
@@ -422,12 +256,10 @@ export const addDeviceFetch = (sn: string) =>
     body: JSON.stringify({ cameraSn: sn }),
   });
 
-
-
 export const getTokenFetch = (num: string) =>
   sendFetch(URL.getFdTokenByNum + num, {
     method: "get",
   });
 
-export * from './organization'
-export * from './users'
+export * from "./organization";
+export * from "./users";

+ 11 - 4
src/store/scene.ts

@@ -117,14 +117,21 @@ export const updateScenePointName = async (
 export const gotoScene = async (scene: Scene, edit = false) => {
   const params = new URLSearchParams();
   if (edit) {
-    params.set("token", gHeaders.token);
+    if (scene.sceneCode.startsWith("KJ")) {
+      try {
+        const res = await getTokenFetch(scene.sceneCode);
+        params.set("token", (res as any).token);
+      } catch {
+        edit = false;
+      }
+    } else {
+      params.set("token", gHeaders.token);
+    }
   }
   params.set("lang", "zh");
   if (scene.sceneCode.startsWith("KJ")) {
-    params.set("id", scene.sceneCode);
     const qjURL = import.meta.env.VITE_QJ_URL;
-    const res = await getTokenFetch(scene.sceneCode);
-    params.set("token", (res as any).token);
+    params.set("id", scene.sceneCode);
     // console.log('')
     window.open(`${qjURL}/${edit ? "edit" : "show"}.html?` + params.toString());
   } else {

+ 1 - 1
src/view/map/coord.vue

@@ -87,7 +87,7 @@
                       v-if="!data.run"
                       @click.stop="
                         data.type === 'scene'
-                          ? gotoScene(data.raw)
+                          ? gotoScene(data.raw, true)
                           : gotoPointPage(data.raw)
                       "
                     />