This commit is contained in:
2025-12-12 17:31:01 +08:00
4 changed files with 30 additions and 21 deletions

View File

@ -21,9 +21,9 @@ router.beforeEach(async (to, from, next) => {
// 存在 token ,进入主页 // 存在 token ,进入主页
// if (store.state.user.token) { // if (store.state.user.token) {
// 快捷访问 // 快捷访问
console.log(store.getters.token); // console.log(store.getters.token);
if (store.getters.token) { if (store.getters.token) {
console.log("路由1"); // console.log("路由1");
// 判断用户资料是否获取 // 判断用户资料是否获取
// 若不存在用户信息,则需要获取用户信息 // 若不存在用户信息,则需要获取用户信息
@ -32,39 +32,39 @@ router.beforeEach(async (to, from, next) => {
// 添加完动态路由之后,需要在进行一次主动跳转 // 添加完动态路由之后,需要在进行一次主动跳转
const afterMenuList = getItem('menusPermission'); const afterMenuList = getItem('menusPermission');
// 处理用户权限,筛选出需要添加的权限 // 处理用户权限,筛选出需要添加的权限
console.log(store.state.permission.routes); // console.log(store.state.permission.routes);
if (store.state.permission.routes.length === 0) { if (store.state.permission.routes.length === 0) {
const filterRoutes = await store.dispatch('permission/filterRoutes', afterMenuList) const filterRoutes = await store.dispatch('permission/filterRoutes', afterMenuList)
filterRoutes.forEach(item => { filterRoutes.forEach(item => {
router.addRoute(item) router.addRoute(item)
}) })
console.log("已添加动态路由"); // console.log("已添加动态路由");
next({ next({
...to, ...to,
replace: true replace: true
}) })
} else { } else {
console.log('已存在路由'); // console.log('已存在路由');
next() next()
} }
// 利用 addRoute 循环添加 // 利用 addRoute 循环添加
} else { } else {
// 没有token的情况下可以进入白名单 // 没有token的情况下可以进入白名单
if (whiteList.indexOf(to.path) > -1) { if (whiteList.indexOf(to.path) > -1) {
console.log("路由2"); // console.log("路由2");
next() next()
} else { } else {
const cookie = getCookie("clientKey"); const cookie = getCookie("clientKey");
if (cookie) { if (cookie) {
console.log("路由3"); // console.log("路由3");
next(`/zeroTrust_login`) next(`/zeroTrust_login`)
} else { } else {
console.log("路由4"); // console.log("路由4");
const isOatuh = getItem('isOatuh') const isOatuh = getItem('isOatuh')
// 没有token的情况下可以进入白名单 // 没有token的情况下可以进入白名单
if (isOatuh) { if (isOatuh) {
console.log("路由5"); // console.log("路由5");
const idEntityCard = getItem('idEntityCard') const idEntityCard = getItem('idEntityCard')
next(`/oatuh_login?token=${Base64.encode(idEntityCard)}`) next(`/oatuh_login?token=${Base64.encode(idEntityCard)}`)
} else { } else {

View File

@ -562,7 +562,16 @@ export const publicRoutes = [
title: "采集积分", title: "采集积分",
icon: "article" icon: "article"
} }
},
{
path: "/policeReport",
name: "policeReport",
component: () => import("@/views/backOfficeSystem/policeReport/index.vue"),
meta: {
title: "警情管理",
icon: "article"
} }
},
// { // {
// path: "/MakeAcomment", // path: "/MakeAcomment",
// name: "MakeAcomment", // name: "MakeAcomment",
@ -849,15 +858,15 @@ export const publicRoutes = [
// } // }
// }, // },
{ // {
path: "/policeReport", // path: "/policeReport",
name: "policeReport", // name: "policeReport",
component: () => import("@/views/backOfficeSystem/policeReport/index.vue"), // component: () => import("@/views/backOfficeSystem/policeReport/index.vue"),
meta: { // meta: {
title: "警情管理", // title: "警情管理",
icon: "article" // icon: "article"
} // }
}, // },
] ]
}, },

View File

@ -211,7 +211,7 @@ const bqYs = (val) => {
const assessShow = ref(false) const assessShow = ref(false)
const dataList = ref() const dataList = ref()
const pushAssess = (val) => { const pushAssess = (val) => {
return holographicProfileJump(val?.rysfzh) // 全息档案跳转 return holographicProfileJump(val?.sfzh) // 全息档案跳转
// assessShow.value = true; // assessShow.value = true;
// dataList.value = val; // dataList.value = val;
} }

View File

@ -229,7 +229,7 @@ const handleQsFk = (val, type) => {
const assessShow = ref(false) const assessShow = ref(false)
const dataList = ref() const dataList = ref()
const pushAssess = (val) => { const pushAssess = (val) => {
return holographicProfileJump(val?.rysfzh) // 全息档案跳转 return holographicProfileJump(val?.sfzh) // 全息档案跳转
// assessShow.value = true; // assessShow.value = true;
// dataList.value = val; // dataList.value = val;
} }