md
This commit is contained in:
parent
218d027ddc
commit
2cd25f5250
@ -17,7 +17,7 @@ import directive from './directive' // directive
|
||||
import plugins from './plugins' // plugins
|
||||
// const ElectronStore = require('electron-store');
|
||||
// const electronStore = new ElectronStore({encryptionKey: '123456'});
|
||||
import { download } from '@/utils/request'
|
||||
import { download,getRemoteFile } from '@/utils/request'
|
||||
import { triggerTrans } from '@/utils/custom'
|
||||
import TanexPrinterSdk from '@/utils/TanexPrinterSdk'
|
||||
import XDNoticeSdk from '@/utils/XDNoticeSdk'
|
||||
@ -92,6 +92,7 @@ Vue.prototype.selectDictLabels = selectDictLabels
|
||||
Vue.prototype.addExportAuditRecord = addExportAuditRecord
|
||||
|
||||
Vue.prototype.download = download
|
||||
Vue.prototype.download = getRemoteFile
|
||||
Vue.prototype.handleTree = handleTree
|
||||
Vue.prototype.handleOptions = handleOptions
|
||||
Vue.prototype.Base64 = Base64
|
||||
|
||||
@ -175,5 +175,21 @@ export function download(url, params, filename) {
|
||||
})
|
||||
}
|
||||
|
||||
// 通用下载方法
|
||||
export function getRemoteFile(url, params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
service.post(url, params, {
|
||||
transformRequest: [(params) => { return tansParams(params) }],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
responseType: 'arraybuffer'
|
||||
}).then(async (data) => {
|
||||
resolve(data.data)
|
||||
}).catch((r) => {
|
||||
reject(error.toString())
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
export default service
|
||||
|
||||
@ -518,24 +518,6 @@ export default {
|
||||
}
|
||||
|
||||
},
|
||||
getRemoteFile(url,params){
|
||||
return new Promise((resolve, reject) => {
|
||||
axios({
|
||||
method:'post',
|
||||
url,
|
||||
transformRequest: [(params) => { return tansParams(params) }],
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-Token':getToken()
|
||||
},
|
||||
responseType: 'arraybuffer'
|
||||
}).then(data => {
|
||||
resolve(data.data)
|
||||
}).catch(error => {
|
||||
reject(error.toString())
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user