From faea6377d3f684f4034b4ab98a8d1f683929f007 Mon Sep 17 00:00:00 2001 From: Gk40002148 Date: Thu, 19 May 2022 16:14:12 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=82=A4=E3=83=B3QR=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=83=89=E6=99=82=E3=81=AB=E6=89=80=E5=AE=9A=E3=81=AE?= =?UTF-8?q?=E3=82=AD=E3=83=BC=E3=81=8C=E5=85=B1=E3=81=AB=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AB=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=82=89=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Login/View/LoginViewController.swift | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/AgileWorks/AgileWorks/Login/View/LoginViewController.swift b/AgileWorks/AgileWorks/Login/View/LoginViewController.swift index 41d1217..b475d2b 100644 --- a/AgileWorks/AgileWorks/Login/View/LoginViewController.swift +++ b/AgileWorks/AgileWorks/Login/View/LoginViewController.swift @@ -65,7 +65,7 @@ class LoginViewController: UIViewController { KeychainDataStore().removeSessionID() KeychainDataStore().removeLanguage() KeychainDataStore().removeDeviceID() - + //ウィジェットの更新 if #available(iOS 14.0, *) { WidgetCenter.shared.reloadAllTimelines() @@ -379,21 +379,22 @@ extension LoginViewController: AVCaptureMetadataOutputObjectsDelegate { do { // JSON をパースする let loginQr = try JSONSerialization.jsonObject(with: jsonData) as! Dictionary - print(loginQr["system_url"] as! String) // サーバーテキストボックス / コンテキストパステキストボックスに 値をセット let system = (loginQr["system_url"] as? String)?.replacingOccurrences(of: self.serverProtocol, with: "") let mobile = (loginQr["mobile_system_url"] as? String)?.replacingOccurrences(of: self.serverProtocol, with: "") var serverUrl = "" if mobile != nil && !mobile!.isEmpty { serverUrl = mobile! - } else { + } else if system != nil && !system!.isEmpty { serverUrl = system! } - let serverInfo: [String] = serverUrl.components(separatedBy: "/") - if !serverInfo.isEmpty { - serverTextField.text = serverInfo[0] - if serverInfo.count >= 2 { - contextTextField.text = serverInfo[1] + if !serverUrl.isEmpty { + let serverInfo: [String] = serverUrl.components(separatedBy: "/") + if !serverInfo.isEmpty { + serverTextField.text = serverInfo[0] + if serverInfo.count >= 2 { + contextTextField.text = serverInfo[1] + } } } loginButton.isEnabled = isTextFieldValue() -- GitLab