         
         p_constructSubviews()
 
-        if let workFolder = _workFolderURL {
-            if #available(iOS 9.0, *) {
-                webView.loadFileURL(workFolder.URLByAppendingPathComponent(_indexPath), allowingReadAccessToURL: workFolder)
-            } else {
-                let url = workFolder.URLByAppendingPathComponent(_indexPath)
-                webView.loadRequest(NSURLRequest(URL: url))
+        let wholeURL = _baseURL.URLByAppendingPathComponent(_indexPath)
+        if #available(iOS 9.0, *) {
+            if _baseURL.fileURL {
+                webView.loadFileURL(wholeURL, allowingReadAccessToURL: _baseURL)
+                return
             }
         }
+        webView.loadRequest(NSURLRequest(URL: wholeURL))
     }
-    
+
     override public func didReceiveMemoryWarning() {
         super.didReceiveMemoryWarning()
         // Dispose of any resources that can be recreated.



    // MARK: - Private properties
    private var _loadFileURL: NSURL?

    private var _workFolderURL: NSURL?
    private var _indexPath: String = "index.html"

}



    // MAKR: - init
    public init?(baseURL: NSURL, indexPath: String) {
        super.init(nibName: nil, bundle: nil)

        if baseURL.fileURL {
            // 如果是本地文件，则判断对应文件夹是否存在
            var isDirectory: ObjCBool = ObjCBool(false)
            let fileFolderPath = baseURL.path ?? ""
            let isExist = NSFileManager.defaultManager().fileExistsAtPath(fileFolderPath, isDirectory: &isDirectory)
            if !isExist || !isDirectory.boolValue {
                print("\(fileFolderPath) does not exist" )
                return nil
            }
        }

        _baseURL = baseURL
        _indexPath = indexPath

    }

