12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //
- // LDTaobaoAuthorTool.m
- // YouHuiProject
- //
- // Created by 小花 on 2019/1/30.
- // Copyright © 2019年 kuxuan. All rights reserved.
- //
- #import "LDTaobaoAuthorTool.h"
- #import "LDTaobaoWebAuthorController.h"
- #import <AlibabaAuthSDK/ALBBSDK.h>
- #import <AlibabaAuthSDK/ALBBSession.h>
- @implementation LDTaobaoAuthorTool
- + (void)taobaoAuthorManager:(NSString *)url type:(NSString *)authorType currentVc:(UIViewController *)Vc {
-
- if (![[ALBBSession sharedInstance] isLogin]) {
- //淘宝未授权
- ALBBSDK *albbSDK = [ALBBSDK sharedInstance];
- [albbSDK setAppkey:ALBC_APP_KEY];
- [albbSDK setAuthOption:NormalAuth];
-
- [albbSDK auth:Vc successCallback:^(ALBBSession *session){
-
-
- LDTaobaoWebAuthorController *webAutuhor = [[LDTaobaoWebAuthorController alloc] init];
- webAutuhor.url = url;
- webAutuhor.authorType = authorType;
- [Vc.navigationController pushViewController:webAutuhor animated:YES];
-
-
- } failureCallback:^(ALBBSession *session,NSError *error){
- NSLog(@"session == %@,error == %@",session,error);
- }];
- }else {
- LDTaobaoWebAuthorController *webAutuhor = [[LDTaobaoWebAuthorController alloc] init];
- webAutuhor.url = url;
- webAutuhor.authorType = authorType;
- [Vc.navigationController pushViewController:webAutuhor animated:YES];
- }
- }
- @end
|