fix:登录页面样式调整, ‘sys/license/token’ 接口导出的文件名 从返回头部获取
This commit is contained in:
@@ -164,7 +164,7 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-between;
|
||||||
.license-info {
|
.license-info {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
color: white;
|
color: white;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<!-- <div v-if="!license.valid" class="license-info">INSTALLATION ID: {{license.token}}</div>-->
|
<!-- <div v-if="!license.valid" class="license-info">INSTALLATION ID: {{license.token}}</div>-->
|
||||||
<div v-if="!license.valid" class="license-upload">
|
<div v-if="!license.valid" class="license-upload">
|
||||||
<!-- <button type="button" class="login-btn" @click="downloadMib"><span style="margin-right: 5px"><i class="nz-icon nz-icon-download1"></i></span>{{$t('license.dowLicense')}}</button>-->
|
<!-- <button type="button" class="login-btn" @click="downloadMib"><span style="margin-right: 5px"><i class="nz-icon nz-icon-download1"></i></span>{{$t('license.dowLicense')}}</button>-->
|
||||||
<button type="button" class="login-btn download-btn" @click="downloadLogin"><span style="margin-right: 5px"><i class="nz-icon nz-icon-download1"></i></span>{{$t('login.download')}}</button>
|
<button type="button" class="login-btn download-btn" @click="downloadLogin"><span style="margin-right: 5px"><i class="nz-icon nz-icon-download1"></i></span>{{$t('license.downloadID')}}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="license-upload" v-if="!license.valid">
|
<div class="license-upload" v-if="!license.valid">
|
||||||
<el-upload
|
<el-upload
|
||||||
@@ -270,13 +270,17 @@ export default {
|
|||||||
},
|
},
|
||||||
downloadLogin () {
|
downloadLogin () {
|
||||||
this.$get('/sys/license/token').then(res => {
|
this.$get('/sys/license/token').then(res => {
|
||||||
const fileName = 'Login' + '-' + this.getTimeString() + '.xml'
|
let fileName = this.licenseList.id + '-' + this.getTimeString() + '.xml'
|
||||||
|
const resFileName = res.headers['content-disposition'].split('=')[1]
|
||||||
|
if (resFileName) {
|
||||||
|
fileName = resFileName
|
||||||
|
}
|
||||||
if (window.navigator.msSaveOrOpenBlob) {
|
if (window.navigator.msSaveOrOpenBlob) {
|
||||||
// 兼容ie11
|
// 兼容ie11
|
||||||
const blobObject = new Blob([res])
|
const blobObject = new Blob([res.data])
|
||||||
window.navigator.msSaveOrOpenBlob(blobObject, fileName)
|
window.navigator.msSaveOrOpenBlob(blobObject, fileName)
|
||||||
} else {
|
} else {
|
||||||
const url = URL.createObjectURL(new Blob([res]))
|
const url = URL.createObjectURL(new Blob([res.data]))
|
||||||
const a = document.createElement('a')
|
const a = document.createElement('a')
|
||||||
document.body.appendChild(a) // 此处增加了将创建的添加到body当中
|
document.body.appendChild(a) // 此处增加了将创建的添加到body当中
|
||||||
a.href = url
|
a.href = url
|
||||||
|
|||||||
@@ -194,13 +194,17 @@ export default {
|
|||||||
},
|
},
|
||||||
downloadLicense () {
|
downloadLicense () {
|
||||||
this.$get('/sys/license/token').then(res => {
|
this.$get('/sys/license/token').then(res => {
|
||||||
const fileName = this.licenseList.id + '-' + this.getTimeString() + '.xml'
|
let fileName = this.licenseList.id + '-' + this.getTimeString() + '.xml'
|
||||||
|
const resFileName = res.headers['content-disposition'].split('=')[1]
|
||||||
|
if (resFileName) {
|
||||||
|
fileName = resFileName
|
||||||
|
}
|
||||||
if (window.navigator.msSaveOrOpenBlob) {
|
if (window.navigator.msSaveOrOpenBlob) {
|
||||||
// 兼容ie11
|
// 兼容ie11
|
||||||
const blobObject = new Blob([res])
|
const blobObject = new Blob([res.data])
|
||||||
window.navigator.msSaveOrOpenBlob(blobObject, fileName)
|
window.navigator.msSaveOrOpenBlob(blobObject, fileName)
|
||||||
} else {
|
} else {
|
||||||
const url = URL.createObjectURL(new Blob([res]))
|
const url = URL.createObjectURL(new Blob([res.data]))
|
||||||
const a = document.createElement('a')
|
const a = document.createElement('a')
|
||||||
document.body.appendChild(a) // 此处增加了将创建的添加到body当中
|
document.body.appendChild(a) // 此处增加了将创建的添加到body当中
|
||||||
a.href = url
|
a.href = url
|
||||||
|
|||||||
@@ -77,6 +77,12 @@ export function get (url, params) {
|
|||||||
axios.get(url, {
|
axios.get(url, {
|
||||||
params: params
|
params: params
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
|
if (url.indexOf('/sys/license/token') !== -1) {
|
||||||
|
resolve({
|
||||||
|
data: response.data,
|
||||||
|
headers: response.headers
|
||||||
|
})
|
||||||
|
}
|
||||||
resolve(response.data)
|
resolve(response.data)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
if (err.response) {
|
if (err.response) {
|
||||||
|
|||||||
Reference in New Issue
Block a user