Commit e9980d32 by tyk

代码更新

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