diff --git a/apps/ai-game-creator-shell/src-tauri/src/auth_error.rs b/apps/ai-game-creator-shell/src-tauri/src/auth_error.rs index a64308628..172a7372c 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/auth_error.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/auth_error.rs @@ -102,20 +102,6 @@ impl ClientAuthError { Self::SessionAuthorityRejected { .. } | Self::PermissionDenied { .. } ) } - - /// 登录态投影里 `errorKind` 的取值:只描述"哪一类失败",不参与任何前端分支。 - pub(crate) fn error_kind(&self) -> &'static str { - match self { - Self::AuthNetworkUnavailable { .. } => "network", - Self::AuthServiceUnavailable { .. } | Self::UnexpectedRejection { .. } => "service", - Self::AuthResponseMalformed { .. } => "response", - Self::ClientSessionPersistFailed { .. } => "storage", - Self::RuntimeSessionInstallFailed { .. } | Self::AuthClientInitFailed { .. } => { - "runtime" - } - _ => "auth", - } - } } impl fmt::Display for ClientAuthError { diff --git a/apps/ai-game-creator-shell/src-tauri/src/auth_session.rs b/apps/ai-game-creator-shell/src-tauri/src/auth_session.rs index a1b76d1a9..c0f247999 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/auth_session.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/auth_session.rs @@ -49,9 +49,6 @@ pub(crate) struct ClientAuthStateView { pub(crate) user: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub(crate) api_base_url: Option, - /// 失败分类:`network` / `service` / `response` / `storage` / `runtime` / `auth`;成功或未登录时为 `None`。 - #[serde(default, skip_serializing_if = "Option::is_none")] - pub(crate) error_kind: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub(crate) error_message: Option, } @@ -785,7 +782,6 @@ fn auth_state_view( status: status.to_string(), user, api_base_url, - error_kind: None, error_message: None, } } @@ -1045,7 +1041,6 @@ pub(crate) async fn read_client_auth_state( status: "unavailable".to_string(), user: None, api_base_url: Some(session.api_base_url), - error_kind: Some("network".to_string()), error_message: refresh.error_message, }), }, @@ -1053,7 +1048,6 @@ pub(crate) async fn read_client_auth_state( status: "unavailable".to_string(), user: None, api_base_url: Some(session.api_base_url), - error_kind: Some(error.error_kind().to_string()), error_message: Some(error.message().to_string()), }), } @@ -1472,7 +1466,6 @@ mod tests { wechat_account: None, }), api_base_url: Some(DEVELOPMENT_ORIGIN.to_string()), - error_kind: None, error_message: None, }; let serialized = serde_json::to_string(&view).expect("serialize auth state"); diff --git a/apps/ai-game-creator-shell/src/services/clientAuth.ts b/apps/ai-game-creator-shell/src/services/clientAuth.ts index 04c60af19..183730522 100644 --- a/apps/ai-game-creator-shell/src/services/clientAuth.ts +++ b/apps/ai-game-creator-shell/src/services/clientAuth.ts @@ -93,7 +93,6 @@ type RustAuthStateView = { status?: string; user?: AuthUser | null; apiBaseUrl?: string | null; - errorKind?: string | null; errorMessage?: string | null; };