首页增加用户信息/绑定手机号检测

This commit is contained in:
zu
2021-09-14 16:57:13 +08:00
parent 2ef316d052
commit b9d811f088
23 changed files with 242 additions and 22 deletions

View File

@@ -55,6 +55,10 @@
18E7B26626E8D4510064BC9B /* Toast.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 18E7B24726E8D43C0064BC9B /* Toast.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 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 */; }; 18E7B26926E8D5D60064BC9B /* XCCurrentVCStackManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E7B26726E8D5D60064BC9B /* XCCurrentVCStackManager.m */; };
18E7B29026EA0E6B0064BC9B /* FlutterBoost+Xplan.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E7B28F26EA0E6B0064BC9B /* FlutterBoost+Xplan.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 */; }; 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 */; }; 9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0E1C5826E77022005D4442 /* BaseNavigationController.m */; };
E81C278C26EAFAF60031E639 /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C278926EAFAF60031E639 /* Base64.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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 9B0E1C5826E77022005D4442 /* BaseNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseNavigationController.m; sourceTree = "<group>"; };
@@ -331,16 +343,26 @@
189DD56026DE456100AB55B1 /* Model */ = { 189DD56026DE456100AB55B1 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E8B825B526E9A7D8009E8E9F /* BaseObject.h */,
E8B825B626E9A7D8009E8E9F /* BaseObject.m */,
187EEEDA26E89B32002833B2 /* BaseModel.h */, 187EEEDA26E89B32002833B2 /* BaseModel.h */,
187EEEDB26E89B32002833B2 /* BaseModel.m */, 187EEEDB26E89B32002833B2 /* BaseModel.m */,
187EEEDF26E89BFB002833B2 /* AccountModel.h */, 187EEEDF26E89BFB002833B2 /* AccountModel.h */,
187EEEE026E89BFB002833B2 /* AccountModel.m */, 187EEEE026E89BFB002833B2 /* AccountModel.m */,
E8B825BD26E9E57D009E8E9F /* LoginTicketInfo.h */,
E8B825BE26E9E57D009E8E9F /* LoginTicketInfo.m */,
187EEEEF26E89FE8002833B2 /* AccountInfoStorage.h */, 187EEEEF26E89FE8002833B2 /* AccountInfoStorage.h */,
187EEEEE26E89FE8002833B2 /* AccountInfoStorage.m */, 187EEEEE26E89FE8002833B2 /* AccountInfoStorage.m */,
187EEEFD26E8A82C002833B2 /* NSObject+AutoCoding.h */, 187EEEFD26E8A82C002833B2 /* NSObject+AutoCoding.h */,
187EEEFC26E8A82C002833B2 /* NSObject+AutoCoding.m */, 187EEEFC26E8A82C002833B2 /* NSObject+AutoCoding.m */,
E8B825B526E9A7D8009E8E9F /* BaseObject.h */, 18E7B31626F097E00064BC9B /* UserInfoModel.h */,
E8B825B626E9A7D8009E8E9F /* BaseObject.m */, 18E7B31726F097E00064BC9B /* UserInfoModel.m */,
18E7B31926F0982E0064BC9B /* UserExpand.h */,
18E7B31A26F0982E0064BC9B /* UserExpand.m */,
18E7B31C26F0984C0064BC9B /* UserLevelVo.h */,
18E7B31D26F0984C0064BC9B /* UserLevelVo.m */,
18E7B31F26F098650064BC9B /* UserInfoSkillVo.h */,
18E7B32026F098650064BC9B /* UserInfoSkillVo.m */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -624,8 +646,6 @@
E8B825BC26E9E520009E8E9F /* Model */ = { E8B825BC26E9E520009E8E9F /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E8B825BD26E9E57D009E8E9F /* LoginTicketInfo.h */,
E8B825BE26E9E57D009E8E9F /* LoginTicketInfo.m */,
E81C27A926EF2D920031E639 /* ThirdUserInfo.h */, E81C27A926EF2D920031E639 /* ThirdUserInfo.h */,
E81C27AA26EF2D920031E639 /* ThirdUserInfo.m */, E81C27AA26EF2D920031E639 /* ThirdUserInfo.m */,
); );
@@ -781,6 +801,8 @@
189DD74A26E21D8400AB55B1 /* SSKeychain.m in Sources */, 189DD74A26E21D8400AB55B1 /* SSKeychain.m in Sources */,
E81C27AE26EF39AB0031E639 /* AppDelegate+ThirdConfig.m in Sources */, E81C27AE26EF39AB0031E639 /* AppDelegate+ThirdConfig.m in Sources */,
E8B825D026EA3825009E8E9F /* LoginPasswordViewController.m in Sources */, E8B825D026EA3825009E8E9F /* LoginPasswordViewController.m in Sources */,
18E7B31826F097E00064BC9B /* UserInfoModel.m in Sources */,
18E7B32126F098650064BC9B /* UserInfoSkillVo.m in Sources */,
189DD68426E1FDBB00AB55B1 /* XCHUDTool.m in Sources */, 189DD68426E1FDBB00AB55B1 /* XCHUDTool.m in Sources */,
189DD73F26E21C3F00AB55B1 /* YYUtility+Carrier.m in Sources */, 189DD73F26E21C3F00AB55B1 /* YYUtility+Carrier.m in Sources */,
18E7B26926E8D5D60064BC9B /* XCCurrentVCStackManager.m in Sources */, 18E7B26926E8D5D60064BC9B /* XCCurrentVCStackManager.m in Sources */,
@@ -792,6 +814,8 @@
E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */, E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */,
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */, 18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,
189DD67E26E1FD8900AB55B1 /* UIImage+Utils.m in Sources */, 189DD67E26E1FD8900AB55B1 /* UIImage+Utils.m in Sources */,
18E7B31E26F0984C0064BC9B /* UserLevelVo.m in Sources */,
18E7B31B26F0982E0064BC9B /* UserExpand.m in Sources */,
E8B825CD26EA18C8009E8E9F /* ThemeColor.m in Sources */, E8B825CD26EA18C8009E8E9F /* ThemeColor.m in Sources */,
E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */, E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */,
189DD52E26DE255300AB55B1 /* AppDelegate.m in Sources */, 189DD52E26DE255300AB55B1 /* AppDelegate.m in Sources */,

View File

@@ -24,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
///model 转字典 ///model 转字典
- (NSDictionary *)model2dictionary; - (NSDictionary *)model2dictionary;
///model 转 json
- (NSString *)model2json;
///扩展方法 按需索取 重写即可 ///扩展方法 按需索取 重写即可
///如果一个模型中 包含一个数组 数组中是另一个模型 ///如果一个模型中 包含一个数组 数组中是另一个模型
+ (NSDictionary *)objectClassInArray; + (NSDictionary *)objectClassInArray;

View File

@@ -33,6 +33,10 @@
return [[self mj_keyValues] copy]; return [[self mj_keyValues] copy];
} }
- (NSString *)model2json {
return [self mj_JSONString];
}
/// ///
+ (NSDictionary *)mj_objectClassInArray { + (NSDictionary *)mj_objectClassInArray {
return [self objectClassInArray]; return [self objectClassInArray];

View 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

View File

@@ -0,0 +1,12 @@
//
// UserExpand.m
// xplan-ios
//
// Created by zu on 2021/9/14.
//
#import "UserExpand.h"
@implementation UserExpand
@end

View 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

View File

@@ -0,0 +1,12 @@
//
// UserInfoModel.m
// xplan-ios
//
// Created by apple on 2021/9/14.
//
#import "UserInfoModel.h"
@implementation UserInfoModel
@end

View 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

View File

@@ -0,0 +1,12 @@
//
// UserInfoSkillVo.m
// xplan-ios
//
// Created by zu on 2021/9/14.
//
#import "UserInfoSkillVo.h"
@implementation UserInfoSkillVo
@end

View 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

View File

@@ -0,0 +1,12 @@
//
// UserLevelVo.m
// xplan-ios
//
// Created by zu on 2021/9/14.
//
#import "UserLevelVo.h"
@implementation UserLevelVo
@end

View File

@@ -54,10 +54,10 @@
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
[manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [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]; BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
#ifdef DEBUG
NSLog(@"\n%@", [baseModel model2json]);
#endif
if (baseModel.code == 200) { if (baseModel.code == 200) {
success(baseModel); success(baseModel);
} else { } else {
@@ -95,10 +95,10 @@
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
[manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [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]; BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
#ifdef DEBUG
NSLog(@"\n%@", [baseModel model2json]);
#endif
if (baseModel.code == 200) { if (baseModel.code == 200) {
success(baseModel); success(baseModel);
} else { } else {

View File

@@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @param unionid unionid /// @param unionid unionid
/// @param access_token access_token /// @param access_token access_token
/// @param type 第三方登录的类型 /// @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 @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -49,13 +49,13 @@
/// ///
/// @param complction /// @param completion
/// @param openid /// @param openid
/// @param unionid unionid /// @param unionid unionid
/// @param access_token access_token /// @param access_token access_token
/// @param type /// @param type
+ (void)loginWithThirdPartWithComplction:(HttpRequestHelperCompletion)complction openid:(NSString *)openid unionid:(NSString *)unionid access_token:(NSString *)access_token type:(NSString *)type { + (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:complction, __FUNCTION__, openid, unionid, access_token, type, nil]; [self makeRequest:@"acc/third/login" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, openid, unionid, access_token, type, nil];
} }
@end @end

View File

@@ -16,7 +16,6 @@
///P ///P
#import "LoginProtocol.h" #import "LoginProtocol.h"
///Model ///Model
#import "LoginTicketInfo.h"
#import "ThirdUserInfo.h" #import "ThirdUserInfo.h"
#import "AccountModel.h" #import "AccountModel.h"
@@ -99,7 +98,7 @@
andType:(ThirdLoginType)type { andType:(ThirdLoginType)type {
NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type]; NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type];
unionID = @""; unionID = @"";
[Api loginWithThirdPartWithComplction:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getBaseVC] hideHUD]; [[self getBaseVC] hideHUD];
AccountModel * model = [AccountModel modelWithDictionary:data.data]; AccountModel * model = [AccountModel modelWithDictionary:data.data];
if (model != nil) { if (model != nil) {

View File

@@ -2,7 +2,7 @@
// Api+Main.h // Api+Main.h
// xplan-ios // xplan-ios
// //
// Created by apple on 2021/9/8. // Created by zu on 2021/9/8.
// //
#import "Api.h" #import "Api.h"
@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)requestTicket:(HttpRequestHelperCompletion)completion access_token:(NSString *)accessToken issue_type:(NSString *)issueType; + (void)requestTicket:(HttpRequestHelperCompletion)completion access_token:(NSString *)accessToken issue_type:(NSString *)issueType;
+ (void)getUserInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -2,7 +2,7 @@
// Api+Main.m // Api+Main.m
// xplan-ios // xplan-ios
// //
// Created by apple on 2021/9/8. // Created by zu on 2021/9/8.
// //
#import "Api+Main.h" #import "Api+Main.h"
@@ -13,4 +13,8 @@
[self makeRequest:@"oauth/ticket" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, accessToken, issueType, nil]; [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 @end

View File

@@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface MainPresenter : BaseMvpPresenter @interface MainPresenter : BaseMvpPresenter
- (void)autoLogin; - (void)autoLogin;
- (void)getUserInfo;
@end @end

View File

@@ -32,4 +32,12 @@
}] access_token:accountModel.access_token issue_type:@"multi"]; }] 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 @end

View File

@@ -6,12 +6,14 @@
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "UserInfoModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol MainProtocol <NSObject> @protocol MainProtocol <NSObject>
- (void)autoLoginSuccess; - (void)autoLoginSuccess;
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo;
@end @end

View File

@@ -49,6 +49,25 @@
return _presenter; return _presenter;
} }
/// ticket
- (void)autoLoginSuccess {
[self.presenter getUserInfo];
}
/// 12
/// BaseMvpPresenter1415
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo {
if (!userInfo.isBindPhone) {
//
return;
}
if (userInfo.nick == nil || userInfo.avatar == nil) {
[self completeUserInfo];
return;
}
self.selectedIndex = 0;
}
- (void)tokenInvalid { - (void)tokenInvalid {
LoginViewController *lvc = [[LoginViewController alloc] init]; LoginViewController *lvc = [[LoginViewController alloc] init];
[self.navigationController pushViewController:lvc animated:YES]; [self.navigationController pushViewController:lvc animated:YES];
@@ -58,10 +77,6 @@
} }
- (void)autoLoginSuccess {
self.selectedIndex = 0;
}
- (void)configTheme { - (void)configTheme {
[[UITabBar appearance] setBackgroundImage:[UIImage imageWithColor:[ThemeColor appCellBackgroundColor] size:CGSizeMake(KScreenWidth, kTabBarHeight)]]; [[UITabBar appearance] setBackgroundImage:[UIImage imageWithColor:[ThemeColor appCellBackgroundColor] size:CGSizeMake(KScreenWidth, kTabBarHeight)]];
[[UITabBar appearance] setShadowImage:[[UIImage alloc]init]]; [[UITabBar appearance] setShadowImage:[[UIImage alloc]init]];