add:新增版本发布功能
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<Doc class="right-menu-item hover-effect" />
|
||||
</el-tooltip>-->
|
||||
|
||||
<el-tooltip :content="$t('common.fz')" effect="dark" placement="bottom">
|
||||
<el-tooltip :content="$t('auto.common.fz')" effect="dark" placement="bottom">
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
<notice-icon class="right-menu-item" />
|
||||
@@ -31,23 +31,23 @@
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<span style="display:block;" @click="show = true">
|
||||
<el-dropdown-item>
|
||||
{{ $t('common.Layout_setting') }}
|
||||
{{ $t('auto.common.Layout_setting') }}
|
||||
</el-dropdown-item>
|
||||
</span>
|
||||
<router-link to="/user/center">
|
||||
<el-dropdown-item>
|
||||
{{ $t('common.Personal_center') }}
|
||||
{{ $t('auto.common.Personal_center') }}
|
||||
</el-dropdown-item>
|
||||
</router-link>
|
||||
<span style="display:block;" @click="open">
|
||||
<el-dropdown-item divided>
|
||||
{{ $t('common.Log_out') }}
|
||||
{{ $t('auto.common.Log_out') }}
|
||||
</el-dropdown-item>
|
||||
</span>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-dropdown class="right-menu-item" style="font-size: 14px" trigger="click" @command="langChange">
|
||||
<span class="el-dropdown-link" style="font-size: 18px">
|
||||
<el-dropdown class="right-menu-item" trigger="click" @command="langChange">
|
||||
<span class="el-dropdown-link">
|
||||
{{ language }} <i class="el-icon-caret-bottom" />
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
@@ -66,9 +66,7 @@ import Breadcrumb from '@/components/Breadcrumb'
|
||||
import Hamburger from '@/components/Hamburger'
|
||||
import TopNav from '@/components/TopNav'
|
||||
|
||||
import Doc from '@/components/Doc'
|
||||
import Screenfull from '@/components/Screenfull'
|
||||
import SizeSelect from '@/components/SizeSelect'
|
||||
import Search from '@/components/HeaderSearch'
|
||||
import Avatar from '@/assets/images/avatar.png'
|
||||
import NoticeIcon from '@/views/system/notice/NoticeIcon.vue'
|
||||
@@ -81,9 +79,7 @@ export default {
|
||||
Breadcrumb,
|
||||
Hamburger,
|
||||
Screenfull,
|
||||
SizeSelect,
|
||||
Search,
|
||||
Doc,
|
||||
TopNav
|
||||
},
|
||||
data() {
|
||||
@@ -93,9 +89,6 @@ export default {
|
||||
language: '简体中文'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLang()
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
@@ -120,16 +113,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.setLang(localStorage.getItem('lang'))
|
||||
this.initWebSocket()
|
||||
},
|
||||
methods: {
|
||||
initLang() {
|
||||
// 初始化语言
|
||||
let item = localStorage.getItem('lang')
|
||||
if (item === null) {
|
||||
item = 'zh'
|
||||
}
|
||||
localStorage.setItem('lang', item)
|
||||
this.setLang(item)
|
||||
},
|
||||
// 中英文切换
|
||||
langChange(command) {
|
||||
this.$i18n.locale = command
|
||||
@@ -150,9 +138,9 @@ export default {
|
||||
this.$store.dispatch('app/toggleSideBar')
|
||||
},
|
||||
open() {
|
||||
this.$confirm(this.$t('common.Tip13'), this.$t('common.Tips'), {
|
||||
confirmButtonText: this.$t('common.Confirm'),
|
||||
cancelButtonText: this.$t('common.Cancel'),
|
||||
this.$confirm(this.$t('auto.common.Tip13'), this.$t('auto.common.Tips'), {
|
||||
confirmButtonText: this.$t('auto.common.Confirm'),
|
||||
cancelButtonText: this.$t('auto.common.Cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.logout()
|
||||
@@ -162,6 +150,38 @@ export default {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.reload()
|
||||
})
|
||||
},
|
||||
initWebSocket() {
|
||||
// const wsUri = (process.env.VUE_APP_WS_API === '/' ? '/' : (process.env.VUE_APP_WS_API + '/')) + 'messageInfo'
|
||||
const wsUri = window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/' + 'messageInfo'
|
||||
this.websock = new WebSocket(wsUri)
|
||||
this.websock.onerror = this.webSocketOnError
|
||||
this.websock.onmessage = this.webSocketOnMessage
|
||||
},
|
||||
webSocketOnError(e) {
|
||||
this.$notify({
|
||||
title: this.$t('auto.common.Tip14'),
|
||||
type: 'error',
|
||||
duration: 0
|
||||
})
|
||||
},
|
||||
webSocketOnMessage(e) {
|
||||
const data = JSON.parse(e.data)
|
||||
if (data.msgType === 'INFO') {
|
||||
if (data.msg.data === 'notice_message_update') {
|
||||
this.$bus.emit(data.msg.data, data.msg.msgType)
|
||||
} else if (data.msg.data === 'version_update') {
|
||||
this.$bus.emit('version_update', data.msg)
|
||||
}
|
||||
} else if (data.msgType === 'ERROR') {
|
||||
this.$notify({
|
||||
title: '',
|
||||
message: data.msg,
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'error',
|
||||
duration: 0
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user