|
@@ -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) => {
|
|
@@ -63,18 +64,17 @@ export const sendFetch = <T>(
|
|
|
})
|
|
|
.then((data) => {
|
|
|
if (data.code !== 0) {
|
|
|
- error(data.message);
|
|
|
+ !sendUrl.includes(getFdTokenByNum) && error(data.message);
|
|
|
errorHook.map((err) => {
|
|
|
err(data.code, data.msg);
|
|
|
});
|
|
|
throw data.message;
|
|
|
} else {
|
|
|
if (other && other.useResult) {
|
|
|
- return data
|
|
|
+ return data;
|
|
|
} else {
|
|
|
return data.data;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -193,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;
|
|
@@ -423,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";
|