22 lines
653 B
TypeScript
22 lines
653 B
TypeScript
/**
|
||
* Auth 状态机:State 形状 + 初始值
|
||
*/
|
||
import type { AuthPanelMode, LoginStatus } from "@/data/dto/auth";
|
||
|
||
export interface AuthState {
|
||
/** 当前面板模式(Facebook / Email) */
|
||
authPanelMode: AuthPanelMode;
|
||
errorMessage: string | null;
|
||
/** 当前登录状态(未登录 / 游客 / OAuth / 邮箱)—— 下游同步器监听此字段的双向变化 */
|
||
loginStatus: LoginStatus;
|
||
/** 启动时的本地登录态恢复是否已经完成 */
|
||
hasInitialized: boolean;
|
||
}
|
||
|
||
export const initialState: AuthState = {
|
||
authPanelMode: "facebook",
|
||
errorMessage: null,
|
||
loginStatus: "notLoggedIn",
|
||
hasInitialized: false,
|
||
};
|