Răsfoiți Sursa

fix:修改请求时签名获取实时获取时间戳;

gongyuan 1 an în urmă
părinte
comite
e9c632678f

+ 1 - 1
Podfile.lock

@@ -258,4 +258,4 @@ SPEC CHECKSUMS:
 
 PODFILE CHECKSUM: fbca7db0e034540993709a0e5f170e34dca90ff7
 
-COCOAPODS: 1.9.3
+COCOAPODS: 1.11.3

+ 0 - 54
Timi.xcodeproj/project.pbxproj

@@ -15051,7 +15051,6 @@
 			buildConfigurationList = BEDE80172758707B00D41D03 /* Build configuration list for PBXNativeTarget "TimiAppStore" */;
 			buildPhases = (
 				BEDE79CC2758707B00D41D03 /* [CP] Check Pods Manifest.lock */,
-				CC67EA75673A833C56AAAED4 /* [CP] Prepare Artifacts */,
 				BEDE79CD2758707B00D41D03 /* Sources */,
 				BEDE7F512758707B00D41D03 /* Frameworks */,
 				BEDE7F702758707B00D41D03 /* Resources */,
@@ -15073,7 +15072,6 @@
 			buildConfigurationList = BEDE867727587F8700D41D03 /* Build configuration list for PBXNativeTarget "TMAppStore" */;
 			buildPhases = (
 				BEDE802C27587F8700D41D03 /* [CP] Check Pods Manifest.lock */,
-				3B95EFDD9216DB226DA95C79 /* [CP] Prepare Artifacts */,
 				BEDE802D27587F8700D41D03 /* Sources */,
 				BEDE85B127587F8700D41D03 /* Frameworks */,
 				BEDE85D027587F8700D41D03 /* Resources */,
@@ -15095,7 +15093,6 @@
 			buildConfigurationList = BEDFD9E62587372300ECCDA6 /* Build configuration list for PBXNativeTarget "Timi" */;
 			buildPhases = (
 				736D96D724BC4880E9B80D5F /* [CP] Check Pods Manifest.lock */,
-				3B4D855AC0348E91A0402AF3 /* [CP] Prepare Artifacts */,
 				BEDFD9B02587372000ECCDA6 /* Sources */,
 				BEDFD9B12587372000ECCDA6 /* Frameworks */,
 				BEDFD9B22587372000ECCDA6 /* Resources */,
@@ -15753,40 +15750,6 @@
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CommonPods-Timi/Pods-CommonPods-Timi-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		3B4D855AC0348E91A0402AF3 /* [CP] Prepare Artifacts */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-CommonPods-Timi/Pods-CommonPods-Timi-artifacts-${CONFIGURATION}-input-files.xcfilelist",
-			);
-			name = "[CP] Prepare Artifacts";
-			outputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-CommonPods-Timi/Pods-CommonPods-Timi-artifacts-${CONFIGURATION}-output-files.xcfilelist",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CommonPods-Timi/Pods-CommonPods-Timi-artifacts.sh\"\n";
-			showEnvVarsInLog = 0;
-		};
-		3B95EFDD9216DB226DA95C79 /* [CP] Prepare Artifacts */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-CommonPods-TMAppStore/Pods-CommonPods-TMAppStore-artifacts-${CONFIGURATION}-input-files.xcfilelist",
-			);
-			name = "[CP] Prepare Artifacts";
-			outputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-CommonPods-TMAppStore/Pods-CommonPods-TMAppStore-artifacts-${CONFIGURATION}-output-files.xcfilelist",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CommonPods-TMAppStore/Pods-CommonPods-TMAppStore-artifacts.sh\"\n";
-			showEnvVarsInLog = 0;
-		};
 		736D96D724BC4880E9B80D5F /* [CP] Check Pods Manifest.lock */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -15938,23 +15901,6 @@
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CommonPods-Timi/Pods-CommonPods-Timi-resources.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		CC67EA75673A833C56AAAED4 /* [CP] Prepare Artifacts */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-CommonPods-TimiAppStore/Pods-CommonPods-TimiAppStore-artifacts-${CONFIGURATION}-input-files.xcfilelist",
-			);
-			name = "[CP] Prepare Artifacts";
-			outputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-CommonPods-TimiAppStore/Pods-CommonPods-TimiAppStore-artifacts-${CONFIGURATION}-output-files.xcfilelist",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CommonPods-TimiAppStore/Pods-CommonPods-TimiAppStore-artifacts.sh\"\n";
-			showEnvVarsInLog = 0;
-		};
 /* End PBXShellScriptBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */

+ 3 - 3
Timi/Class/Base/ZYLNetworking/APIManager/ZYLAPIManager.m

@@ -245,7 +245,7 @@
             if(error.code == NSURLErrorNetworkConnectionLost ||
                error.code == NSURLErrorCannotConnectToHost ||
                error.code == NSURLErrorCannotFindHost){
-                networkError = ZYLError(@"无法连接服务器,请稍后再试。", ZYLNetworkTaskErrorCannotConnectedToInternet, nil);
+                networkError = ZYLError(@"无法连接服务器,请稍后再试。", ZYLNetworkTaskErrorCannotConnectedToInternet, nil);
                 
             }else{//服务端程序异常没捕获如返回500错误
                 NSHTTPURLResponse *re = (NSHTTPURLResponse *)urlResponse;
@@ -313,10 +313,10 @@
         return @"发生一个验证错误。";
     }
     if(statusCode == 500){
-        return @"服务器内部异常,请稍后再试。";
+        return @"服务异常,请稍后再试。";
     }
     if(statusCode == 502){
-        return @"网关错误,请稍后再试。";
+        return @"网关异常,请稍后再试。";
     }
     if(statusCode == 503){
         return @"服务不可用,请稍后再试。";

+ 9 - 0
Timi/Class/Base/ZYLNetworking/NetworkClient/SecurityLib.m

@@ -207,6 +207,10 @@
 //    "ci":201,
 //    "av":"2.5.0"}
 -(NSString*)getHeaderPackage{
+    NSTimeInterval interval = [[NSDate date] timeIntervalSince1970] * 1000;
+    NSInteger time = interval;
+    self.tTimestamp = [NSString stringWithFormat:@"%zd",time];
+    
     self.tPhoneModel = self.tPhoneModel?self.tPhoneModel:@"";
     self.tPackageName = self.tPackageName?self.tPackageName:@"";
     self.tLatitude = self.tLatitude?self.tLatitude:@"";
@@ -249,7 +253,12 @@
     //    sbToSign.append("&ts=" + (timestamp == null ? "" : timestamp));
     str = [str stringByAppendingFormat:@"%@", [NSString stringWithFormat:@"&ts=%@%@.iOS.security",self.tTimestamp,self.tPackageName]];
     
+    //    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+    //        self.tSign = [self sha256HashFor:str];
+    //    });
+    //    dispatch_async(dispatch_get_main_queue(), ^{
     self.tSign = [self sha256HashFor:str];
+    //    });
     
     NSDictionary *dict = @{@"pm":self.tPhoneModel,
                            @"st":[NSNumber numberWithInt:self.tSignType],