32 lines
854 B
TypeScript
32 lines
854 B
TypeScript
/**
|
||
* Auth 状态机:State 形状 + 初始值
|
||
*/
|
||
import type { AuthMode } from "@/models/auth/auth-mode";
|
||
import type { AuthPanelMode } from "@/models/auth/auth-panel-mode";
|
||
import type { LoginStatus } from "@/models/auth/login-status";
|
||
|
||
export interface AuthState {
|
||
/** 当前面板模式(Facebook / Email) */
|
||
authPanelMode: AuthPanelMode;
|
||
/** 内部登录模式(login / register) */
|
||
authMode: AuthMode;
|
||
email: string;
|
||
password: string;
|
||
username: string;
|
||
confirmPassword: string;
|
||
errorMessage: string | null;
|
||
/** 当前登录状态(未登录 / 游客 / OAuth / 邮箱) */
|
||
loginStatus: LoginStatus;
|
||
}
|
||
|
||
export const initialState: AuthState = {
|
||
authPanelMode: "facebook",
|
||
authMode: "login",
|
||
email: "",
|
||
password: "",
|
||
username: "",
|
||
confirmPassword: "",
|
||
errorMessage: null,
|
||
loginStatus: "notLoggedIn",
|
||
};
|