退出登录的时候报服务器错误的toast

This commit is contained in:
fengshuo
2021-10-25 15:03:00 +08:00
parent ed8b1c4c34
commit 466a6cacd6
2 changed files with 4 additions and 1 deletions

View File

@@ -73,6 +73,9 @@
/// ///
- (void)getUserInfo { - (void)getUserInfo {
NSString * uid = [[AccountInfoStorage instance] getUid]; NSString * uid = [[AccountInfoStorage instance] getUid];
if (uid == nil) {
return;
}
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data]; UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data];
[[self getView] onGetUserInfoSuccess:infoModel]; [[self getView] onGetUserInfoSuccess:infoModel];

View File

@@ -99,9 +99,9 @@
- (void)logoutCurrentAccount { - (void)logoutCurrentAccount {
AccountModel * account = [[AccountInfoStorage instance] accountModel]; AccountModel * account = [[AccountInfoStorage instance] accountModel];
[Api logoutCurrentAccount:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api logoutCurrentAccount:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[self logout];
[[self getView] logoutCurrentAccountSuccess]; [[self getView] logoutCurrentAccountSuccess];
}] access_token:account.access_token]; }] access_token:account.access_token];
[self logout];
} }