feat(navigation): add external entry routing
This commit is contained in:
@@ -101,6 +101,18 @@ export class AuthStorage implements IAuthStorage {
|
||||
return SpAsyncUtil.remove(StorageKeys.facebookId);
|
||||
}
|
||||
|
||||
// ---- facebook app id ----
|
||||
|
||||
getFacebookAppId(): Promise<ResultT<string | null>> {
|
||||
return SpAsyncUtil.getString(StorageKeys.facebookAppId);
|
||||
}
|
||||
setFacebookAppId(id: string): Promise<ResultT<void>> {
|
||||
return SpAsyncUtil.setString(StorageKeys.facebookAppId, id);
|
||||
}
|
||||
clearFacebookAppId(): Promise<ResultT<void>> {
|
||||
return SpAsyncUtil.remove(StorageKeys.facebookAppId);
|
||||
}
|
||||
|
||||
// ---- bulk clear ----
|
||||
|
||||
async clearBusinessAuthData(): Promise<ResultT<void>> {
|
||||
@@ -110,6 +122,8 @@ export class AuthStorage implements IAuthStorage {
|
||||
if (!r2.success) return r2;
|
||||
const r3 = await this.clearFacebookId();
|
||||
if (!r3.success) return r3;
|
||||
const r4 = await this.clearFacebookAppId();
|
||||
if (!r4.success) return r4;
|
||||
return this.clearLoginProvider();
|
||||
}
|
||||
|
||||
@@ -122,7 +136,9 @@ export class AuthStorage implements IAuthStorage {
|
||||
if (!r3.success) return r3;
|
||||
const r4 = await this.clearRefreshToken();
|
||||
if (!r4.success) return r4;
|
||||
return this.clearFacebookId();
|
||||
const r5 = await this.clearFacebookId();
|
||||
if (!r5.success) return r5;
|
||||
return this.clearFacebookAppId();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* IAuthStorage 接口
|
||||
*
|
||||
* 对齐 Dart 端 `IAuthStorage`(lib/data/services/storage/iauth_storage.dart):
|
||||
* - loginToken / loginProvider / guestToken / deviceId / refreshToken / facebookId 字段的 CRUD
|
||||
* - loginToken / loginProvider / guestToken / deviceId / refreshToken / facebookId / facebookAppId 字段的 CRUD
|
||||
* - `clearAuthData()` 批量清空登录态
|
||||
* - `clearBusinessAuthData()` 仅清空真实用户登录态,保留 guest token / deviceId
|
||||
* - 所有方法返回 `Promise<Result<T>>`,与 Dart `Future<Result<T>>` 对齐
|
||||
@@ -39,6 +39,10 @@ export interface IAuthStorage {
|
||||
setFacebookId(id: string): Promise<Result<void>>;
|
||||
clearFacebookId(): Promise<Result<void>>;
|
||||
|
||||
getFacebookAppId(): Promise<Result<string | null>>;
|
||||
setFacebookAppId(id: string): Promise<Result<void>>;
|
||||
clearFacebookAppId(): Promise<Result<void>>;
|
||||
|
||||
clearBusinessAuthData(): Promise<Result<void>>;
|
||||
clearAuthData(): Promise<Result<void>>;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ export const StorageKeys = {
|
||||
deviceId: "device_id",
|
||||
refreshToken: "refresh_token",
|
||||
facebookId: "facebook_id",
|
||||
facebookAppId: "facebook_app_id",
|
||||
|
||||
// user
|
||||
user: "user",
|
||||
|
||||
Reference in New Issue
Block a user