Compare commits

..

No commits in common. "1147e353102d7068b0a6602ed1dedb96ce86aefd" and "791dca13d3fd38af9956e7566e63c56c31ed9a39" have entirely different histories.

3 changed files with 16 additions and 18 deletions

View File

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

View File

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

View File

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