diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..2cfd1fa Binary files /dev/null and b/dist.zip differ diff --git a/src/components/header.vue b/src/components/header.vue index 898f911..8bdcfcf 100644 --- a/src/components/header.vue +++ b/src/components/header.vue @@ -75,6 +75,7 @@ import { import { useRouter, useRoute } from "vue-router"; const router = useRouter(); const routers = useRoute(); +import tools from "@/utils/tools"; // 返回 const back = () => { router.back(); @@ -106,8 +107,19 @@ const to = (url) => { router.push({ path: `${url}`, }); - data.nowTab = url; - data.menushow = false; + if (url == "/home/index/map") { + let menu = tools.data.get("menu"); + if(menu && menu.indexOf('ggfw:ystp') != -1){ + data.nowTab = url; + data.menushow = false; + } + }else{ + data.nowTab = url; + data.menushow = false; + } + + // data.nowTab = url; + // data.menushow = false; }; const onMenu = (val) => { console.log(val); diff --git a/src/router/index.js b/src/router/index.js index c01f5e2..608bcf6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,7 +1,8 @@ import { createRouter, createWebHashHistory } from "vue-router"; import http from "@/utils/request.js"; import tools from "@/utils/tools"; -import { namespaceContextKey } from "element-plus"; +// import { namespaceContextKey } from "element-plus"; +import { ElMessage, ElMessageBox } from "element-plus"; const routerHistory = createWebHashHistory(); const router = createRouter({ @@ -138,6 +139,7 @@ const router = createRouter({ }); router.beforeEach((to, form, next) => { + let menu = tools.data.get("menu"); // var token = getCookie('lytoken') // // console.log('token', token) // if (token == '') { @@ -159,13 +161,17 @@ router.beforeEach((to, form, next) => { // next(); // } // console.log(55555, to.fullPath); - // if (to.fullPath == '/home/index/map') { - - // next('/home/index') - // } else { - - // } - next(); + if (to.fullPath == '/home/index/map' ) { + if(!menu || menu.indexOf('ggfw:ystp') == -1){ + ElMessage.error("您无权限访问该模块,若有需求请联系大数据中心!"); + }else{ + next(); + } + } else { + next(); + } + + // next(); }); export default router; diff --git a/src/utils/request.js b/src/utils/request.js index 02a9252..ab56c12 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -2,7 +2,7 @@ import axios from "axios"; import { ElMessage } from "element-plus"; import tools from "@/utils/tools"; import router from "../router"; -axios.defaults.baseURL = 'https://jzzf.longyou.gov.cn:998/' +// axios.defaults.baseURL = 'https://jzzf.longyou.gov.cn:998/' axios.defaults.timeout = 120000; // HTTP request 拦截器 diff --git a/src/view/guide.vue b/src/view/guide.vue index 2c6f9fb..825ba16 100644 --- a/src/view/guide.vue +++ b/src/view/guide.vue @@ -137,7 +137,7 @@ const getCookie = (cname) => { }; // 登录 const login = () => { - let backurl=tools.data.get("backUrl"); + let backurl = tools.data.get("backUrl"); dd.getAuthCode() .then((res) => { // let auth__code = env == "pc" ? res.auth_code : res.code; @@ -151,8 +151,9 @@ const login = () => { // var token = getCookie("lytoken"); tools.data.set("token", response.data); tools.data.set("type", 1); + getMenu(); if (backurl) { - window.location.href= backurl; + window.location.href = backurl; tools.data.remove("backUrl"); } } else { @@ -202,17 +203,17 @@ const login = () => { // console.log("Decrypted Text:", decodedText); var tokenU = decodedText; if (getCookie("lytoken")) { - } else { document.cookie = `lytoken=${tokenU}`; } var token = getCookie("lytoken"); tools.data.set("token", token); tools.data.set("type", 2); - if (backurl) { - window.location.href= backurl; - tools.data.remove("backUrl"); - } + getMenu(); + if (backurl) { + window.location.href = backurl; + tools.data.remove("backUrl"); + } } else { var tokenPd = getCookie("lytoken"); if (!tokenPd) { @@ -220,11 +221,17 @@ const login = () => { "http://220.191.238.50:996/api/login?returnURL=" + window.location.href; } else { + getMenu(); } } }); }; - +//头部菜单 +const getMenu = () => { + http.get(`/api/ggfwyth/account/roleMenu`).then((res) => { + tools.data.set("menu", res.data); + }); +}; onUnmounted(() => { // 清理事件监听器 stopDrag(); diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index 12589d2..13375ee 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -1611,7 +1611,7 @@ const movemode = () => { selectedOverlay = null; sceneMove = null; movepoy = null; - select = null; + // select = null; arrJWD = [[[]]]; }; //移动地块 diff --git a/src/view/table_gk/gk_jz.vue b/src/view/table_gk/gk_jz.vue index ba80e9f..2ab50e2 100644 --- a/src/view/table_gk/gk_jz.vue +++ b/src/view/table_gk/gk_jz.vue @@ -795,9 +795,9 @@ onMounted(() => {}); } } -// :deep(.el-table--enable-row-hover .el-table__body tr:hover > td) { -// background-color: #2f4b74 !important; -// } +:deep(.el-table--enable-row-hover .el-table__body tr:hover > td) { + background-color: #2f4b74 !important; +} :deep(.el-table__body tr.hover-row > td.el-table__cell) { background-color: #2f4b74; }