设置不同角色 显示
This commit is contained in:
@@ -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 = '正在进入页面'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user