fix(mp): 导航/请求健壮性 — reLaunch 去重 + 失败降级

- navigateToLogin 添加去重 + reLaunch 失败降级 redirectTo
- request.ts safeReLaunch 添加目标页检测 + 失败降级
- 退出登录 reLaunch 失败降级 redirectTo
- DoctorTabBar / 首页医生端跳转 reLaunch 失败降级
- 网络恢复时正确清理 toast 状态和定时器
This commit is contained in:
iven
2026-05-25 13:45:12 +08:00
parent 485b9bb926
commit 1a376a255d
5 changed files with 39 additions and 5 deletions

View File

@@ -293,6 +293,9 @@ export const useAuthStore = create<AuthState>((set, get) => ({
});
resetAllStores();
set({ user: null, roles: [], currentPatient: null, patients: [] });
Taro.reLaunch({ url: '/pages/index/index' });
Taro.reLaunch({ url: '/pages/index/index' }).catch((err) => {
console.warn('[auth] reLaunch after logout failed:', err);
Taro.redirectTo({ url: '/pages/index/index' }).catch(() => {});
});
},
}));