fix(mobile): fail closed on org role lookup errors

This commit is contained in:
2026-07-14 03:32:44 +08:00
parent f9bce8f0ef
commit 5e3dfd0085
4 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -39,7 +39,9 @@ export const hydrateMobileRole = async (): Promise<RoleKey> => {
uni.setStorageSync(roleKey, role);
return role;
} catch {
return (uni.getStorageSync(roleKey) === 'supervisor' ? 'supervisor' : 'user') as RoleKey;
// ponytail: role lookup failure fails closed; never reuse a stale supervisor cache.
uni.removeStorageSync(roleKey);
return 'user';
}
};