Commit 7882de70 by liangzhen

下载功能

1 parent e603c8d3
// import request from '@/utils/request' // import request from '@/utils/request'
// let mainURL="192.168.8.248:18101" // let mainURL="192.168.8.248:18101"
var qs = require('qs')
import { get, post, download } from '@/utils/http' import { get, post, download } from '@/utils/http'
...@@ -251,3 +252,8 @@ export function tjrectificationVerification(params) { ...@@ -251,3 +252,8 @@ export function tjrectificationVerification(params) {
export function materialSync(params) { export function materialSync(params) {
return post(`/arch-evaluation/materialSync/`, params) return post(`/arch-evaluation/materialSync/`, params)
} }
//下载
export function downloadObject(params) {
return post(`/arch-evaluation/oss/downloadObject`, qs.stringify(params))
}
...@@ -26,6 +26,10 @@ function decryptStringBySM4_CBC(str) {//使用sm4-cbc算法给字符串解密 ...@@ -26,6 +26,10 @@ function decryptStringBySM4_CBC(str) {//使用sm4-cbc算法给字符串解密
axios.interceptors.request.use(config => { axios.interceptors.request.use(config => {
config.headers['X-USER'] =sessionStorage.getItem('author'); config.headers['X-USER'] =sessionStorage.getItem('author');
config.headers['X-USER-NAME']=sessionStorage.getItem('authorName') config.headers['X-USER-NAME']=sessionStorage.getItem('authorName')
console.log(config.url.indexOf('oss/downloadObject')!='-1','config.url')
if(config.url.indexOf('oss/downloadObject')!='-1'){
config.headers["Content-Type"] ='application/x-www-form-urlencoded'
}
// config.headers.token = JSON.parse(localStorage.getItem('token')).token; // config.headers.token = JSON.parse(localStorage.getItem('token')).token;
......
...@@ -546,7 +546,9 @@ export default { ...@@ -546,7 +546,9 @@ export default {
//_blank表示在新窗口打开链接 //_blank表示在新窗口打开链接
// link.target = '_blank' // link.target = '_blank'
// link.href =scope.url // link.href =scope.url
window.open(scope.url, '_blank'); if(scope.url){
window.open(scope.url, "_blank");
}
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!