askbot-dragon 1.3.47 → 1.3.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.3.47",
3
+ "version": "1.3.49",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -152,16 +152,28 @@ export default {
152
152
  }
153
153
  return
154
154
  } else {
155
- // let a = document.createElement('a')
156
- // a.href = res.data
157
- // a.download = (this.title) + fileType
158
- // a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
159
- this.close()
160
- Toast('请稍后...');
161
155
  // setTimeout(() =>{
162
156
  // window.open(res.data,'下载', 'noopener')
163
157
  // }, 2000)
164
- window.open(res.data,'下载', 'noopener')
158
+ // window.open(res.data,'下载', 'noopener')
159
+ if(isMobile()) {
160
+ const iframe = document.createElement("iframe");
161
+ iframe.setAttribute("hidden", "hidden");
162
+ iframe.onload = () => {
163
+ if (iframe) {
164
+ console.log("iframe onload....")
165
+ iframe.setAttribute('src', 'about:blank');
166
+ }
167
+ };
168
+ } else {
169
+ let a = document.createElement('a')
170
+ a.href = res.data
171
+ a.download = (this.title) + fileType
172
+ a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
173
+ }
174
+ document.body.insertBefore(iframe, null);
175
+ iframe.setAttribute("src", res.data);
176
+ this.close()
165
177
  }
166
178
  }
167
179
  })