Commit e9980d32 by tyk

代码更新

parent eed1d26d
...@@ -50,7 +50,7 @@ router.beforeEach((to, from, next) => { ...@@ -50,7 +50,7 @@ router.beforeEach((to, from, next) => {
// 在免登录白名单,直接进入 // 在免登录白名单,直接进入
next(); next();
} else { } else {
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`); // 否则全部重定向到登录页 next(`/web`); // 否则全部重定向到登录页
NProgress.done(); NProgress.done();
} }
} }
......
...@@ -63,17 +63,17 @@ export const constantRoutes = [ ...@@ -63,17 +63,17 @@ export const constantRoutes = [
hidden: true, hidden: true,
}, },
,
{ // {
path: "/login", // path: "/login",
component: () => import("@/views/login"), // component: () => import("@/views/login"),
hidden: true, // hidden: true,
}, // },
{ // {
path: "/register", // path: "/register",
component: () => import("@/views/register"), // component: () => import("@/views/register"),
hidden: true, // hidden: true,
}, // },
{ {
path: "/404", path: "/404",
component: () => import("@/views/error/404"), component: () => import("@/views/error/404"),
...@@ -84,33 +84,33 @@ export const constantRoutes = [ ...@@ -84,33 +84,33 @@ export const constantRoutes = [
component: () => import("@/views/error/401"), component: () => import("@/views/error/401"),
hidden: true, hidden: true,
}, },
{ // {
path: "", // path: "",
component: Layout, // component: Layout,
redirect: "index", // redirect: "index",
children: [ // children: [
{ // {
path: "index", // path: "index",
component: () => import("@/views/index"), // component: () => import("@/views/index"),
name: "Index", // name: "Index",
meta: { title: "首页", icon: "dashboard", affix: true }, // meta: { title: "首页", icon: "dashboard", affix: true },
}, // },
], // ],
}, // },
{ // {
path: "/user", // path: "/user",
component: Layout, // component: Layout,
hidden: true, // hidden: true,
redirect: "noredirect", // redirect: "noredirect",
children: [ // children: [
{ // {
path: "profile", // path: "profile",
component: () => import("@/views/system/user/profile/index"), // component: () => import("@/views/system/user/profile/index"),
name: "Profile", // name: "Profile",
meta: { title: "个人中心", icon: "user" }, // meta: { title: "个人中心", icon: "user" },
}, // },
], // ],
}, // },
]; ];
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载
......
...@@ -93,7 +93,7 @@ service.interceptors.response.use(res => { ...@@ -93,7 +93,7 @@ service.interceptors.response.use(res => {
isRelogin.show = false; isRelogin.show = false;
}); });
} }
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') return Promise.reject('')
} else if (code === 500) { } else if (code === 500) {
Message({ message: msg, type: 'error' }) Message({ message: msg, type: 'error' })
return Promise.reject(new Error(msg)) return Promise.reject(new Error(msg))
......
<template> <template>
<div class="container"> <div class="container">
<el-row style="margin: 150px auto 100px ;"> <el-row style="margin: 150px auto 100px ;">
<img src="../../assets/images/background.png" alt="" style=" <img src="../../assets/images/background3.png" alt="" style="
height: 111px; height: 111px;
width: 877px; width: 877px;
/* background-size: cover; /* background-size: cover;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
object-fit: cover; */ object-fit: cover; */
" /> " />
...@@ -230,7 +230,7 @@ export default { ...@@ -230,7 +230,7 @@ export default {
// 获取列表数据 // 获取列表数据
getList() { getList() {
getListcx().then(res => { getListcx().then(res => {
console.log('res', res); // console.log('res', res);
this.collapseDataOuter = res.data; // 保存外层菜单数据 this.collapseDataOuter = res.data; // 保存外层菜单数据
// 如果有数据,设置默认的外层和内层菜单 // 如果有数据,设置默认的外层和内层菜单
...@@ -258,11 +258,11 @@ export default { ...@@ -258,11 +258,11 @@ export default {
// 设置当前选中的外层菜单 // 设置当前选中的外层菜单
setActiveOuter(cplx) { setActiveOuter(cplx) {
this.activeNameOuter = cplx; // 更新外层菜单 this.activeNameOuter = cplx; // 更新外层菜单
console.log('Outer menu set to:', this.activeNameOuter); // console.log('Outer menu set to:', this.activeNameOuter);
// 根据选中的外层菜单类型设置默认的内层菜单 // 根据选中的外层菜单类型设置默认的内层菜单
const firstInnerItem = this.collapseDataOuter.find(item => item.cplx === cplx); const firstInnerItem = this.collapseDataOuter.find(item => item.cplx === cplx);
console.log(firstInnerItem, 'firstInnerItem'); // console.log(firstInnerItem, 'firstInnerItem');
}, },
...@@ -271,7 +271,7 @@ export default { ...@@ -271,7 +271,7 @@ export default {
this.activeNameInner = `${innerName}-${contentName}`; // 更新内层菜单 this.activeNameInner = `${innerName}-${contentName}`; // 更新内层菜单
this.selectedCplx = cplx; // 更新选中的类别 this.selectedCplx = cplx; // 更新选中的类别
// 打印选中的信息 // 打印选中的信息
console.log(`选中的内容: 内层名称: ${innerName}, 内容名称: ${contentName}, 内容ID: ${contentId}, 类别: ${cplx}`); // console.log(`选中的内容: 内层名称: ${innerName}, 内容名称: ${contentName}, 内容ID: ${contentId}, 类别: ${cplx}`);
// 获取内容相关的数据 // 获取内容相关的数据
this.getListdt(contentId); this.getListdt(contentId);
...@@ -281,7 +281,7 @@ export default { ...@@ -281,7 +281,7 @@ export default {
this.activeNameInner = `${outerItemName}-${serviceName}`; // 更新内层菜单 this.activeNameInner = `${outerItemName}-${serviceName}`; // 更新内层菜单
this.selectedCplx = '服务类'; // 设置 cplx 为 '服务类' this.selectedCplx = '服务类'; // 设置 cplx 为 '服务类'
// 打印选中的信息 // 打印选中的信息
console.log(`选中的内容: 外层名称: ${outerItemName}, 服务名称: ${serviceName}, 服务ID: ${serviceId}, 类别: ${this.selectedCplx}`); // console.log(`选中的内容: 外层名称: ${outerItemName}, 服务名称: ${serviceName}, 服务ID: ${serviceId}, 类别: ${this.selectedCplx}`);
// 获取内容相关的数据 // 获取内容相关的数据
this.getListdt(serviceId); this.getListdt(serviceId);
...@@ -292,9 +292,9 @@ export default { ...@@ -292,9 +292,9 @@ export default {
setActiveInner(innerName, content = '', id = null) { setActiveInner(innerName, content = '', id = null) {
if (content) { if (content) {
this.activeNameInner = `${innerName}-${content}`; // 更新内层菜单 this.activeNameInner = `${innerName}-${content}`; // 更新内层菜单
console.log(this.activeNameInner, 'this.activeNameInner'); // console.log(this.activeNameInner, 'this.activeNameInner');
this.selectedId = id; // 更新选中项的ID this.selectedId = id; // 更新选中项的ID
console.log('activeNameInner updated to:', this.activeNameInner); // console.log('activeNameInner updated to:', this.activeNameInner);
this.getListdt(this.selectedId); // 获取内容数据 this.getListdt(this.selectedId); // 获取内容数据
} }
}, },
...@@ -302,7 +302,7 @@ export default { ...@@ -302,7 +302,7 @@ export default {
// 获取详细内容数据 // 获取详细内容数据
getListdt(id) { getListdt(id) {
getListdt(id).then(res => { getListdt(id).then(res => {
console.log('12222:', res.data.remark); // console.log('12222:', res.data.remark);
// 更新相关数据 // 更新相关数据
this.cpjj = res.data.cpjj; this.cpjj = res.data.cpjj;
this.gntd = res.data.gntd; this.gntd = res.data.gntd;
...@@ -327,13 +327,13 @@ export default { ...@@ -327,13 +327,13 @@ export default {
// 处理菜单变化 // 处理菜单变化
handleChange(val) { handleChange(val) {
console.log(val); // console.log(val);
}, },
// 处理点击事件 // 处理点击事件
handleClick(tab, event) { handleClick(tab, event) {
this.activeName = tab.name; // 更新活动名称 this.activeName = tab.name; // 更新活动名称
console.log(this.activeName, ' this.activeName'); // console.log(this.activeName, ' this.activeName');
}, },
}, },
}; };
...@@ -705,4 +705,4 @@ p { ...@@ -705,4 +705,4 @@ p {
color: #165bff; color: #165bff;
line-height: 26px; line-height: 26px;
} }
</style> </style>
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
/* background-size: cover; /* background-size: cover;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
object-fit: cover; */ object-fit: cover; */
" /> " />
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
methods: { methods: {
getList() { getList() {
getListcx().then(res => { getListcx().then(res => {
console.log('res', res); // console.log('res', res);
this.collapseDataOuter = res.data; // 保存外层菜单数据 this.collapseDataOuter = res.data; // 保存外层菜单数据
this.collapseDataOuter.forEach(outerItem => { this.collapseDataOuter.forEach(outerItem => {
this.defaultActiveKeys.push(outerItem.mc); this.defaultActiveKeys.push(outerItem.mc);
...@@ -187,9 +187,9 @@ export default { ...@@ -187,9 +187,9 @@ export default {
setActiveInner(innerName, content = '', id = null) { setActiveInner(innerName, content = '', id = null) {
if (content) { if (content) {
this.activeNameInner = `${innerName}-${content}`; // 更新内层菜单 this.activeNameInner = `${innerName}-${content}`; // 更新内层菜单
console.log(this.activeNameInner, 'this.activeNameInner'); // console.log(this.activeNameInner, 'this.activeNameInner');
this.selectedId = id; // 更新选中项的ID this.selectedId = id; // 更新选中项的ID
console.log('activeNameInner updated to:', this.activeNameInner); // console.log('activeNameInner updated to:', this.activeNameInner);
this.getListdt(this.selectedId); // 获取内容数据 this.getListdt(this.selectedId); // 获取内容数据
} }
}, },
...@@ -197,7 +197,7 @@ export default { ...@@ -197,7 +197,7 @@ export default {
// 假设你的getListdt接口是一个异步函数 // 假设你的getListdt接口是一个异步函数
getListdt(id) getListdt(id)
.then((res) => { .then((res) => {
console.log("12222:", res.data.remark); // console.log("12222:", res.data.remark);
this.cpjj = res.data.cpjj; this.cpjj = res.data.cpjj;
this.gntd = res.data.gntd; this.gntd = res.data.gntd;
this.yycx = res.data.yycx; this.yycx = res.data.yycx;
...@@ -218,11 +218,11 @@ export default { ...@@ -218,11 +218,11 @@ export default {
return this.activeNameInner.startsWith(innerName); // 判断是否为活动状态 return this.activeNameInner.startsWith(innerName); // 判断是否为活动状态
}, },
handleChange(val) { handleChange(val) {
console.log(val); // console.log(val);
}, },
handleClick(tab, event) { handleClick(tab, event) {
this.activeName = tab.name; // 确保更新activeName this.activeName = tab.name; // 确保更新activeName
console.log(this.activeName, " this.activeName"); // console.log(this.activeName, " this.activeName");
}, },
}, },
}; };
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/*background-size: cover; /*background-size: cover;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
object-fit: cover; */ object-fit: cover; */
" /> " />
...@@ -218,7 +218,7 @@ export default { ...@@ -218,7 +218,7 @@ export default {
getList() { getList() {
getListcx().then((res) => { getListcx().then((res) => {
console.log("res", res); // console.log("res", res);
this.collapseDataOuter = res.data; this.collapseDataOuter = res.data;
// 获取数据后,设置默认选中的第一个外层和内层菜单项 // 获取数据后,设置默认选中的第一个外层和内层菜单项
...@@ -249,7 +249,7 @@ export default { ...@@ -249,7 +249,7 @@ export default {
setActiveOuter(cplx) { setActiveOuter(cplx) {
this.activeNameOuter = cplx; this.activeNameOuter = cplx;
console.log("Outer menu set to:", this.activeNameOuter); // console.log("Outer menu set to:", this.activeNameOuter);
}, },
handleInnerClick(innerName, contentName, contentId) { handleInnerClick(innerName, contentName, contentId) {
this.activeNameInner = `${innerName}-${contentName}`; this.activeNameInner = `${innerName}-${contentName}`;
...@@ -265,9 +265,9 @@ export default { ...@@ -265,9 +265,9 @@ export default {
setActiveInner(innerName, content = "", id = null) { setActiveInner(innerName, content = "", id = null) {
if (content) { if (content) {
this.activeNameInner = `${innerName}-${content}`; this.activeNameInner = `${innerName}-${content}`;
console.log(this.activeNameInner, "this.activeNameInner"); // console.log(this.activeNameInner, "this.activeNameInner");
this.selectedId = id; // 更新选中项的ID this.selectedId = id; // 更新选中项的ID
console.log("activeNameInner updated to:", this.activeNameInner); // console.log("activeNameInner updated to:", this.activeNameInner);
this.getListdt(this.selectedId); // 获取内容数据 this.getListdt(this.selectedId); // 获取内容数据
} }
}, },
...@@ -275,7 +275,7 @@ export default { ...@@ -275,7 +275,7 @@ export default {
// 假设你的getListdt接口是一个异步函数 // 假设你的getListdt接口是一个异步函数
getListdt(id) getListdt(id)
.then((res) => { .then((res) => {
console.log("12222:", res.data.remark); // console.log("12222:", res.data.remark);
this.cpjj = res.data.cpjj; this.cpjj = res.data.cpjj;
this.gntd = res.data.gntd; this.gntd = res.data.gntd;
this.yycx = res.data.yycx; this.yycx = res.data.yycx;
...@@ -297,11 +297,11 @@ export default { ...@@ -297,11 +297,11 @@ export default {
return this.activeNameInner.startsWith(innerName); // 判断是否为活动状态 return this.activeNameInner.startsWith(innerName); // 判断是否为活动状态
}, },
handleChange(val) { handleChange(val) {
console.log(val); // console.log(val);
}, },
handleClick(tab, event) { handleClick(tab, event) {
this.activeName = tab.name; // 确保更新activeName this.activeName = tab.name; // 确保更新activeName
console.log(this.activeName, " this.activeName"); // console.log(this.activeName, " this.activeName");
}, },
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment