Commit 75dfe8dfa4c50a72907dffd0dc5b3fcb876144c1
1 parent
b38bedde
退出百度登录
Showing
6 changed files
with
23 additions
and
1 deletions
CNLiveBBASMModule.podspec
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 = @"getPluginDescriptionPath"; |
| 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
Example/CNLiveBBASMModule/CNLiveBBASMModule/CNLiveBBASMModuleService.m
| ... | ... | @@ -17,6 +17,7 @@ static NSString *const CNLiveBBASMWithMainRouter = @"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 = @"cashierHandleOpenUrl:"; |
| 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 | ... | ... |