| | |
| | | import RightPanel from '@/components/RightPanel' |
| | | import Settings from '../components/Settings/index' |
| | | import * as signalR from '@aspnet/signalr' |
| | | import { ButtonData } from '@/api/basicSettings' |
| | | import Vue from 'vue' |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | // this.$signalr.start() |
| | | this.usercode = getCookie('navTabId') |
| | | this.username = getCookie('username') |
| | | this.stu_torgname = getCookie('stu_torgname') === '' ? '系统管理员' : getCookie('stu_torgname') |
| | | this.stu_torgname = getCookie('stu_torgname') |
| | | }, |
| | | mounted() { |
| | | this.getHubConnectionBuilder() |
| | | // this.getHubConnectionBuilder() |
| | | |
| | | this.getButtonData() |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | // 获取全局按钮键值对 |
| | | async getButtonData() { |
| | | const { data: res } = await ButtonData() |
| | | Vue.prototype.$ButtonData = res // 用于全局 |
| | | }, |
| | | |
| | | // 建立hub连接 |
| | | async getHubConnectionBuilder() { |
| | | const url = 'http://121.196.36.24:8019/chatHub' |
| | |
| | | this.$store.dispatch('app/toggleSideBar') |
| | | }, |
| | | async logout() { |
| | | localStorage.removeItem('token') |
| | | await this.signalr.stop() |
| | | this.signalr.off('SendCustomUserMessage') |
| | | // await this.signalr.stop() |
| | | // this.signalr.off('SendCustomUserMessage') |
| | | await this.$store.dispatch('user/logout') |
| | | this.$message.success('退出成功!') |
| | | localStorage.removeItem('token') |
| | | this.$notify.success('退出成功!') |
| | | this.$router.push(`/login`) |
| | | }, |
| | | editPassword() { |