Steven 1 year ago
parent
commit
0bbb10eed4

+ 3 - 4
KulexiuForStudent/KulexiuForStudent/AppDelegate.m

@@ -25,7 +25,6 @@
 #import <UserNotifications/UserNotifications.h>
 #endif
 
-#import "UrlDecode.h"
 #import "KSBaseWKWebViewController.h"
 #import "UserInfoManager.h"
 
@@ -664,7 +663,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
     if ([detailUrl containsString:@"linkUrl="]) {
         NSString *linkUrl = [[detailUrl componentsSeparatedByString:@"linkUrl="] lastObject];
         if (![NSString isEmptyString:linkUrl]) {
-            linkUrl = [UrlDecode decodeStringWithString:linkUrl];
+            linkUrl = [linkUrl removeUrlEndcodeString];
             // 转成 dic
             NSData *jsonData = [linkUrl mj_JSONData];
             NSError *error;
@@ -726,7 +725,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
         NSString *webUrl = [dict ks_stringValueForKey:@"url"];
         if (![NSString isEmptyString:webUrl]) {
             KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-            webCtrl.url = webUrl;
+            webCtrl.url = [webUrl getUrlEndcodeString];
             CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
             [navCtrl pushViewController:webCtrl animated:YES];
         }
@@ -868,7 +867,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
             NSString *webUrl = [dict ks_stringValueForKey:@"url"];
             if (![NSString isEmptyString:webUrl]) {
                 KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-                webCtrl.url = webUrl;
+                webCtrl.url = [webUrl getUrlEndcodeString];
                 CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
                 [navCtrl pushViewController:webCtrl animated:YES];
             }

+ 2 - 0
KulexiuForStudent/KulexiuForStudent/Common/Tools/Extension/NSString+Extension.h

@@ -32,6 +32,8 @@ typedef NS_ENUM(NSInteger,CHECKTYPE){
 - (NSString *)dateFormatString; // 返回年月日 传入格式 YYYY-MM-dd hh:mm:ss
 // url encoding
 - (NSString *)getUrlEndcodeString;
+// 移除endcodeing
+- (NSString *)removeUrlEndcodeString;
 // 获取保存文件名
 - (NSString *)getUrlFileName;
 

+ 6 - 0
KulexiuForStudent/KulexiuForStudent/Common/Tools/Extension/NSString+Extension.m

@@ -242,6 +242,12 @@
     return url;
 }
 
+// 移除endcodeing
+- (NSString *)removeUrlEndcodeString {
+    NSString *url = [self stringByRemovingPercentEncoding];
+    return url;
+}
+
 // 获取保存文件名
 - (NSString *)getUrlFileName {
     NSString *fileName = [[self componentsSeparatedByString:@"/"] lastObject];

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/Controller/TenantMoreViewController.m

@@ -434,11 +434,11 @@
     if (![NSString isEmptyString:model.linkUrl]) {
         if ([model.linkType isEqualToString:@"OUT"]) {
             // 外部浏览器打开
-            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:model.linkUrl] options: @{} completionHandler: nil];
+            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[model.linkUrl getUrlEndcodeString]] options: @{} completionHandler: nil];
         }
         else {
             KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-            webCtrl.url = model.linkUrl;
+            webCtrl.url = [model.linkUrl getUrlEndcodeString];
             [self.navigationController pushViewController:webCtrl animated:YES];
         }
     }

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Mine/Controller/TenantNotiferCenterController.m

@@ -201,7 +201,7 @@
             NSString *webUrl = [dict ks_stringValueForKey:@"url"];
             if (![NSString isEmptyString:webUrl]) {
                 KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-                webCtrl.url = webUrl;
+                webCtrl.url = [webUrl getUrlEndcodeString];
                 CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
                 [navCtrl pushViewController:webCtrl animated:YES];
             }

+ 5 - 5
KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m

@@ -905,7 +905,7 @@
         if (isSure) {
             if (![NSString isEmptyString:linkUrl]) {
                 KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-                webCtrl.url = linkUrl;
+                webCtrl.url = [linkUrl getUrlEndcodeString];
                 [weakSelf.navigationController pushViewController:webCtrl animated:YES];
             }
         }
@@ -1081,7 +1081,7 @@
             }
             else {
                 KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-                webCtrl.url = model.linkUrl;
+                webCtrl.url = [model.linkUrl getUrlEndcodeString];
                 [self.navigationController pushViewController:webCtrl animated:YES];
             }
             
@@ -1321,11 +1321,11 @@
     if (![NSString isEmptyString:model.linkUrl]) {
         if ([model.linkType isEqualToString:@"OUT"]) {
             // 外部浏览器打开
-            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:model.linkUrl] options: @{} completionHandler: nil];
+            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[model.linkUrl getUrlEndcodeString]] options: @{} completionHandler: nil];
         }
         else {
             KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-            webCtrl.url = model.linkUrl;
+            webCtrl.url = [model.linkUrl getUrlEndcodeString];
             [self.navigationController pushViewController:webCtrl animated:YES];
         }
     }
@@ -2191,7 +2191,7 @@
     NSString *linkUrl = self.buttonModel.linkUrl;
     if ([self.buttonModel.linkType isEqualToString:@"OUT"]) {
         // 外部浏览器打开
-        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:linkUrl] options: @{} completionHandler: nil];
+        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[linkUrl getUrlEndcodeString]] options: @{} completionHandler: nil];
     }
     else {
         if (![NSString isEmptyString:linkUrl]) {

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/NoticeCenter/Controller/NotiferMessageViewController.m

@@ -266,7 +266,7 @@
                 NSString *webUrl = [dict ks_stringValueForKey:@"url"];
                 if (![NSString isEmptyString:webUrl]) {
                     KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-                    webCtrl.url = webUrl;
+                    webCtrl.url = [webUrl getUrlEndcodeString];
                     CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
                     [navCtrl pushViewController:webCtrl animated:YES];
                 }

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomePageView/HomeInformationBodyView.m

@@ -142,7 +142,7 @@
     
     if ([model.linkType isEqualToString:@"OUT"]) {
         // 外部浏览器打开
-        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:model.linkUrl] options: @{} completionHandler: nil];
+        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[model.linkUrl getUrlEndcodeString]] options: @{} completionHandler: nil];
     }
     else {
         // 跳转

+ 4 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Scan/Controller/KSScanViewController.m

@@ -106,6 +106,7 @@
     if (result) {
         [self stopScan];
         if ([result containsString:hostURL]) {
+            result = [result getUrlEndcodeString];
             KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
             webCtrl.url = result;
             [self.navigationController pushViewController:webCtrl animated:YES];
@@ -114,6 +115,9 @@
             [self backPreView];
         }
     }
+    else {
+        [self backPreView];
+    }
 }
 
 - (void)backPreView {