This commit is contained in:
hrx 2025-11-19 17:28:25 +08:00
parent efbbf63d7e
commit be99c8618d
3 changed files with 18 additions and 16 deletions

View File

@ -62,8 +62,8 @@ function addUserRoutes(routes, userType, orgType, userRoles = []) {
const userRoutes = [];
// 如果是普通用户org_type为2或userType为user添加订单管理和资源管理路由
if (userType === 'user' || orgType == 2 || orgType == 3 ) {
// 修复:包含 orgType 为 2 和 3 的情况(公司客户和个人客户)
if (userType === 'user' || orgType == 2 || orgType == 3) {
const orderManagementRoute = routes.find(route => route.path === "/orderManagement");
const resourceManagementRoute = routes.find(route => route.path === "/resourceManagement");
@ -160,7 +160,8 @@ const actions = {
console.log("用户类型:", userType, "orgType:", orgType);
if (params.user && params.user.includes("admin") && orgType != 2&3) {
// 修复:包含 orgType 为 2 和 3 的情况
if (params.user && params.user.includes("admin") && orgType != 2 && orgType != 3) {
// 管理员:只显示超级管理员菜单
accessedRoutes = asyncRoutes.filter(item => item.path === '/superAdministrator');
} else {

View File

@ -128,11 +128,10 @@ const actions = {
const {data, org_type} = response;
commit("SET_USER", username);
// 新增:根据 org_type 设置用户类型和角色
// org_type 为 2 表示客户,其他为管理员
const userType = org_type == 2 ? 'user' : 'admin';
// 修复org_type 为 2 或 3 都表示客户
const userType = (org_type == 2 || org_type == 3) ? 'user' : 'admin';
// 设置用户角色 - 如果是客户,则添加'客户'角色
const userRoles = org_type == 2 ? ['客户'] : ['管理员'];
const userRoles = (org_type == 2 || org_type == 3) ? ['客户'] : ['管理员'];
commit("SET_USER_TYPE", userType);
// 确保 org_type 不为 undefined
@ -284,4 +283,3 @@ export default {
mutations,
actions,
};

View File

@ -129,7 +129,8 @@ export default Vue.extend({
},
viewList: [],
navList: [],
mybalance: 0,
// data mybalance
// mybalance: 0, //
todoList: [
{ name: '待支付', count: 0 },
{ name: '待续费', count: 0 },
@ -142,7 +143,8 @@ export default Vue.extend({
}
},
created() {
this.initMybalance();
// initMybalance 使 computed mybalance
// this.initMybalance(); //
this.getUnreadMsgCount();
this.fetchTodoCount();
},
@ -185,12 +187,13 @@ export default Vue.extend({
const iconIndex = index % this.navIcons.length;
return this.navIcons[iconIndex];
},
async initMybalance() {
const res = await editReachargelogAPI()
if (res.status) {
this.mybalance = res.data
}
},
// initMybalance 使 computed mybalance
// async initMybalance() { //
// const res = await editReachargelogAPI()
// if (res.status) {
// this.mybalance = res.data
// }
// },
async getUnreadMsgCount() {
try {
const res = await getUnreadmsgAPI();