askbot-dragon 1.1.14 → 1.1.16

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.1.14",
3
+ "version": "1.1.16",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -133,38 +133,41 @@ export default {
133
133
  methods: {
134
134
  //预览图片
135
135
  lookAttach(url, item) {
136
- let index = url.lastIndexOf('?')
137
- let type = ''
138
- let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
139
- if (index !== -1) {
140
- url = url.substring(0, index)
141
- type = this.fileType(url)
142
- } else {
143
- type = this.fileType(url)
144
- }
145
- if (type === '' || type === 'OTHER') {
146
- httpUrl = httpUrl += '?needEncrypt=true'
147
- } else {
148
- httpUrl = httpUrl += '?needEncrypt=false'
149
- }
150
- this.$http.post(httpUrl, {
151
- "fileInOssPath":url
152
- }).then(res =>{
153
- if(res.data.code == '0') {
154
- this.previewHref = res.data.data
155
- this.$refs.previewPdf.previewShowPopup = true;
156
- this.$refs.previewPdf.fileType = type
157
-
158
- this.$nextTick(() =>{
159
- if(item.srcContent == 'CREATED_BY_ONESELF') {
160
- this.$refs.previewPdf.getBolb(item)
161
- } else {
162
- this.$refs.previewPdf.loadIframe(item)
163
-
164
- }
165
- })
166
- }
167
- })
136
+ window.top.postMessage({
137
+ data: "bot_preview",
138
+ item: JSON.stringify(item),
139
+ url: url
140
+ },"*");
141
+ // let index = url.lastIndexOf('?')
142
+ // let type = ''
143
+ // let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
144
+ // if (index !== -1) {
145
+ // url = url.substring(0, index)
146
+ // type = this.fileType(url)
147
+ // } else {
148
+ // type = this.fileType(url)
149
+ // }
150
+ // if (type === '' || type === 'OTHER') {
151
+ // httpUrl = httpUrl += '?needEncrypt=true'
152
+ // } else {
153
+ // httpUrl = httpUrl += '?needEncrypt=false'
154
+ // }
155
+ // this.$http.post(httpUrl, {
156
+ // "fileInOssPath":url
157
+ // }).then(res =>{
158
+ // if(res.data.code == '0') {
159
+ // this.previewHref = res.data.data
160
+ // this.$refs.previewPdf.previewShowPopup = true;
161
+ // this.$refs.previewPdf.fileType = type
162
+ // this.$nextTick(() =>{
163
+ // if(item.source == 'CREATED_BY_ONESELF') {
164
+ // this.$refs.previewPdf.getBolb(item)
165
+ // } else {
166
+ // this.$refs.previewPdf.loadIframe(item)
167
+ // }
168
+ // })
169
+ // }
170
+ // })
168
171
  },
169
172
  fileType (url) {
170
173
  const fileType = url.substring(url.lastIndexOf('.'));