Browse Source

fix: webviewer 入口文件修复无 pdfUrl 参数bug

liutian 3 months ago
parent
commit
dd7da0e59a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      packages/core/webviewer.js

+ 2 - 0
packages/core/webviewer.js

@@ -81,6 +81,8 @@ class Viewer {
     let webviewerUrl = this.options.webviewerPath
     let webviewerUrl = this.options.webviewerPath
     if (this.initialDoc) {
     if (this.initialDoc) {
       webviewerUrl += "#d=".concat(this.initialDoc)
       webviewerUrl += "#d=".concat(this.initialDoc)
+    } else {
+      webviewerUrl += '#'
     }
     }
     this.options.showToolbarControl !== undefined && (webviewerUrl += "&header=".concat(this.options.showToolbarControl ? "true": "false"))
     this.options.showToolbarControl !== undefined && (webviewerUrl += "&header=".concat(this.options.showToolbarControl ? "true": "false"))
     const iframe = document.createElement("iframe")
     const iframe = document.createElement("iframe")