Commit 2322b65fe7eabffac5ba9f07180b5d00b36b4da6

Authored by zhangxiaowen
1 parent e685e882

no message

CNLiveUserAgreementManager.podspec
@@ -40,5 +40,7 @@ TODO: Add long description of the pod here. @@ -40,5 +40,7 @@ TODO: Add long description of the pod here.
40 # s.frameworks = 'UIKit', 'MapKit' 40 # s.frameworks = 'UIKit', 'MapKit'
41 # s.dependency 'AFNetworking', '~> 2.3' 41 # s.dependency 'AFNetworking', '~> 2.3'
42 s.dependency 'CNLiveRequestBastKit' 42 s.dependency 'CNLiveRequestBastKit'
  43 + s.dependency 'CNLiveEnvironmentConfiguration'
  44 +
43 45
44 end 46 end
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,6 +8,8 @@
8 8
9 #import "CNUserAgreementManager.h" 9 #import "CNUserAgreementManager.h"
10 #import <CNLiveRequestBastKit/CNLiveNetworking.h> 10 #import <CNLiveRequestBastKit/CNLiveNetworking.h>
  11 +#import "CNUserAgreementInterface.h"
  12 +
11 @interface CNUserAgreementManager() 13 @interface CNUserAgreementManager()
12 14
13 @end 15 @end
@@ -47,7 +49,7 @@ static CNUserAgreementManager *_instance = nil; @@ -47,7 +49,7 @@ static CNUserAgreementManager *_instance = nil;
47 49
48 - (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure { 50 - (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure {
49 [CNLiveNetworking setAllowRequestDefaultArgument:NO]; 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 if (error) { 53 if (error) {
52 if (failure) { 54 if (failure) {
53 failure(error); 55 failure(error);
Example/CNLiveUserAgreementManager/CNLiveViewController.m
@@ -8,6 +8,8 @@ @@ -8,6 +8,8 @@
8 8
9 #import "CNLiveViewController.h" 9 #import "CNLiveViewController.h"
10 #import "CNUserAgreementManager.h" 10 #import "CNUserAgreementManager.h"
  11 +#import "CNUserAgreementInterface.h"
  12 +
11 @interface CNLiveViewController () 13 @interface CNLiveViewController ()
12 14
13 @end 15 @end
@@ -18,6 +20,8 @@ @@ -18,6 +20,8 @@
18 { 20 {
19 [super viewDidLoad]; 21 [super viewDidLoad];
20 // Do any additional setup after loading the view, typically from a nib. 22 // Do any additional setup after loading the view, typically from a nib.
  23 + NSLog(@"%@",CNGetAgreementH5Url);
  24 +
21 [[CNUserAgreementManager shared] getAgreementH5WithType:CNAgreementUser success:^(NSString * _Nonnull h5, NSString * _Nonnull title) { 25 [[CNUserAgreementManager shared] getAgreementH5WithType:CNAgreementUser success:^(NSString * _Nonnull h5, NSString * _Nonnull title) {
22 26
23 } failure:^(NSError * _Nonnull error) { 27 } failure:^(NSError * _Nonnull error) {
Example/Podfile
@@ -7,11 +7,12 @@ platform :ios, &#39;9.0&#39; @@ -7,11 +7,12 @@ platform :ios, &#39;9.0&#39;
7 target 'CNLiveUserAgreementManager_Example' do 7 target 'CNLiveUserAgreementManager_Example' do
8 pod 'CNLiveUserAgreementManager', :path => '../' 8 pod 'CNLiveUserAgreementManager', :path => '../'
9 pod 'CNLiveRequestBastKit' 9 pod 'CNLiveRequestBastKit'
  10 + pod 'CNLiveEnvironmentConfiguration'
10 11
11 target 'CNLiveUserAgreementManager_Tests' do 12 target 'CNLiveUserAgreementManager_Tests' do
12 inherit! :search_paths 13 inherit! :search_paths
13 pod 'CNLiveRequestBastKit' 14 pod 'CNLiveRequestBastKit'
  15 + pod 'CNLiveEnvironmentConfiguration'
14 16
15 -  
16 end 17 end
17 end 18 end