把.env.development和.env.production的配置服务路径单独拿出,做成静态资源

This commit is contained in:
yaoyanan
2021-04-01 16:37:58 +08:00
parent 040a16bcb7
commit e407e8e426
15 changed files with 290 additions and 91 deletions
+10 -24
View File
@@ -37,21 +37,7 @@
@change="handleChange">
<a-button>
<a-icon type="upload"/>
OSS文件上传
</a-button>
</a-upload>
<a-upload
name="file"
:multiple="false"
:action="minioUploadAction"
:headers="tokenHeader"
:showUploadList="false"
:beforeUpload="beforeUpload"
@change="handleChange">
<a-button>
<a-icon type="upload"/>
MINIO文件上传
文件上传
</a-button>
</a-upload>
</div>
@@ -91,7 +77,9 @@
<script>
import {JeroListMixin} from '@/mixins/JeroListMixin'
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
const Base64 = require('js-base64').Base64
export default {
name: "OSSFileList",
mixins: [JeroListMixin],
@@ -128,20 +116,16 @@
}
],
url: {
upload: "/sys/oss/file/upload",
upload: "/sys/common/upload",
list: "/sys/oss/file/list",
delete: "/sys/oss/file/delete",
minioUpload: "/sys/upload/uploadMinio"
}
}
},
computed: {
uploadAction() {
return window._CONFIG['domianURL'] + this.url.upload;
},
minioUploadAction() {
return window._CONFIG['domianURL'] + this.url.minioUpload;
},
}
},
methods: {
beforeUpload(file) {
@@ -160,6 +144,7 @@
return true
},
handleChange(info) {
console.log("ok")
if (info.file.status === 'done') {
if (info.file.response.success) {
this.loadData()
@@ -183,8 +168,9 @@
},
handlePreview(record) {
if (record && record.url) {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(record.url)
window.open(url, '_blank')
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${record.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.fileName}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url)
}
}
}