askbot-dragon 1.3.48 → 1.3.50

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.48",
3
+ "version": "1.3.50",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -152,25 +152,27 @@ 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
- Toast('请稍后...');
160
155
  // setTimeout(() =>{
161
156
  // window.open(res.data,'下载', 'noopener')
162
157
  // }, 2000)
163
158
  // window.open(res.data,'下载', 'noopener')
164
- const iframe = document.createElement("iframe");
165
- iframe.setAttribute("hidden", "hidden");
166
- iframe.onload = () => {
167
- if (iframe) {
168
- console.log("iframe onload....")
169
- iframe.setAttribute('src', 'about:blank');
170
- }
171
- };
172
- document.body.insertBefore(iframe, null);
173
- iframe.setAttribute("src", res.data);
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
+ document.body.insertBefore(iframe, null);
169
+ iframe.setAttribute("src", res.data);
170
+ } else {
171
+ let a = document.createElement('a')
172
+ a.href = res.data
173
+ a.download = (this.title) + fileType
174
+ a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
175
+ }
174
176
  this.close()
175
177
  }
176
178
  }