修改打包下载api

This commit is contained in:
jmal 2020-10-13 18:01:19 +08:00
parent a7ed85d2db
commit fbbcd72f19
4 changed files with 2502 additions and 2420 deletions

File diff suppressed because it is too large Load Diff

View File

@ -556,15 +556,15 @@
} else {
fileIds.push(this.rowContextData.id)
}
if(process.env.NODE_ENV !== 'development'){
let host = window.location.host
if(window.location.port.length > 0){
host = window.location.host.substring(0,window.location.host.length - window.location.port.length - 1)
}
window.open(`${document.location.protocol}//${host}:10010/download?jmal-token=${this.$store.state.user.token}&fileIds=${fileIds}`,'_self')
}else{
window.open(process.env.VUE_APP_BASE_FILE_API + '/download?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds, '_self')
let host = window.location.host
if (window.location.port.length > 0) {
host = window.location.host.substring(0, window.location.host.length - window.location.port.length - 1)
}
let api = '/api/packageDownload'
if (fileIds.length === 1 && !this.rowContextData.isFolder) {
api = '/api/download'
}
window.open(`${document.location.protocol}//${host}${api}?jmal-token=${this.$store.state.user.token}&fileIds=${fileIds}`, '_self')
} else {
this.$message({
message: '所选文件夹为空',

View File

@ -867,16 +867,15 @@
} else {
fileIds.push(this.rowContextData.id)
}
if(process.env.NODE_ENV !== 'development'){
let host = window.location.host
if(window.location.port.length > 0){
host = window.location.host.substring(0,window.location.host.length - window.location.port.length - 1)
}
window.open(`${document.location.protocol}//${host}:10010/public/s/download?&share=${this.shareId}&fileIds=${fileIds}`,'_self')
}else{
window.open(process.env.VUE_APP_BASE_FILE_API + `/public/s/download?&share=${this.shareId}&fileIds=${fileIds}`, '_self')
let host = window.location.host
if (window.location.port.length > 0) {
host = window.location.host.substring(0, window.location.host.length - window.location.port.length - 1)
}
let api = '/api/packageDownload'
if (fileIds.length === 1 && !this.rowContextData.isFolder) {
api = '/api/download'
}
window.open(`${document.location.protocol}//${host}${api}?jmal-token=${this.$store.state.user.token}&fileIds=${fileIds}`, '_self')
} else {
this.$message({
message: '所选文件为空',

View File

@ -818,16 +818,15 @@
} else {
fileIds.push(this.rowContextData.id)
}
if(process.env.NODE_ENV !== 'development'){
let host = window.location.host
if(window.location.port.length > 0){
host = window.location.host.substring(0,window.location.host.length - window.location.port.length - 1)
}
window.open(`${document.location.protocol}//${host}:10010/public/s/download?&share=${this.shareId}&fileIds=${fileIds}`,'_self')
}else{
window.open(process.env.VUE_APP_BASE_FILE_API + `/public/s/download?&share=${this.shareId}&fileIds=${fileIds}`, '_self')
let host = window.location.host
if (window.location.port.length > 0) {
host = window.location.host.substring(0, window.location.host.length - window.location.port.length - 1)
}
let api = '/api/packageDownload'
if (fileIds.length === 1 && !this.rowContextData.isFolder) {
api = '/api/download'
}
window.open(`${document.location.protocol}//${host}${api}?jmal-token=${this.$store.state.user.token}&fileIds=${fileIds}`, '_self')
} else {
this.$message({
message: '所选文件为空',