把.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)
}
}
}
+2 -2
View File
@@ -44,6 +44,7 @@
size="large"
type="text"
@change="inputCodeChange"
autocomplete="off"
placeholder="请输入验证码">
<a-icon slot="prefix" type="safety" :style="{ color: '#B3B7C2',fontSize:'20px'}"/>
</a-input>
@@ -93,7 +94,6 @@
</a-form>
<a-form v-if="mobile" :form="form" class="user-layout-login user-layout-login-mobile" ref="formLogin" id="formLogin">
<div class="user-box user-box-mobile">
<!--<span class="title">用户登录</span>-->
<a-row>
<a-col :span="24">
<a-form-item>
@@ -241,7 +241,7 @@
loginParams.remember_me = values.rememberMe
loginParams.captcha = that.inputCodeContent
loginParams.checkKey = that.currdatetime
console.log("登录参数",loginParams)
// console.log("登录参数",loginParams)
that.Login(loginParams).then((res) => {
//登录成功
this.loginSuccess()