浏览代码

Add check protocol qrcode

marinofaggiana 6 年之前
父节点
当前提交
fadec0dc2b
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      iOSClient/Login/CCLogin.m

+ 5 - 0
iOSClient/Login/CCLogin.m

@@ -279,6 +279,11 @@
             self.password.text = [valueArray[1] stringByReplacingOccurrencesOfString:@"password:" withString:@""];
             self.baseUrl.text = [valueArray[2] stringByReplacingOccurrencesOfString:@"server:" withString:@""];
             
+            // Check whether baseUrl contain protocol. If not add https:// by default.
+            if(![self.baseUrl.text hasPrefix:@"https"] && ![self.baseUrl.text hasPrefix:@"http"]) {
+                self.baseUrl.text = [NSString stringWithFormat:@"https://%@",self.baseUrl.text];
+            }
+            
             [self handleButtonLogin:self];
         }
     }