Skip to content

Commit 455b601

Browse files
authored
Merge pull request coding#27 from Coding/add-ldap-login
add ldap login and remove enterprise login
2 parents 09a4359 + 99c8d10 commit 455b601

File tree

7 files changed

+21
-8
lines changed

7 files changed

+21
-8
lines changed

Coding_iOS.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -11264,7 +11264,7 @@
1126411264
files = (
1126511265
);
1126611266
inputPaths = (
11267-
"${SRCROOT}/Pods/Target Support Files/Pods-Coding_iOS-Coding_Enterprise_iOS/Pods-Coding_iOS-Coding_Enterprise_iOS-resources.sh",
11267+
"${PODS_ROOT}/Target Support Files/Pods-Coding_iOS-Coding_Enterprise_iOS/Pods-Coding_iOS-Coding_Enterprise_iOS-resources.sh",
1126811268
"${PODS_ROOT}/FontAwesome+iOS/Resources/FontAwesome.ttf",
1126911269
"${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle",
1127011270
"${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle",
@@ -11281,7 +11281,7 @@
1128111281
);
1128211282
runOnlyForDeploymentPostprocessing = 1;
1128311283
shellPath = /bin/sh;
11284-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Coding_iOS-Coding_Enterprise_iOS/Pods-Coding_iOS-Coding_Enterprise_iOS-resources.sh\"\n";
11284+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Coding_iOS-Coding_Enterprise_iOS/Pods-Coding_iOS-Coding_Enterprise_iOS-resources.sh\"\n";
1128511285
showEnvVarsInLog = 0;
1128611286
};
1128711287
B1D5F1FE20BC06CB00983FB6 /* ShellScript */ = {
@@ -11305,7 +11305,7 @@
1130511305
files = (
1130611306
);
1130711307
inputPaths = (
11308-
"${SRCROOT}/Pods/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS-resources.sh",
11308+
"${PODS_ROOT}/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS-resources.sh",
1130911309
"${PODS_ROOT}/FontAwesome+iOS/Resources/FontAwesome.ttf",
1131011310
"${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle",
1131111311
"${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle",
@@ -11322,7 +11322,7 @@
1132211322
);
1132311323
runOnlyForDeploymentPostprocessing = 1;
1132411324
shellPath = /bin/sh;
11325-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS-resources.sh\"\n";
11325+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS-resources.sh\"\n";
1132611326
showEnvVarsInLog = 0;
1132711327
};
1132811328
B7F20F3BC924F718A926E931 /* [CP] Check Pods Manifest.lock */ = {

Coding_iOS/Coding_iOS-Prefix.pch.example

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#import "UILabel+Common.h"
2727
#import "NSDate+Common.h"
2828
#import "UIBarButtonItem+Common.h"
29-
#import "UIActionSheet+Common.h"
3029
#import "NSURL+Common.h"
3130
#import "UISearchBar+Common.h"
3231
#import "UITTTAttributedLabel.h"

Coding_iOS/Controllers/Login/IntroductionViewController.m

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ - (void)configureButtonsAndPageControl{
109109
[button setTitle:@"企业账号登录" forState:UIControlStateNormal];
110110
button.layer.masksToBounds = YES;
111111
button.layer.cornerRadius = 2.0;
112+
button.hidden = true;
112113
button;
113114
});
114115
[self.view addSubview:self.loginEnterpriseBtn];

Coding_iOS/Controllers/Login/LoginViewController.m

+6
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@ - (void)loginBtnClicked{
390390
[NSObject showError:error];
391391
}
392392
}else{
393+
NSDictionary *dataBody = [data objectForKey:@"data"];
394+
NSDictionary *settings = [dataBody objectForKey:@"settings"];
395+
BOOL ssoEnabled = [[settings objectForKey:@"ssoEnabled"] boolValue];
396+
NSString *ssoType = [settings objectForKey:@"ssoType"];
397+
self.myLogin.ssoType = ssoType;
398+
self.myLogin.ssoEnabled = ssoEnabled;
393399
[weakSelf goToNextStep];
394400
}
395401
}];

Coding_iOS/Models/Login.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313

1414
@interface Login : NSObject
1515
//请求
16-
@property (readwrite, nonatomic, strong) NSString *email, *password, *j_captcha, *company;
16+
@property (readwrite, nonatomic, strong) NSString *email, *password, *j_captcha, *company, *ssoType;
1717
@property (readwrite, nonatomic, strong) NSNumber *remember_me;
18+
@property (readwrite, nonatomic) BOOL ssoEnabled;
1819

1920
- (NSString *)goToLoginTipWithCaptcha:(BOOL)needCaptcha;
2021
- (NSString *)toPath;

Coding_iOS/Models/Login.m

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ - (instancetype)init
2929
self.remember_me = [NSNumber numberWithBool:YES];
3030
self.email = @"";
3131
self.password = @"";
32+
self.ssoType = @"default";
33+
self.ssoEnabled = NO;
3234
}
3335
return self;
3436
}
@@ -37,8 +39,12 @@ - (NSString *)toPath{
3739
return @"api/v2/account/login";
3840
}
3941
- (NSDictionary *)toParams{
42+
NSString *password = [self.password sha1Str];
43+
if (self.ssoEnabled && [self.ssoType isEqualToString:@"ldap"]) {
44+
password = self.password;
45+
}
4046
NSMutableDictionary *params = @{@"account": self.email,
41-
@"password" : [self.password sha1Str],
47+
@"password" : password,
4248
@"remember_me" : self.remember_me? @"true" : @"false",}.mutableCopy;
4349
if (self.j_captcha.length > 0) {
4450
params[@"j_captcha"] = self.j_captcha;

Podfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,4 @@ SPEC CHECKSUMS:
189189

190190
PODFILE CHECKSUM: 8c4d664f01f05a5ddc0837b2a06d36650c4edeeb
191191

192-
COCOAPODS: 1.5.3
192+
COCOAPODS: 1.6.2

0 commit comments

Comments
 (0)