fix: topBar头部现实lic错误信息

This commit is contained in:
fit2cloud-chenyw 2021-05-18 14:33:48 +08:00
parent 772595bf8a
commit f8078b0196
3 changed files with 12 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<template>
<div v-if="!licstatus" class="lic">
<strong>{{ msg }}</strong>
<strong>{{ licMsg }}</strong>
</div>
</template>
@ -22,6 +22,9 @@ export default {
},
licstatus() {
return this.$store.state.lic.validate
},
licMsg() {
return this.$store.state.lic.licMsg
}
},

View File

@ -23,6 +23,7 @@ const getters = {
dialogWidgetMap: state => state.application.dialogWidgetMap,
drawWidgetMap: state => state.application.drawWidgetMap,
validate: state => state.lic.validate,
licMsg: state => state.lic.licMsg,
uiInfo: state => state.user.uiInfo
}
export default getters

View File

@ -1,11 +1,15 @@
import { validateLic } from '@/api/system/lic'
const state = {
validate: true
validate: true,
licMsg: null
}
const mutations = {
SET_VALIDATE: (state, data) => {
state.validate = data
},
SET_LIC_MSG: (state, msg) => {
state.licMsg = msg
}
}
@ -19,9 +23,11 @@ const actions = {
validateLic().then(response => {
const { data } = response
commit('SET_VALIDATE', true)
commit('SET_LIC_MSG', null)
resolve(data)
}).catch(error => {
commit('SET_VALIDATE', false)
commit('SET_LIC_MSG', error.response.data.message)
reject(error)
})
})