提交 f8078b01 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

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

上级 772595bf
<template> <template>
<div v-if="!licstatus" class="lic"> <div v-if="!licstatus" class="lic">
<strong>{{ msg }}</strong> <strong>{{ licMsg }}</strong>
</div> </div>
</template> </template>
...@@ -22,6 +22,9 @@ export default { ...@@ -22,6 +22,9 @@ export default {
}, },
licstatus() { licstatus() {
return this.$store.state.lic.validate return this.$store.state.lic.validate
},
licMsg() {
return this.$store.state.lic.licMsg
} }
}, },
......
...@@ -23,6 +23,7 @@ const getters = { ...@@ -23,6 +23,7 @@ const getters = {
dialogWidgetMap: state => state.application.dialogWidgetMap, dialogWidgetMap: state => state.application.dialogWidgetMap,
drawWidgetMap: state => state.application.drawWidgetMap, drawWidgetMap: state => state.application.drawWidgetMap,
validate: state => state.lic.validate, validate: state => state.lic.validate,
licMsg: state => state.lic.licMsg,
uiInfo: state => state.user.uiInfo uiInfo: state => state.user.uiInfo
} }
export default getters export default getters
import { validateLic } from '@/api/system/lic' import { validateLic } from '@/api/system/lic'
const state = { const state = {
validate: true validate: true,
licMsg: null
} }
const mutations = { const mutations = {
SET_VALIDATE: (state, data) => { SET_VALIDATE: (state, data) => {
state.validate = data state.validate = data
},
SET_LIC_MSG: (state, msg) => {
state.licMsg = msg
} }
} }
...@@ -19,9 +23,11 @@ const actions = { ...@@ -19,9 +23,11 @@ const actions = {
validateLic().then(response => { validateLic().then(response => {
const { data } = response const { data } = response
commit('SET_VALIDATE', true) commit('SET_VALIDATE', true)
commit('SET_LIC_MSG', null)
resolve(data) resolve(data)
}).catch(error => { }).catch(error => {
commit('SET_VALIDATE', false) commit('SET_VALIDATE', false)
commit('SET_LIC_MSG', error.response.data.message)
reject(error) reject(error)
}) })
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论