From d8a10a032278cca412af4d71c2c447ef5e4c6597 Mon Sep 17 00:00:00 2001 From: Gk40002148 Date: Thu, 28 Apr 2022 18:00:03 +0900 Subject: [PATCH] =?UTF-8?q?QR=E3=82=B3=E3=83=BC=E3=83=89=E5=86=85=E3=81=AB?= =?UTF-8?q?"mobile=5Fsystem=5Furl"=E3=81=AE=E8=A8=AD=E5=AE=9A=E3=81=8C?= =?UTF-8?q?=E3=81=82=E3=82=8B=E5=A0=B4=E5=90=88=E3=80=81=E3=81=9D=E3=81=A3?= =?UTF-8?q?=E3=81=A1=E3=82=92=E6=8E=A1=E7=94=A8=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AgileWorks/Login/View/LoginViewController.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/AgileWorks/AgileWorks/Login/View/LoginViewController.swift b/AgileWorks/AgileWorks/Login/View/LoginViewController.swift index efbfca4..62d21f3 100644 --- a/AgileWorks/AgileWorks/Login/View/LoginViewController.swift +++ b/AgileWorks/AgileWorks/Login/View/LoginViewController.swift @@ -333,8 +333,15 @@ extension LoginViewController: AVCaptureMetadataOutputObjectsDelegate { let loginQr = try JSONSerialization.jsonObject(with: jsonData) as! Dictionary print(loginQr["system_url"] as! String) // サーバーテキストボックス / コンテキストパステキストボックスに 値をセット - let temp = (loginQr["system_url"] as? String)?.replacingOccurrences(of: self.serverProtocol, with: "") - let serverInfo: [String] = temp!.components(separatedBy: "/") + 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 { + serverUrl = system! + } + let serverInfo: [String] = serverUrl.components(separatedBy: "/") if !serverInfo.isEmpty { serverTextField.text = serverInfo[0] if serverInfo.count >= 2 { -- GitLab