Commit c0dd6c1bd6fbf83c5da1b4c8891ad5a96c3d7ea2

Authored by iOS-Xiaowen
1 parent 1d0cf72f

no message

CNLiveBUserAgreement.podspec
... ... @@ -43,6 +43,9 @@ TODO: 网家家企业端-用户协议.
43 43 # 数据请求
44 44 s.dependency 'CNLiveRequestBastKit'
45 45  
  46 + # 用户信息本地化
  47 + s.dependency 'CNLiveUserManagement'
  48 +
46 49 # 类别
47 50 s.dependency 'CNLiveCategory'
48 51  
... ...
CNLiveBUserAgreement/Classes/CNLiveUserAgreementController.m
... ... @@ -22,6 +22,7 @@
22 22 #import "CNLiveBusinessTools.h"
23 23 #import "CNLiveTimeTools.h"
24 24 #import "CNLiveCommonCategory.h"
  25 +#import "CNUserInfoManager.h"
25 26  
26 27 #import "CNLiveWebView.h"
27 28  
... ... @@ -132,7 +133,28 @@
132 133 #pragma mark - Setter方法
133 134 - (void)setUrl:(NSString *)url{
134 135 if(!url||[url isEqualToString:@""]) return;
135   - [super setUrl:[NSString stringWithFormat:@"%@",url]];
  136 +
  137 + NSString *shortVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
  138 + NSDictionary *params = @{
  139 + @"appId":AppId?AppId:@"",
  140 + @"plat":@"i",
  141 + @"sid":CNUserShareModel.uid?CNUserShareModel.uid:@"",
  142 + @"version":shortVersion?shortVersion:@"",
  143 + @"wjjFrom":@"apple",
  144 + @"wjjUUID":[CNLiveBusinessTools getUidForStat:[NSDate date]]?[CNLiveBusinessTools getUidForStat:[NSDate date]]:@"",
  145 + };
  146 + NSMutableDictionary *para = [CNLiveBusinessTools encryptionSignWithParameter:[NSMutableDictionary dictionaryWithDictionary:params] encryptionKey:APPKey];
  147 + __block NSMutableString * tempString = [[NSMutableString alloc] init];
  148 + [para enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, NSString * _Nonnull value, BOOL * _Nonnull stop) {
  149 + [tempString appendFormat:@"%@=%@&",key,value];
  150 + }];
  151 + if ([url componentsSeparatedByString:@"?"].count>1) {
  152 + url = [NSString stringWithFormat:@"%@&%@",url,[tempString substringToIndex:tempString.length-1]];
  153 + }else{
  154 + url = [NSString stringWithFormat:@"%@?%@",url,[tempString substringToIndex:tempString.length-1]];
  155 + }
  156 + [super setUrl:url];
  157 +
136 158 }
137 159  
138 160 #pragma mark - CNLiveWebViewDelegate
... ...