Commit 2322b65fe7eabffac5ba9f07180b5d00b36b4da6
1 parent
e685e882
no message
Showing
5 changed files
with
26 additions
and
2 deletions
CNLiveUserAgreementManager.podspec
CNLiveUserAgreementManager/Classes/CNUserAgreementInterface.h
0 → 100644
| 1 | +// | |
| 2 | +// CNUserAgreementInterface.h | |
| 3 | +// CNLiveUserAgreementManager | |
| 4 | +// | |
| 5 | +// Created by CNLive-zxw on 2019/4/16. | |
| 6 | +// Copyright © 2019 153993236@qq.com. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#ifndef CNUserAgreementInterface_h | |
| 10 | +#define CNUserAgreementInterface_h | |
| 11 | +#import "CNEnvironmentHeader.h" | |
| 12 | + | |
| 13 | +static NSString *const CNGetAgreementH5Url = API_Refund@"/json/wjj_user_terms.json"; | |
| 14 | + | |
| 15 | +#endif /* CNUserAgreementInterface_h */ | ... | ... |
CNLiveUserAgreementManager/Classes/CNUserAgreementManager.m
| ... | ... | @@ -8,6 +8,8 @@ |
| 8 | 8 | |
| 9 | 9 | #import "CNUserAgreementManager.h" |
| 10 | 10 | #import <CNLiveRequestBastKit/CNLiveNetworking.h> |
| 11 | +#import "CNUserAgreementInterface.h" | |
| 12 | + | |
| 11 | 13 | @interface CNUserAgreementManager() |
| 12 | 14 | |
| 13 | 15 | @end |
| ... | ... | @@ -47,7 +49,7 @@ static CNUserAgreementManager *_instance = nil; |
| 47 | 49 | |
| 48 | 50 | - (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure { |
| 49 | 51 | [CNLiveNetworking setAllowRequestDefaultArgument:NO]; |
| 50 | - [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:@"https://wjj.ys1.cnliveimg.com/json/wjj_user_terms.json" Param:@{} CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 52 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNGetAgreementH5Url Param:@{} CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 51 | 53 | if (error) { |
| 52 | 54 | if (failure) { |
| 53 | 55 | failure(error); | ... | ... |
Example/CNLiveUserAgreementManager/CNLiveViewController.m
| ... | ... | @@ -8,6 +8,8 @@ |
| 8 | 8 | |
| 9 | 9 | #import "CNLiveViewController.h" |
| 10 | 10 | #import "CNUserAgreementManager.h" |
| 11 | +#import "CNUserAgreementInterface.h" | |
| 12 | + | |
| 11 | 13 | @interface CNLiveViewController () |
| 12 | 14 | |
| 13 | 15 | @end |
| ... | ... | @@ -18,6 +20,8 @@ |
| 18 | 20 | { |
| 19 | 21 | [super viewDidLoad]; |
| 20 | 22 | // Do any additional setup after loading the view, typically from a nib. |
| 23 | + NSLog(@"%@",CNGetAgreementH5Url); | |
| 24 | + | |
| 21 | 25 | [[CNUserAgreementManager shared] getAgreementH5WithType:CNAgreementUser success:^(NSString * _Nonnull h5, NSString * _Nonnull title) { |
| 22 | 26 | |
| 23 | 27 | } failure:^(NSError * _Nonnull error) { | ... | ... |
Example/Podfile
| ... | ... | @@ -7,11 +7,12 @@ platform :ios, '9.0' |
| 7 | 7 | target 'CNLiveUserAgreementManager_Example' do |
| 8 | 8 | pod 'CNLiveUserAgreementManager', :path => '../' |
| 9 | 9 | pod 'CNLiveRequestBastKit' |
| 10 | + pod 'CNLiveEnvironmentConfiguration' | |
| 10 | 11 | |
| 11 | 12 | target 'CNLiveUserAgreementManager_Tests' do |
| 12 | 13 | inherit! :search_paths |
| 13 | 14 | pod 'CNLiveRequestBastKit' |
| 15 | + pod 'CNLiveEnvironmentConfiguration' | |
| 14 | 16 | |
| 15 | - | |
| 16 | 17 | end |
| 17 | 18 | end | ... | ... |