commit
1147e35310
@ -62,8 +62,8 @@ function addUserRoutes(routes, userType, orgType, userRoles = []) {
|
|||||||
|
|
||||||
const userRoutes = [];
|
const userRoutes = [];
|
||||||
|
|
||||||
// 如果是普通用户(org_type为2或userType为user),添加订单管理和资源管理路由
|
// 修复:包含 orgType 为 2 和 3 的情况(公司客户和个人客户)
|
||||||
if (userType === 'user' || orgType == 2) {
|
if (userType === 'user' || orgType == 2 || orgType == 3) {
|
||||||
const orderManagementRoute = routes.find(route => route.path === "/orderManagement");
|
const orderManagementRoute = routes.find(route => route.path === "/orderManagement");
|
||||||
const resourceManagementRoute = routes.find(route => route.path === "/resourceManagement");
|
const resourceManagementRoute = routes.find(route => route.path === "/resourceManagement");
|
||||||
|
|
||||||
@ -160,7 +160,8 @@ const actions = {
|
|||||||
|
|
||||||
console.log("用户类型:", userType, "orgType:", orgType);
|
console.log("用户类型:", userType, "orgType:", orgType);
|
||||||
|
|
||||||
if (params.user && params.user.includes("admin") && orgType != 2) {
|
// 修复:包含 orgType 为 2 和 3 的情况
|
||||||
|
if (params.user && params.user.includes("admin") && orgType != 2 && orgType != 3) {
|
||||||
// 管理员:只显示超级管理员菜单
|
// 管理员:只显示超级管理员菜单
|
||||||
accessedRoutes = asyncRoutes.filter(item => item.path === '/superAdministrator');
|
accessedRoutes = asyncRoutes.filter(item => item.path === '/superAdministrator');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -128,11 +128,10 @@ const actions = {
|
|||||||
const {data, org_type} = response;
|
const {data, org_type} = response;
|
||||||
commit("SET_USER", username);
|
commit("SET_USER", username);
|
||||||
|
|
||||||
// 新增:根据 org_type 设置用户类型和角色
|
// 修复:org_type 为 2 或 3 都表示客户
|
||||||
// org_type 为 2 表示客户,其他为管理员
|
const userType = (org_type == 2 || org_type == 3) ? 'user' : 'admin';
|
||||||
const userType = org_type == 2 ? 'user' : 'admin';
|
|
||||||
// 设置用户角色 - 如果是客户,则添加'客户'角色
|
// 设置用户角色 - 如果是客户,则添加'客户'角色
|
||||||
const userRoles = org_type == 2 ? ['客户'] : ['管理员'];
|
const userRoles = (org_type == 2 || org_type == 3) ? ['客户'] : ['管理员'];
|
||||||
|
|
||||||
commit("SET_USER_TYPE", userType);
|
commit("SET_USER_TYPE", userType);
|
||||||
// 确保 org_type 不为 undefined
|
// 确保 org_type 不为 undefined
|
||||||
@ -284,4 +283,3 @@ export default {
|
|||||||
mutations,
|
mutations,
|
||||||
actions,
|
actions,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -129,7 +129,8 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
viewList: [],
|
viewList: [],
|
||||||
navList: [],
|
navList: [],
|
||||||
mybalance: 0,
|
// 移除 data 中的 mybalance 定义
|
||||||
|
// mybalance: 0, // ❌ 删除这一行
|
||||||
todoList: [
|
todoList: [
|
||||||
{ name: '待支付', count: 0 },
|
{ name: '待支付', count: 0 },
|
||||||
{ name: '待续费', count: 0 },
|
{ name: '待续费', count: 0 },
|
||||||
@ -142,7 +143,8 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initMybalance();
|
// 移除 initMybalance 调用,因为现在使用 computed 的 mybalance
|
||||||
|
// this.initMybalance(); // ❌ 删除这一行
|
||||||
this.getUnreadMsgCount();
|
this.getUnreadMsgCount();
|
||||||
this.fetchTodoCount();
|
this.fetchTodoCount();
|
||||||
},
|
},
|
||||||
@ -185,12 +187,13 @@ export default Vue.extend({
|
|||||||
const iconIndex = index % this.navIcons.length;
|
const iconIndex = index % this.navIcons.length;
|
||||||
return this.navIcons[iconIndex];
|
return this.navIcons[iconIndex];
|
||||||
},
|
},
|
||||||
async initMybalance() {
|
// 移除 initMybalance 方法,因为现在使用 computed 的 mybalance
|
||||||
const res = await editReachargelogAPI()
|
// async initMybalance() { // ❌ 删除这个方法
|
||||||
if (res.status) {
|
// const res = await editReachargelogAPI()
|
||||||
this.mybalance = res.data
|
// if (res.status) {
|
||||||
}
|
// this.mybalance = res.data
|
||||||
},
|
// }
|
||||||
|
// },
|
||||||
async getUnreadMsgCount() {
|
async getUnreadMsgCount() {
|
||||||
try {
|
try {
|
||||||
const res = await getUnreadmsgAPI();
|
const res = await getUnreadmsgAPI();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user