首页增加用户信息/绑定手机号检测
This commit is contained in:
@@ -55,6 +55,10 @@
|
||||
18E7B26626E8D4510064BC9B /* Toast.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 18E7B24726E8D43C0064BC9B /* Toast.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
18E7B26926E8D5D60064BC9B /* XCCurrentVCStackManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E7B26726E8D5D60064BC9B /* XCCurrentVCStackManager.m */; };
|
||||
18E7B29026EA0E6B0064BC9B /* FlutterBoost+Xplan.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E7B28F26EA0E6B0064BC9B /* FlutterBoost+Xplan.m */; };
|
||||
18E7B31826F097E00064BC9B /* UserInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E7B31726F097E00064BC9B /* UserInfoModel.m */; };
|
||||
18E7B31B26F0982E0064BC9B /* UserExpand.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E7B31A26F0982E0064BC9B /* UserExpand.m */; };
|
||||
18E7B31E26F0984C0064BC9B /* UserLevelVo.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E7B31D26F0984C0064BC9B /* UserLevelVo.m */; };
|
||||
18E7B32126F098650064BC9B /* UserInfoSkillVo.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E7B32026F098650064BC9B /* UserInfoSkillVo.m */; };
|
||||
73FFADDC93E195344047A2EC /* Pods_xplan_ios.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACF623970097D653132D69A /* Pods_xplan_ios.framework */; };
|
||||
9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0E1C5826E77022005D4442 /* BaseNavigationController.m */; };
|
||||
E81C278C26EAFAF60031E639 /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C278926EAFAF60031E639 /* Base64.m */; };
|
||||
@@ -177,6 +181,14 @@
|
||||
18E7B26826E8D5D60064BC9B /* XCCurrentVCStackManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCurrentVCStackManager.h; sourceTree = "<group>"; };
|
||||
18E7B28E26EA0E6B0064BC9B /* FlutterBoost+Xplan.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FlutterBoost+Xplan.h"; sourceTree = "<group>"; };
|
||||
18E7B28F26EA0E6B0064BC9B /* FlutterBoost+Xplan.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "FlutterBoost+Xplan.m"; sourceTree = "<group>"; };
|
||||
18E7B31626F097E00064BC9B /* UserInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserInfoModel.h; sourceTree = "<group>"; };
|
||||
18E7B31726F097E00064BC9B /* UserInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserInfoModel.m; sourceTree = "<group>"; };
|
||||
18E7B31926F0982E0064BC9B /* UserExpand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserExpand.h; sourceTree = "<group>"; };
|
||||
18E7B31A26F0982E0064BC9B /* UserExpand.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserExpand.m; sourceTree = "<group>"; };
|
||||
18E7B31C26F0984C0064BC9B /* UserLevelVo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserLevelVo.h; sourceTree = "<group>"; };
|
||||
18E7B31D26F0984C0064BC9B /* UserLevelVo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserLevelVo.m; sourceTree = "<group>"; };
|
||||
18E7B31F26F098650064BC9B /* UserInfoSkillVo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserInfoSkillVo.h; sourceTree = "<group>"; };
|
||||
18E7B32026F098650064BC9B /* UserInfoSkillVo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserInfoSkillVo.m; sourceTree = "<group>"; };
|
||||
7DB00EC07F1D0ADFF900B38D /* Pods-xplan-ios.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-xplan-ios.debug.xcconfig"; path = "Target Support Files/Pods-xplan-ios/Pods-xplan-ios.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9B0E1C5726E77022005D4442 /* BaseNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseNavigationController.h; sourceTree = "<group>"; };
|
||||
9B0E1C5826E77022005D4442 /* BaseNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseNavigationController.m; sourceTree = "<group>"; };
|
||||
@@ -331,16 +343,26 @@
|
||||
189DD56026DE456100AB55B1 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8B825B526E9A7D8009E8E9F /* BaseObject.h */,
|
||||
E8B825B626E9A7D8009E8E9F /* BaseObject.m */,
|
||||
187EEEDA26E89B32002833B2 /* BaseModel.h */,
|
||||
187EEEDB26E89B32002833B2 /* BaseModel.m */,
|
||||
187EEEDF26E89BFB002833B2 /* AccountModel.h */,
|
||||
187EEEE026E89BFB002833B2 /* AccountModel.m */,
|
||||
E8B825BD26E9E57D009E8E9F /* LoginTicketInfo.h */,
|
||||
E8B825BE26E9E57D009E8E9F /* LoginTicketInfo.m */,
|
||||
187EEEEF26E89FE8002833B2 /* AccountInfoStorage.h */,
|
||||
187EEEEE26E89FE8002833B2 /* AccountInfoStorage.m */,
|
||||
187EEEFD26E8A82C002833B2 /* NSObject+AutoCoding.h */,
|
||||
187EEEFC26E8A82C002833B2 /* NSObject+AutoCoding.m */,
|
||||
E8B825B526E9A7D8009E8E9F /* BaseObject.h */,
|
||||
E8B825B626E9A7D8009E8E9F /* BaseObject.m */,
|
||||
18E7B31626F097E00064BC9B /* UserInfoModel.h */,
|
||||
18E7B31726F097E00064BC9B /* UserInfoModel.m */,
|
||||
18E7B31926F0982E0064BC9B /* UserExpand.h */,
|
||||
18E7B31A26F0982E0064BC9B /* UserExpand.m */,
|
||||
18E7B31C26F0984C0064BC9B /* UserLevelVo.h */,
|
||||
18E7B31D26F0984C0064BC9B /* UserLevelVo.m */,
|
||||
18E7B31F26F098650064BC9B /* UserInfoSkillVo.h */,
|
||||
18E7B32026F098650064BC9B /* UserInfoSkillVo.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -624,8 +646,6 @@
|
||||
E8B825BC26E9E520009E8E9F /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E8B825BD26E9E57D009E8E9F /* LoginTicketInfo.h */,
|
||||
E8B825BE26E9E57D009E8E9F /* LoginTicketInfo.m */,
|
||||
E81C27A926EF2D920031E639 /* ThirdUserInfo.h */,
|
||||
E81C27AA26EF2D920031E639 /* ThirdUserInfo.m */,
|
||||
);
|
||||
@@ -781,6 +801,8 @@
|
||||
189DD74A26E21D8400AB55B1 /* SSKeychain.m in Sources */,
|
||||
E81C27AE26EF39AB0031E639 /* AppDelegate+ThirdConfig.m in Sources */,
|
||||
E8B825D026EA3825009E8E9F /* LoginPasswordViewController.m in Sources */,
|
||||
18E7B31826F097E00064BC9B /* UserInfoModel.m in Sources */,
|
||||
18E7B32126F098650064BC9B /* UserInfoSkillVo.m in Sources */,
|
||||
189DD68426E1FDBB00AB55B1 /* XCHUDTool.m in Sources */,
|
||||
189DD73F26E21C3F00AB55B1 /* YYUtility+Carrier.m in Sources */,
|
||||
18E7B26926E8D5D60064BC9B /* XCCurrentVCStackManager.m in Sources */,
|
||||
@@ -792,6 +814,8 @@
|
||||
E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */,
|
||||
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,
|
||||
189DD67E26E1FD8900AB55B1 /* UIImage+Utils.m in Sources */,
|
||||
18E7B31E26F0984C0064BC9B /* UserLevelVo.m in Sources */,
|
||||
18E7B31B26F0982E0064BC9B /* UserExpand.m in Sources */,
|
||||
E8B825CD26EA18C8009E8E9F /* ThemeColor.m in Sources */,
|
||||
E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */,
|
||||
189DD52E26DE255300AB55B1 /* AppDelegate.m in Sources */,
|
||||
|
@@ -24,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
///model 转字典
|
||||
- (NSDictionary *)model2dictionary;
|
||||
|
||||
///model 转 json
|
||||
- (NSString *)model2json;
|
||||
|
||||
///扩展方法 按需索取 重写即可
|
||||
///如果一个模型中 包含一个数组 数组中是另一个模型
|
||||
+ (NSDictionary *)objectClassInArray;
|
||||
|
@@ -33,6 +33,10 @@
|
||||
return [[self mj_keyValues] copy];
|
||||
}
|
||||
|
||||
- (NSString *)model2json {
|
||||
return [self mj_JSONString];
|
||||
}
|
||||
|
||||
///如果模型中包含数组的话
|
||||
+ (NSDictionary *)mj_objectClassInArray {
|
||||
return [self objectClassInArray];
|
||||
|
21
xplan-ios/Base/MVP/Model/UserExpand.h
Normal file
21
xplan-ios/Base/MVP/Model/UserExpand.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// UserExpand.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "BaseObject.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UserExpand : BaseObject
|
||||
@property (nonatomic , assign) NSInteger id;
|
||||
@property (nonatomic , assign) BOOL showLocation;
|
||||
@property (nonatomic , assign) NSInteger uid;
|
||||
@property (nonatomic , assign) BOOL showAge;
|
||||
@property (nonatomic , assign) BOOL matchChat;
|
||||
@property (nonatomic , assign) BOOL sysMsgNotify;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
12
xplan-ios/Base/MVP/Model/UserExpand.m
Normal file
12
xplan-ios/Base/MVP/Model/UserExpand.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// UserExpand.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "UserExpand.h"
|
||||
|
||||
@implementation UserExpand
|
||||
|
||||
@end
|
48
xplan-ios/Base/MVP/Model/UserInfoModel.h
Normal file
48
xplan-ios/Base/MVP/Model/UserInfoModel.h
Normal file
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// UserInfoModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by apple on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "BaseObject.h"
|
||||
#import "UserExpand.h"
|
||||
#import "UserLevelVo.h"
|
||||
#import "UserInfoSkillVo.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UserInfoModel : BaseObject
|
||||
@property (nonatomic , assign) NSInteger bindType;
|
||||
@property (nonatomic , assign) NSInteger createTime;
|
||||
@property (nonatomic , assign) BOOL parentMode;
|
||||
@property (nonatomic , assign) BOOL isBindPhone;
|
||||
@property (nonatomic , strong) UserExpand * userExpand;
|
||||
@property (nonatomic , assign) NSInteger erbanNo;
|
||||
@property (nonatomic , assign) BOOL isBindPasswd;
|
||||
@property (nonatomic , assign) NSInteger registerDay;
|
||||
@property (nonatomic , assign) BOOL isFirstCharge;
|
||||
@property (nonatomic , assign) BOOL hasPrettyErbanNo;
|
||||
@property (nonatomic , strong) UserLevelVo * userLevelVo;
|
||||
@property (nonatomic , assign) BOOL isBindApple;
|
||||
@property (nonatomic , assign) NSInteger fansNum;
|
||||
@property (nonatomic , assign) BOOL isBindBankCard;
|
||||
@property (nonatomic , assign) BOOL hasRegPacket;
|
||||
@property (nonatomic , assign) BOOL isCertified;
|
||||
@property (nonatomic , assign) NSInteger gender;
|
||||
@property (nonatomic , assign) NSInteger platformRole;
|
||||
@property (nonatomic , assign) NSInteger uid;
|
||||
@property (nonatomic , assign) NSInteger defUser;
|
||||
@property (nonatomic , copy) NSString * phone;
|
||||
@property (nonatomic , copy) NSString * nick;
|
||||
@property (nonatomic , assign) NSInteger remainDay;
|
||||
@property (nonatomic , copy) NSString * avatar;
|
||||
@property (nonatomic , strong) UserInfoSkillVo * userInfoSkillVo;
|
||||
@property (nonatomic , assign) BOOL newUser;
|
||||
@property (nonatomic , assign) NSInteger followNum;
|
||||
@property (nonatomic , assign) BOOL isBindPaymentPwd;
|
||||
@property (nonatomic , assign) BOOL isBindXCZAccount;
|
||||
@property (nonatomic , assign) BOOL isBindAlipay;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
12
xplan-ios/Base/MVP/Model/UserInfoModel.m
Normal file
12
xplan-ios/Base/MVP/Model/UserInfoModel.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// UserInfoModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by apple on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "UserInfoModel.h"
|
||||
|
||||
@implementation UserInfoModel
|
||||
|
||||
@end
|
16
xplan-ios/Base/MVP/Model/UserInfoSkillVo.h
Normal file
16
xplan-ios/Base/MVP/Model/UserInfoSkillVo.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// UserInfoSkillVo.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "BaseObject.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UserInfoSkillVo : BaseObject
|
||||
@property (nonatomic , assign) BOOL liveTag;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
12
xplan-ios/Base/MVP/Model/UserInfoSkillVo.m
Normal file
12
xplan-ios/Base/MVP/Model/UserInfoSkillVo.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// UserInfoSkillVo.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "UserInfoSkillVo.h"
|
||||
|
||||
@implementation UserInfoSkillVo
|
||||
|
||||
@end
|
25
xplan-ios/Base/MVP/Model/UserLevelVo.h
Normal file
25
xplan-ios/Base/MVP/Model/UserLevelVo.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// UserLevelVo.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "BaseObject.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UserLevelVo : BaseObject
|
||||
@property (nonatomic , copy) NSString * experUrl;
|
||||
@property (nonatomic , assign) NSInteger charmLevelSeq;
|
||||
@property (nonatomic , copy) NSString * experLevelName;
|
||||
@property (nonatomic , copy) NSString * charmLevelName;
|
||||
@property (nonatomic , assign) NSInteger charmAmount;
|
||||
@property (nonatomic , copy) NSString * experLevelGrp;
|
||||
@property (nonatomic , copy) NSString * charmUrl;
|
||||
@property (nonatomic , assign) NSInteger experLevelSeq;
|
||||
@property (nonatomic , assign) NSInteger experAmount;
|
||||
@property (nonatomic , copy) NSString * charmLevelGrp;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
12
xplan-ios/Base/MVP/Model/UserLevelVo.m
Normal file
12
xplan-ios/Base/MVP/Model/UserLevelVo.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// UserLevelVo.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by zu on 2021/9/14.
|
||||
//
|
||||
|
||||
#import "UserLevelVo.h"
|
||||
|
||||
@implementation UserLevelVo
|
||||
|
||||
@end
|
@@ -54,10 +54,10 @@
|
||||
|
||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||
[manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
#ifdef DEBUG
|
||||
NSLog(@"\n%@", responseObject);
|
||||
#endif
|
||||
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
|
||||
#ifdef DEBUG
|
||||
NSLog(@"\n%@", [baseModel model2json]);
|
||||
#endif
|
||||
if (baseModel.code == 200) {
|
||||
success(baseModel);
|
||||
} else {
|
||||
@@ -95,10 +95,10 @@
|
||||
|
||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||
[manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
#ifdef DEBUG
|
||||
NSLog(@"\n%@", responseObject);
|
||||
#endif
|
||||
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
|
||||
#ifdef DEBUG
|
||||
NSLog(@"\n%@", [baseModel model2json]);
|
||||
#endif
|
||||
if (baseModel.code == 200) {
|
||||
success(baseModel);
|
||||
} else {
|
||||
|
@@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param unionid unionid
|
||||
/// @param access_token access_token
|
||||
/// @param type 第三方登录的类型
|
||||
+ (void)loginWithThirdPartWithComplction:(HttpRequestHelperCompletion)complction openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type;
|
||||
+ (void)loginWithThirdPart:(HttpRequestHelperCompletion)complction openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -49,13 +49,13 @@
|
||||
|
||||
|
||||
/// 第三方登录
|
||||
/// @param complction 完成
|
||||
/// @param completion 完成
|
||||
/// @param openid 唯一标识符
|
||||
/// @param unionid unionid
|
||||
/// @param access_token access_token
|
||||
/// @param type 第三方登录的类型
|
||||
+ (void)loginWithThirdPartWithComplction:(HttpRequestHelperCompletion)complction openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type {
|
||||
[self makeRequest:@"acc/third/login" method:HttpRequestHelperMethodPOST completion:complction, __FUNCTION__, openid, unionid, access_token, type, nil];
|
||||
+ (void)loginWithThirdPart:(HttpRequestHelperCompletion)completion openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type {
|
||||
[self makeRequest:@"acc/third/login" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, openid, unionid, access_token, type, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -16,7 +16,6 @@
|
||||
///P
|
||||
#import "LoginProtocol.h"
|
||||
///Model
|
||||
#import "LoginTicketInfo.h"
|
||||
#import "ThirdUserInfo.h"
|
||||
#import "AccountModel.h"
|
||||
|
||||
@@ -99,7 +98,7 @@
|
||||
andType:(ThirdLoginType)type {
|
||||
NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type];
|
||||
unionID = @"";
|
||||
[Api loginWithThirdPartWithComplction:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getBaseVC] hideHUD];
|
||||
AccountModel * model = [AccountModel modelWithDictionary:data.data];
|
||||
if (model != nil) {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
// Api+Main.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by apple on 2021/9/8.
|
||||
// Created by zu on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "Api.h"
|
||||
@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
+ (void)requestTicket:(HttpRequestHelperCompletion)completion access_token:(NSString *)accessToken issue_type:(NSString *)issueType;
|
||||
|
||||
+ (void)getUserInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -2,7 +2,7 @@
|
||||
// Api+Main.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by apple on 2021/9/8.
|
||||
// Created by zu on 2021/9/8.
|
||||
//
|
||||
|
||||
#import "Api+Main.h"
|
||||
@@ -13,4 +13,8 @@
|
||||
[self makeRequest:@"oauth/ticket" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, issueType, nil];
|
||||
}
|
||||
|
||||
+ (void)getUserInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid {
|
||||
[self makeRequest:@"user/get" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface MainPresenter : BaseMvpPresenter
|
||||
|
||||
- (void)autoLogin;
|
||||
- (void)getUserInfo;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -32,4 +32,12 @@
|
||||
}] access_token:accountModel.access_token issue_type:@"multi"];
|
||||
}
|
||||
|
||||
- (void)getUserInfo {
|
||||
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] getUserInfoSuccess:[UserInfoModel modelWithDictionary:data.data]];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
}] uid:[[AccountInfoStorage instance] getUid]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -6,12 +6,14 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "UserInfoModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol MainProtocol <NSObject>
|
||||
|
||||
- (void)autoLoginSuccess;
|
||||
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -49,6 +49,25 @@
|
||||
return _presenter;
|
||||
}
|
||||
|
||||
/// 换取ticket后获取用户信息
|
||||
- (void)autoLoginSuccess {
|
||||
[self.presenter getUserInfo];
|
||||
}
|
||||
|
||||
/// 获取用户信息后检查:1、是否绑定手机号;2、是否需要完善用户信息。
|
||||
/// 当前服务端接口是有未完善信息的全局拦截的,在BaseMvpPresenter里会触发1415去完善用户信息。
|
||||
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo {
|
||||
if (!userInfo.isBindPhone) {
|
||||
// 绑定手机号
|
||||
return;
|
||||
}
|
||||
if (userInfo.nick == nil || userInfo.avatar == nil) {
|
||||
[self completeUserInfo];
|
||||
return;
|
||||
}
|
||||
self.selectedIndex = 0;
|
||||
}
|
||||
|
||||
- (void)tokenInvalid {
|
||||
LoginViewController *lvc = [[LoginViewController alloc] init];
|
||||
[self.navigationController pushViewController:lvc animated:YES];
|
||||
@@ -58,10 +77,6 @@
|
||||
|
||||
}
|
||||
|
||||
- (void)autoLoginSuccess {
|
||||
self.selectedIndex = 0;
|
||||
}
|
||||
|
||||
- (void)configTheme {
|
||||
[[UITabBar appearance] setBackgroundImage:[UIImage imageWithColor:[ThemeColor appCellBackgroundColor] size:CGSizeMake(KScreenWidth, kTabBarHeight)]];
|
||||
[[UITabBar appearance] setShadowImage:[[UIImage alloc]init]];
|
||||
|
Reference in New Issue
Block a user