无故事王国
2023-12-22 3bb9ef528199cab12e5f9b3bbf1064cfa296caaa
WanPai/Common/VC/CommonScanQRCodeVC.swift
@@ -148,25 +148,39 @@
   }
   private func limitFaild(){
      let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
      let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
         self.navigationController?.popViewController(animated: true)
      })
      let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
         let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
         if UIApplication.shared.canOpenURL(settingUrl as URL){
            if #available(iOS 10.0, *) {
               UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
            } else {
               UIApplication.shared.openURL(settingUrl as URL)
      DispatchQueue.main.async {
         let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
         let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
            if self.qmui_isPresented(){
               self.dismiss(animated: true)
            }else{
               self.navigationController?.popViewController(animated: true)
            }
         }
      })
         })
      alertController.addAction(cancelAction)
      alertController.addAction(okAction)
      self.present(alertController, animated: true, completion: nil)
         let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
            if self.qmui_isPresented(){
               self.dismiss(animated: true)
            }else{
               self.navigationController?.popViewController(animated: true)
            }
            let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
            if UIApplication.shared.canOpenURL(settingUrl as URL){
               if #available(iOS 10.0, *) {
                  UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
               } else {
                  UIApplication.shared.openURL(settingUrl as URL)
               }
            }
         })
         alertController.addAction(cancelAction)
         alertController.addAction(okAction)
         self.present(alertController, animated: true, completion: nil)
      }
   }
   func checkCameraAuth() -> Bool {