|
|
|
|
export default {
|
|
|
|
|
token: state => state.app.token,
|
|
|
|
|
isLogin: state => !!state.app.token,
|
|
|
|
|
backgroundColor: state => state.app.backgroundColor,
|
|
|
|
|
userInfo: state => state.app.userInfo || {},
|
|
|
|
|
uid: state => state.app.uid,
|
|
|
|
|
homeActive: state => state.app.homeActive,
|
|
|
|
|
home: state => state.app.home,
|
|
|
|
|
chatUrl: state => state.app.chatUrl,
|
|
|
|
|
systemPlatform: state => state.app.systemPlatform,
|
|
|
|
|
productType: state => state.app.productType,
|
|
|
|
|
// 管理员账号信息
|
|
|
|
|
adminInfo: state => state.app.adminInfo || null,
|
|
|
|
|
// 管理员权限列表
|
|
|
|
|
permissions: state => state.app.adminInfo?.permissionsList || [],
|
|
|
|
|
// 管理员角色列表
|
|
|
|
|
roles: state => state.app.adminInfo?.roles ? [state.app.adminInfo.roles] : [],
|
|
|
|
|
// 是否超级管理员
|
|
|
|
|
isSuperAdmin: state => {
|
|
|
|
|
const permissions = state.app.adminInfo?.permissionsList || [];
|
|
|
|
|
return permissions.includes('*:*:*');
|
|
|
|
|
},
|
|
|
|
|
// 字典相关getter
|
|
|
|
|
dict: state => state.dict.dict,
|
|
|
|
|
dictData: state => state.dict.dictData,
|
|
|
|
|
// 根据字典类型获取字典数据
|
|
|
|
|
dictByType: state => type => state.dict.dictData[type] || []
|
|
|
|
|
};
|