无故事王国
2023-12-22 3bb9ef528199cab12e5f9b3bbf1064cfa296caaa
WanPai/Common/VC/CommonScanQRCodeVC.swift
@@ -148,12 +148,25 @@
   }
   private func limitFaild(){
      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)
            }
      })
      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, *) {
@@ -168,6 +181,7 @@
      alertController.addAction(okAction)
      self.present(alertController, animated: true, completion: nil)
   }
   }
   func checkCameraAuth() -> Bool {
      let status = AVCaptureDevice.authorizationStatus(for: .video)