fix: BUG修改

This commit is contained in:
kun 2023-10-30 17:07:57 +08:00
parent b20dd93d35
commit 9df7d60963
4 changed files with 41 additions and 9 deletions

View File

@ -5,8 +5,8 @@ NODE_ENV = "production"
# VITE_API_URL = "http://139.9.66.234:6688"
# VITE_API_URL = "http://jxjzw.zhgdyun.com:6688"
# VITE_API_URL = 'http://192.168.34.155:6688'
VITE_API_URL = 'http://10.75.253.12:6090'
# VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
# VITE_API_URL = 'http://10.75.253.12:6090'
VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
VITE_WPAPI_URL = "http://jxjzw.zhgdyun.com:8081"
# VITE_API_URL = "http://101.43.164.214:6688"
# VITE_API_URL = "https://wx.antjg.com:6081/"

View File

@ -12,7 +12,13 @@ export const LOGIN_URL: string = "/login";
export const DEFAULT_PRIMARY: string = "#008BFF";
// * 路由白名单地址(必须是本地存在的路由 staticRouter.ts
export const ROUTER_WHITE_LIST: string[] = ["/500", "/projectlogon", "/compLogon", "/load"];
export const ROUTER_WHITE_LIST: string[] = [
"/500",
"/projectlogon",
"/compLogon",
"/load",
"/goverment/huizhou/siteSupervision/videoMonitoring/index"
];
// * 高德地图 key
export const AMAP_MAP_KEY: string = "142e51d55274a0140e838245345cf9ad";

View File

@ -7,6 +7,8 @@ import { staticRouter, errorRouter } from "@/routers/modules/staticRouter";
import NProgress from "@/config/nprogress";
import { HOME_URL } from "@/enums/Home";
import { getButtonAuth } from "@/api/modules/auth";
import { userAnalysis } from "@/api/modules/huizhou";
import { getHomePage } from "@/api/modules/goverment";
// import path from "path";
/**
@ -55,7 +57,36 @@ router.beforeEach(async (to, from, next) => {
}
// 4.判断访问页面是否在路由白名单地址中,如果存在直接放行
if (ROUTER_WHITE_LIST.includes(to.path)) return next();
if (ROUTER_WHITE_LIST.includes(to.path)) {
if (to.query.token) {
const res = await userAnalysis({
ssoToken: to.query.token
});
console.log(res);
if (res.result) {
let responseData: any = res.result;
globalStore.setToken(responseData.token);
globalStore.setAccount(responseData.account);
globalStore.setAccountType(responseData.accountType);
globalStore.setProjectDateAuth(responseData.projectDateAuth);
globalStore.setIsManager(responseData.isManager); //我已知晓
// 获取module
const res1 = await getHomePage();
let data: any = {};
data = res1.result || {};
// tabsStore.closeMultipleTab();
// keepAlive.setKeepAliveName();
// await sendMessage({ isSuccess: true }, 2);
globalStore.setPath(to.path);
await initDynamicRouter();
// globalStore.moduleId = data["惠州项目"][0].moduleId;
} else {
// ElMessage.error("登录信息异常,请刷新或重新登录!");
return;
}
}
return next();
}
// 5.判断是否有 Token没有重定向到 login
// if (!globalStore.token) return next({ path: LOGIN_URL, replace: true });

View File

@ -165,10 +165,6 @@ import TreeFilter from "@/components/TreeFilter/index.vue";
import { GlobalStore } from "@/stores";
import Pagination from "@/components/ProTable/components/Pagination.vue";
import type { UploadProps, FormInstance, FormRules } from "element-plus";
import { format } from "date-fns";
import { useRouter } from "vue-router";
const router = useRouter();
const store = GlobalStore();
interface rightFormList {
@ -624,7 +620,6 @@ onMounted(async () => {
// console.log(item);
});
});
onBeforeUnmount(() => {
if (oWebControl.value === undefined) {
//