diff --git a/package-lock.json b/package-lock.json index 9f32b46..f8d993f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "echarts-gl": "^2.0.9", "echarts-liquidfill": "^3.1.0", "element-plus": "^2.7.0", + "gdt-jsapi": "^1.9.51", "sass": "^1.60.0", "video.js": "^8.17.3", "videojs-contrib-hls": "^5.15.0", @@ -110,6 +111,11 @@ "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" }, + "node_modules/@remax/mini-types": { + "version": "0.1.0", + "resolved": "https://registry.npmmirror.com/@remax/mini-types/-/mini-types-0.1.0.tgz", + "integrity": "sha512-bVDcbUrp6p0PZwfS0xGVQS6k9f8B35BtZaYt/W/IGKh7VALYQ+tS2KcytLRmIJ/Vmohaw5ikIRN89I+frPdh4g==" + }, "node_modules/@types/lodash": { "version": "4.17.1", "resolved": "https://registry.npmmirror.com/@types/lodash/-/lodash-4.17.1.tgz", @@ -736,6 +742,15 @@ "dev": true, "license": "MIT" }, + "node_modules/gdt-jsapi": { + "version": "1.9.51", + "resolved": "https://registry.npmmirror.com/gdt-jsapi/-/gdt-jsapi-1.9.51.tgz", + "integrity": "sha512-VN1iIK7kJU2g2oxY/n8waCREhWxcVwR8qHAE1keVnUJHI6mTdgTelICzq++niRRCaLqUVWC1pYvftEVgk4sq8A==", + "dependencies": { + "@babel/runtime": "^7.10.2", + "@remax/mini-types": "^0.1.0" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", diff --git a/package.json b/package.json index 2deb1d1..7edde68 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "echarts-gl": "^2.0.9", "echarts-liquidfill": "^3.1.0", "element-plus": "^2.7.0", + "gdt-jsapi": "^1.9.51", "sass": "^1.60.0", "video.js": "^8.17.3", "videojs-contrib-hls": "^5.15.0", diff --git a/src/router/index.js b/src/router/index.js index 6acb453..25ba1d6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,90 +1,95 @@ -import { createRouter, createWebHashHistory } from 'vue-router' +import { createRouter, createWebHashHistory } from "vue-router"; import http from "@/utils/request.js"; -import tools from '@/utils/tools' - +import tools from "@/utils/tools"; +import { namespaceContextKey } from "element-plus"; const routerHistory = createWebHashHistory(); const router = createRouter({ history: routerHistory, routes: [ { - path: '/', - redirect: '/guide' + path: "/", + redirect: "/guide", }, { - name: '引导页', - path: '/guide', - component: () => import('../view/guide.vue'), + name: "引导页", + path: "/guide", + component: () => import("../view/guide.vue"), }, { - path: '/home', - component: () => import('../view/home.vue'), + path: "/home", + component: () => import("../view/home.vue"), children: [ + // { + // name: '登录', + // path: '/login/index', + // component: () => import('../view/login/LoginZZD.vue'), + // }, { - name: '首页', - path: '/home/index', - component: () => import('../view/sy.vue'), + name: "首页", + path: "/home/index", + component: () => import("../view/sy.vue"), }, { - name: '养老', - path: '/home/yl', - component: () => import('../view/yl.vue'), + name: "养老", + path: "/home/yl", + component: () => import("../view/yl.vue"), }, { - name: '卫生', - path: '/home/hygiene', - component: () => import('../view/hygiene.vue'), + name: "卫生", + path: "/home/hygiene", + component: () => import("../view/hygiene.vue"), }, { - name: '教育', - path: '/home/education', - component: () => import('../view/education.vue'), + name: "教育", + path: "/home/education", + component: () => import("../view/education.vue"), }, { - name: '就业补助', - path: '/home/work', - component: () => import('../view/work.vue'), + name: "就业补助", + path: "/home/work", + component: () => import("../view/work.vue"), }, { - name: '智能分析', - path: '/home/analyze', - component: () => import('../view/analyze.vue'), + name: "智能分析", + path: "/home/analyze", + component: () => import("../view/analyze.vue"), }, { - name: '首页地图', - path: '/home/index/map', - component: () => import('../view/sy_map.vue'), + name: "首页地图", + path: "/home/index/map", + component: () => import("../view/sy_map.vue"), }, { - name: '首页表格', - path: '/home/index/table', - component: () => import('../view/sy_table.vue'), + name: "首页表格", + path: "/home/index/table", + component: () => import("../view/sy_table.vue"), }, { - name: '首页表格详情', - path: '/home/index/table/details', - component: () => import('../view/sy_details.vue'), + name: "首页表格详情", + path: "/home/index/table/details", + component: () => import("../view/sy_details.vue"), }, { - name: '人物图', - path: '/home/index/person', - component: () => import('../view/person/index.vue'), + name: "人物图", + path: "/home/index/person", + component: () => import("../view/person/index.vue"), }, // { // name: '地图编辑', // path: '/home/index/mapEdit', // component: () => import('../view/sy_map_fb.vue'), // }, - ] + ], }, - ] -}) + ], +}); function getCookie(cname) { - var cn = cname - const cookies = document.cookie.split('; '); + var cn = cname; + const cookies = document.cookie.split("; "); for (let i = 0; i < cookies.length; i++) { - const [name, value] = cookies[i].split('='); + const [name, value] = cookies[i].split("="); if (name === cn) { return value; } @@ -100,26 +105,27 @@ function getCookie(cname) { } router.beforeEach((to, form, next) => { - var token = getCookie('lytoken') - // console.log('token', token) - if (token == '') { - window.location.href = - 'http://220.191.238.50:996/api/login?returnURL=' + - window.location.href - } else { - // http.get("/api/zzdn_event/auditToken?token=" + token).then((res) => { - // if (res.code == '500') { - // window.location.href = - // 'http://220.191.238.50:996/api/login?returnURL=' + - // window.location.href - // } else { - // tools.data.set('token',token) - // next(); - // } - // }); - tools.data.set('token', token) - next(); - } -}) + // var token = getCookie('lytoken') + // // console.log('token', token) + // if (token == '') { + // window.location.href = + // 'http://220.191.238.50:996/api/login?returnURL=' + + // window.location.href + // } else { + // // http.get("/api/zzdn_event/auditToken?token=" + token).then((res) => { + // // if (res.code == '500') { + // // window.location.href = + // // 'http://220.191.238.50:996/api/login?returnURL=' + + // // window.location.href + // // } else { + // // tools.data.set('token',token) + // next(); + // // } + // // }); + // tools.data.set('token', token) + // next(); + // } + next(); +}); -export default router \ No newline at end of file +export default router; diff --git a/src/utils/request.js b/src/utils/request.js index ca4868b..4c94fa7 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,6 +1,8 @@ import axios from "axios"; import { ElMessage } from "element-plus"; import tools from "@/utils/tools"; + +import dd from "gdt-jsapi"; import router from "../router"; // axios.defaults.baseURL = '/api' axios.defaults.timeout = 120000; @@ -31,9 +33,13 @@ axios.interceptors.response.use( // console.log(error.response,"响应拦截器失败") ElMessage.error("请重新登录!"); // window.location.href = '/#/login?returnURL=' + window.location.href - window.location.href = - "http://220.191.238.50:996/api/login?returnURL=" + - window.location.href; + // window.location.href = + // "http://220.191.238.50:996/api/login?returnURL=" + + // window.location.href; + router.replace({ + path: '/guide' + }); + } else if (error.response.status == 404) { ElMessage.error("Status:404,正在请求不存在的服务器记录!"); } else if (error.response.status == 500) { diff --git a/src/view/guide.vue b/src/view/guide.vue index 3554cb0..3071fe7 100644 --- a/src/view/guide.vue +++ b/src/view/guide.vue @@ -61,6 +61,8 @@ + + \ No newline at end of file diff --git a/src/view/sy.vue b/src/view/sy.vue index 4226016..d724cda 100644 --- a/src/view/sy.vue +++ b/src/view/sy.vue @@ -1831,8 +1831,8 @@ const autoScroll = () => { } }; onBeforeMount(async () => { - document.cookie='lytoken=6b0e380b4a8f46baae4923f83faf670d' - tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d"); + // document.cookie='lytoken=6b0e380b4a8f46baae4923f83faf670d' + // tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d"); getData(); getfw(); setTimeout(() => { diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index 302c40b..8c353ca 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -3229,11 +3229,13 @@ const createCustomOverlay = (polygon, indexx) => { function createLabelDOM() { var content = document.createElement("div"); content.style.display = "flex"; + content.style.justifyContent= "end"; content.style.flexDirection = "column"; content.style.alignItems = "center"; content.style.justifyContent = "end"; content.style.height = "40px"; content.style.width = "140px"; + content.style.width = "140px"; content.style.zIndex = BMapGL.Overlay.getZIndex(this.point.lat); var div = document.createElement("div"); diff --git a/yarn.lock b/yarn.lock index 0ce46f8..1435654 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz" integrity sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ== -"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5": +"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5": version "7.25.4" resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.25.4.tgz" integrity sha512-DSgLeL/FNcpXuzav5wfYvHCGvynXkJbn3Zvc3823AEe9nPwW9IK4UoCSS5yGymmQzN0pCPvivtgS6/8U2kkm1w== @@ -159,6 +159,11 @@ resolved "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz" integrity sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ== +"@remax/mini-types@^0.1.0": + version "0.1.0" + resolved "https://registry.npmmirror.com/@remax/mini-types/-/mini-types-0.1.0.tgz" + integrity sha512-bVDcbUrp6p0PZwfS0xGVQS6k9f8B35BtZaYt/W/IGKh7VALYQ+tS2KcytLRmIJ/Vmohaw5ikIRN89I+frPdh4g== + "@types/lodash-es@^4.17.6": version "4.17.12" resolved "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz" @@ -599,6 +604,14 @@ function-bind@^1.1.1: resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +gdt-jsapi@^1.9.51: + version "1.9.51" + resolved "https://registry.npmmirror.com/gdt-jsapi/-/gdt-jsapi-1.9.51.tgz" + integrity sha512-VN1iIK7kJU2g2oxY/n8waCREhWxcVwR8qHAE1keVnUJHI6mTdgTelICzq++niRRCaLqUVWC1pYvftEVgk4sq8A== + dependencies: + "@babel/runtime" "^7.10.2" + "@remax/mini-types" "^0.1.0" + glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz"