Commit 75dfe8dfa4c50a72907dffd0dc5b3fcb876144c1

Authored by yanglingyu
1 parent b38bedde

退出百度登录

CNLiveBBASMModule.podspec
... ... @@ -8,7 +8,7 @@
8 8  
9 9 Pod::Spec.new do |s|
10 10 s.name = 'CNLiveBBASMModule'
11   - s.version = '0.0.9'
  11 + s.version = '0.0.10'
12 12 s.summary = 'CNLive-iOS百度小程序接入'
13 13  
14 14 # This description is used to generate tags and improve search results.
... ...
CNLiveBBASMModule/Classes/CNLiveBBASMImpl/CNManager/CNBBASMJumpService.h
... ... @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
15 15 - (void)registerBBASMManager:(NSDictionary *)launchOptions;
16 16 - (void)openBBASMModule:(NSString *)urlStr;
17 17 - (BOOL)cashierHandleOpenUrl:(NSURL *)url;
  18 +- (void)accountLogout;
18 19  
19 20 @end
20 21 @interface CNBBASMJumpService : NSObject<CNBBASMJumpProtocol>
... ...
CNLiveBBASMModule/Classes/CNLiveBBASMImpl/CNManager/CNBBASMJumpService.m
... ... @@ -8,6 +8,7 @@
8 8 #import "CNBBASMJumpService.h"
9 9 #import <CNLiveEnvironment/CNLiveEnvironment.h>
10 10 #import <BBAMNP/BBASMManager.h>
  11 +#import <BBAMNP/BBAMNP.h>
11 12 #import <BainuoCashierSDK/BDNCashierSDK.h>
12 13 #import <CNLiveBeeHive/BHRouter.h>
13 14  
... ... @@ -45,6 +46,10 @@ static NSString *const CNLiveBBASMGetPluginDesC = @&quot;getPluginDescriptionPath&quot;;
45 46 return result;
46 47 }
47 48  
  49 +- (void)accountLogout
  50 +{
  51 + [Pyramid.bba_MNP unionAccountLogOut];
  52 +}
48 53 + (void)shareBBASMWithParams:(NSDictionary *)params
49 54 {
50 55 NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",CNLiveBBASMRouterWithMainkey,CNLiveBBASMShareMethod]];
... ...
Example/CNLiveBBASMModule/CNLIVEViewController.m
... ... @@ -27,14 +27,24 @@
27 27 self.view.backgroundColor = [UIColor whiteColor];
28 28 UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 40+100, 100, 44)];
29 29 [btn addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside];
  30 + [btn setTitle:@"百度小程序" forState:UIControlStateNormal];
30 31 btn.backgroundColor = [UIColor grayColor];
31 32 [self.view addSubview:btn];
  33 + UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(150, 40+100, 100, 44)];
  34 + [btn1 addTarget:self action:@selector(logOut) forControlEvents:UIControlEventTouchUpInside];
  35 + [btn1 setTitle:@"退出百度登录" forState:UIControlStateNormal];
  36 + btn1.backgroundColor = [UIColor grayColor];
  37 + [self.view addSubview:btn1];
32 38 }
33 39 -(void)action{
34 40  
35 41 NSString *spURL = @"cnlive://swan/4fecoAqgCIUtzIyA4FAPgoyrc4oUc25c";
36 42 [CNLiveBBASMModuleService openBBASMModule:spURL];
37 43 }
  44 +- (void)logOut
  45 +{
  46 + [CNLiveBBASMModuleService accountLogout];
  47 +}
38 48 - (void)didReceiveMemoryWarning
39 49 {
40 50 [super didReceiveMemoryWarning];
... ...
Example/CNLiveBBASMModule/CNLiveBBASMModule/CNLiveBBASMModuleService.h
... ... @@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
23 23 + (void)registerBBASMManager:(NSDictionary *)launchOptions;
24 24 + (void)openBBASMModule:(NSString *)urlStr;
25 25 + (BOOL)cashierHandleOpenUrl:(NSURL *)url;
  26 ++ (void)accountLogout;
26 27 @end
27 28  
28 29 NS_ASSUME_NONNULL_END
... ...
Example/CNLiveBBASMModule/CNLiveBBASMModule/CNLiveBBASMModuleService.m
... ... @@ -17,6 +17,7 @@ static NSString *const CNLiveBBASMWithMainRouter = @&quot;com.cnlive.CNLiveNetAdd://c
17 17 static NSString *const CNLiveRegisterBBASMManager = @"registerBBASMManager:";
18 18 static NSString *const CNLiveOpenBBASMModule = @"openBBASMModule:";
19 19 static NSString *const CNLiveCashierHandleOpenUrl = @"cashierHandleOpenUrl:";
  20 +static NSString *const CNLiveAccountLogOut = @"accountLogout";
20 21 @BeeHiveService(CNliveBBASMModuleProtocol, CNLiveBBASMModuleService)
21 22 @implementation CNLiveBBASMModuleService
22 23 - (void)shareBBASMWithParams:(NSDictionary *)params{
... ... @@ -67,4 +68,8 @@ static NSString *const CNLiveCashierHandleOpenUrl = @&quot;cashierHandleOpenUrl:&quot;;
67 68 }];
68 69 return result;
69 70 }
  71 ++ (void)accountLogout{
  72 + NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",CNLiveBBASMWithMainRouter,CNLiveAccountLogOut]];
  73 + [BHRouter openURL:url];
  74 +}
70 75 @end
... ...