Commit 33b42e0a by qlintonger xeno

开始配置ws+2

parent f82a34aa
......@@ -18,6 +18,7 @@ import config from '../project.app.config'
import useUserStore from '@/store/user'
import { wsShouldOpen } from 'AnyR/states/coreState'
import { storeToRefs } from 'pinia'
import {userStates} from "AnyR/states/wsStates";
const { loading, loadText } = storeToRefs(useAppStore())
......@@ -55,6 +56,8 @@ router.beforeEach(async (to, from, next) => {
const token = userStore.token
if (token) {
wsShouldOpen.value = true
userStates.value.currentUserId = userStore.user_info.id
userStates.value.currentUserName = userStore.user_info.username
// 登录
if (to.name == 'Login') {
next({ path: './' })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment