设置不同角色 显示

This commit is contained in:
浅念
2026-01-19 14:47:43 +08:00
parent 7b516404ce
commit 322530a658
18 changed files with 1697 additions and 1063 deletions
+10
View File
@@ -102,6 +102,16 @@
uni.setStorageSync('token', token)
// ===== 角色/权限:用于动态 TabBar =====
// 兼容多种后端返回结构:role / user.role / userInfo.role
const role = res?.data?.data?.role
if (role) {
// 1) 给 tabbar.js 直接读取
uni.setStorageSync('userRole', role)
// 通知自定义 TabBar 立刻刷新
uni.$emit && uni.$emit('userRoleChanged')
}
this.title = '登录成功'
this.desc = '正在进入页面'