Browse Source

feat(index): 添加医生和患者家属角色的页面跳转逻辑

- 为角色2(医生)添加跳转至医生首页的逻辑
- 为角色4(患者家属)添加跳转至患者家属首页的逻辑
- 使用uni.reLaunch实现页面重定向
- 添加相应的日志输出便于调试跟踪
mcbaiyun 1 month ago
parent
commit
76962b1a72
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/pages/public/index/index.vue

+ 12 - 0
src/pages/public/index/index.vue

@@ -52,6 +52,18 @@ onShow(() => {
       uni.reLaunch({ url: '/pages/patient/index/index' })
       return
     }
+    // 为角色2(医生)添加跳转逻辑
+    else if (r === 2) {
+      console.log('[index] redirecting to doctor index, role=', r)
+      uni.reLaunch({ url: '/pages/doctor/index/index' })
+      return
+    }
+    // 为角色4(患者家属)添加跳转逻辑
+    else if (r === 4) {
+      console.log('[index] redirecting to patient family index, role=', r)
+      uni.reLaunch({ url: '/pages/patient-family/index/index' })
+      return
+    }
   } catch (err) {
     console.error('检查登录态时出错:', err)
   }