From 5c273c3963566b35987a76a762af9def1e8480be Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Wed, 11 Feb 2026 21:09:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Shared/Localization/en.lproj/Localizable.strings | 4 ++++ Shared/Localization/zh-Hans.lproj/Localizable.strings | 4 ++++ keyBoard/Class/Home/VM/KBHomeVM.m | 1 + keyBoard/Class/Me/V/KBGenderPickerPopView.m | 4 ++-- keyBoard/Class/Network/KBNetworkManager.m | 5 ++++- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Shared/Localization/en.lproj/Localizable.strings b/Shared/Localization/en.lproj/Localizable.strings index 0db67e7..d80c657 100644 --- a/Shared/Localization/en.lproj/Localizable.strings +++ b/Shared/Localization/en.lproj/Localizable.strings @@ -140,6 +140,10 @@ "Nickname" = "Nickname"; "Gender" = "Gender"; "User ID" = "User ID"; +"Modify Gender" = "Modify Gender"; +"Male" = "Male"; +"Female" = "Female"; +"The Third Gender" = "The Third Gender"; " Paste Ta's Words" = " Paste Ta's Words"; diff --git a/Shared/Localization/zh-Hans.lproj/Localizable.strings b/Shared/Localization/zh-Hans.lproj/Localizable.strings index f8b369d..b5da1b0 100644 --- a/Shared/Localization/zh-Hans.lproj/Localizable.strings +++ b/Shared/Localization/zh-Hans.lproj/Localizable.strings @@ -142,6 +142,10 @@ "Nickname" = "用户名"; "Gender" = "性别"; "User ID" = "用户ID"; +"Modify Gender" = "修改性别"; +"Male" = "男"; +"Female" = "女"; +"The Third Gender" = "第三性别"; " Paste Ta's Words" = " 粘贴TA的话"; diff --git a/keyBoard/Class/Home/VM/KBHomeVM.m b/keyBoard/Class/Home/VM/KBHomeVM.m index 2ce50e4..7da2ecf 100644 --- a/keyBoard/Class/Home/VM/KBHomeVM.m +++ b/keyBoard/Class/Home/VM/KBHomeVM.m @@ -212,6 +212,7 @@ // } // }]; [[KBNetworkManager shared] POST:API_CHARACTER_ADD_USER_CHARACTER jsonBody:params headers:nil autoShowBusinessError:true completion:^(NSDictionary * _Nullable json, NSURLResponse * _Nullable response, NSError * _Nullable error) { + [KBHUD dismiss]; if (!error) { [self refreshUserCharacterCacheForKeyboard]; } diff --git a/keyBoard/Class/Me/V/KBGenderPickerPopView.m b/keyBoard/Class/Me/V/KBGenderPickerPopView.m index 29aec0c..da4d5da 100644 --- a/keyBoard/Class/Me/V/KBGenderPickerPopView.m +++ b/keyBoard/Class/Me/V/KBGenderPickerPopView.m @@ -182,7 +182,7 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [UILabel new]; - _titleLabel.text = @"Modify Gender"; + _titleLabel.text = KBLocalized(@"Modify Gender"); _titleLabel.textColor = [UIColor blackColor]; _titleLabel.font = [KBFont medium:16]; } @@ -226,7 +226,7 @@ - (UIButton *)saveButton { if (!_saveButton) { _saveButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_saveButton setTitle:@"Save" forState:UIControlStateNormal]; + [_saveButton setTitle:KBLocalized(@"Save") forState:UIControlStateNormal]; [_saveButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; _saveButton.titleLabel.font = [KBFont medium:16]; _saveButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0]; diff --git a/keyBoard/Class/Network/KBNetworkManager.m b/keyBoard/Class/Network/KBNetworkManager.m index d123657..5c927dd 100644 --- a/keyBoard/Class/Network/KBNetworkManager.m +++ b/keyBoard/Class/Network/KBNetworkManager.m @@ -576,8 +576,11 @@ autoShowBusinessError:YES if (!_manager) { NSURLSessionConfiguration *cfg = [NSURLSessionConfiguration ephemeralSessionConfiguration]; cfg.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData; + cfg.timeoutIntervalForRequest = self.timeout; // 单次请求超时 + cfg.timeoutIntervalForResource = 60.0; // 整个资源传输最大 60s + // 不在会话级别设置超时,避免与 per-request 的 serializer.timeoutInterval 产生不一致 - if (@available(iOS 11.0, *)) { cfg.waitsForConnectivity = YES; } +// if (@available(iOS 11.0, *)) { cfg.waitsForConnectivity = YES; } _manager = [[AFHTTPSessionManager alloc] initWithBaseURL:nil sessionConfiguration:cfg]; // 默认不使用 JSON 解析器,保持原生数据,再按需解析 _manager.responseSerializer = [AFHTTPResponseSerializer serializer];