From 99c8d1083209e691a0b79e9dac4eda61bdf2fa5f Mon Sep 17 00:00:00 2001 From: jiong Date: Tue, 21 May 2019 15:55:11 +0800 Subject: [PATCH 1/2] add ldap login remove enterprise login --- Coding_iOS.xcodeproj/project.pbxproj | 8 ++++---- Coding_iOS/Coding_iOS-Prefix.pch.example | 1 - Coding_iOS/Controllers/Login/IntroductionViewController.m | 1 + Coding_iOS/Controllers/Login/LoginViewController.m | 6 ++++++ Coding_iOS/Models/Login.h | 3 ++- Coding_iOS/Models/Login.m | 8 +++++++- Podfile.lock | 2 +- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Coding_iOS.xcodeproj/project.pbxproj b/Coding_iOS.xcodeproj/project.pbxproj index 79a2d1a25..2670133d7 100644 --- a/Coding_iOS.xcodeproj/project.pbxproj +++ b/Coding_iOS.xcodeproj/project.pbxproj @@ -11264,7 +11264,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Coding_iOS-Coding_Enterprise_iOS/Pods-Coding_iOS-Coding_Enterprise_iOS-resources.sh", + "${PODS_ROOT}/Target Support Files/Pods-Coding_iOS-Coding_Enterprise_iOS/Pods-Coding_iOS-Coding_Enterprise_iOS-resources.sh", "${PODS_ROOT}/FontAwesome+iOS/Resources/FontAwesome.ttf", "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle", "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle", @@ -11281,7 +11281,7 @@ ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Coding_iOS-Coding_Enterprise_iOS/Pods-Coding_iOS-Coding_Enterprise_iOS-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Coding_iOS-Coding_Enterprise_iOS/Pods-Coding_iOS-Coding_Enterprise_iOS-resources.sh\"\n"; showEnvVarsInLog = 0; }; B1D5F1FE20BC06CB00983FB6 /* ShellScript */ = { @@ -11305,7 +11305,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS-resources.sh", + "${PODS_ROOT}/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS-resources.sh", "${PODS_ROOT}/FontAwesome+iOS/Resources/FontAwesome.ttf", "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle", "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle", @@ -11322,7 +11322,7 @@ ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS-resources.sh\"\n"; showEnvVarsInLog = 0; }; B7F20F3BC924F718A926E931 /* [CP] Check Pods Manifest.lock */ = { diff --git a/Coding_iOS/Coding_iOS-Prefix.pch.example b/Coding_iOS/Coding_iOS-Prefix.pch.example index a48e2391e..25cc487e5 100644 --- a/Coding_iOS/Coding_iOS-Prefix.pch.example +++ b/Coding_iOS/Coding_iOS-Prefix.pch.example @@ -26,7 +26,6 @@ #import "UILabel+Common.h" #import "NSDate+Common.h" #import "UIBarButtonItem+Common.h" -#import "UIActionSheet+Common.h" #import "NSURL+Common.h" #import "UISearchBar+Common.h" #import "UITTTAttributedLabel.h" diff --git a/Coding_iOS/Controllers/Login/IntroductionViewController.m b/Coding_iOS/Controllers/Login/IntroductionViewController.m index 594d0c176..853dbe09c 100644 --- a/Coding_iOS/Controllers/Login/IntroductionViewController.m +++ b/Coding_iOS/Controllers/Login/IntroductionViewController.m @@ -109,6 +109,7 @@ - (void)configureButtonsAndPageControl{ [button setTitle:@"企业账号登录" forState:UIControlStateNormal]; button.layer.masksToBounds = YES; button.layer.cornerRadius = 2.0; + button.hidden = true; button; }); [self.view addSubview:self.loginEnterpriseBtn]; diff --git a/Coding_iOS/Controllers/Login/LoginViewController.m b/Coding_iOS/Controllers/Login/LoginViewController.m index 57a385752..27ad9aaa6 100644 --- a/Coding_iOS/Controllers/Login/LoginViewController.m +++ b/Coding_iOS/Controllers/Login/LoginViewController.m @@ -390,6 +390,12 @@ - (void)loginBtnClicked{ [NSObject showError:error]; } }else{ + NSDictionary *dataBody = [data objectForKey:@"data"]; + NSDictionary *settings = [dataBody objectForKey:@"settings"]; + BOOL ssoEnabled = [[settings objectForKey:@"ssoEnabled"] boolValue]; + NSString *ssoType = [settings objectForKey:@"ssoType"]; + self.myLogin.ssoType = ssoType; + self.myLogin.ssoEnabled = ssoEnabled; [weakSelf goToNextStep]; } }]; diff --git a/Coding_iOS/Models/Login.h b/Coding_iOS/Models/Login.h index 93eee442c..6ab81c7d4 100755 --- a/Coding_iOS/Models/Login.h +++ b/Coding_iOS/Models/Login.h @@ -13,8 +13,9 @@ @interface Login : NSObject //请求 -@property (readwrite, nonatomic, strong) NSString *email, *password, *j_captcha, *company; +@property (readwrite, nonatomic, strong) NSString *email, *password, *j_captcha, *company, *ssoType; @property (readwrite, nonatomic, strong) NSNumber *remember_me; +@property (readwrite, nonatomic) BOOL ssoEnabled; - (NSString *)goToLoginTipWithCaptcha:(BOOL)needCaptcha; - (NSString *)toPath; diff --git a/Coding_iOS/Models/Login.m b/Coding_iOS/Models/Login.m index ed7576181..8d3c5d05f 100644 --- a/Coding_iOS/Models/Login.m +++ b/Coding_iOS/Models/Login.m @@ -29,6 +29,8 @@ - (instancetype)init self.remember_me = [NSNumber numberWithBool:YES]; self.email = @""; self.password = @""; + self.ssoType = @"default"; + self.ssoEnabled = NO; } return self; } @@ -37,8 +39,12 @@ - (NSString *)toPath{ return @"api/v2/account/login"; } - (NSDictionary *)toParams{ + NSString *password = [self.password sha1Str]; + if (self.ssoEnabled && [self.ssoType isEqualToString:@"ldap"]) { + password = self.password; + } NSMutableDictionary *params = @{@"account": self.email, - @"password" : [self.password sha1Str], + @"password" : password, @"remember_me" : self.remember_me? @"true" : @"false",}.mutableCopy; if (self.j_captcha.length > 0) { params[@"j_captcha"] = self.j_captcha; diff --git a/Podfile.lock b/Podfile.lock index 3b38f29c4..946ff0a77 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -189,4 +189,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 8c4d664f01f05a5ddc0837b2a06d36650c4edeeb -COCOAPODS: 1.5.3 +COCOAPODS: 1.6.2 From 16101616aad39ec04aea7a9f19b0f1ce82eff689 Mon Sep 17 00:00:00 2001 From: jiong Date: Thu, 23 May 2019 11:42:51 +0800 Subject: [PATCH 2/2] build 2.10 --- Coding_iOS/Coding_Enterprise_iOS-Info.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Coding_iOS/Coding_Enterprise_iOS-Info.plist b/Coding_iOS/Coding_Enterprise_iOS-Info.plist index beea38d8b..d652e9f7b 100644 --- a/Coding_iOS/Coding_Enterprise_iOS-Info.plist +++ b/Coding_iOS/Coding_Enterprise_iOS-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.9.10 + 2.10 CFBundleSignature ???? CFBundleURLTypes @@ -28,7 +28,7 @@ CFBundleVersion - 2.9.10.20190219.1 + 2.10.20190523.1 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes