feat: 添加账号删除功能

This commit is contained in:
qzl
2026-04-10 10:40:44 +08:00
parent 17a1303f00
commit 46513829cd
30 changed files with 1510 additions and 664 deletions
+7 -1
View File
@@ -31,7 +31,13 @@ class ApiClient {
final authHeader =
error.requestOptions.headers['Authorization'] as String?;
final hasAuthHeader = authHeader != null && authHeader.isNotEmpty;
if (status == 401 && hasAuthHeader && onUnauthorized != null) {
final isLogoutEndpoint =
error.requestOptions.method.toUpperCase() == 'DELETE' &&
error.requestOptions.path == '/api/v1/auth/sessions';
if (status == 401 &&
hasAuthHeader &&
onUnauthorized != null &&
!isLogoutEndpoint) {
await onUnauthorized();
}
handler.next(error);