 //
 
 import UIKit
+import SVProgressHUD
 
 class LSOAthViewController: UIViewController {
     

        
        //4.请求数据
        webView.loadRequest(request)
        
    }
    
    //私有方法
    
    @objc fileprivate func back() {
        self.dismiss(animated: true, completion: nil)
    }
    
    @objc fileprivate func autoStuff() {
        
        let AutoStuffContent = "document.getElementById('userId').value='13522154166';" +
         "document.getElementById('passwd').value='luoriver';"
        
        //测试javascript注入
//        let AutoStuffContent = "document.getElementById('loginName').value='13522154166';" +
//                            "document.getElementById('loginPassword').value='luoriver';"
        
        webView.stringByEvaluatingJavaScript(from: AutoStuffContent)
    
    }

}

    override func loadView() {
        view = webView
        
        webView.scrollView.isScrollEnabled = false
        webView.backgroundColor = UIColor.white
        
        title = "用户认证界面"
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "返回", target: self, action: #selector(close))
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "自动填充", target: self, action: #selector(autoStuff))
    }
