| | |
| | | import { getToken, setToken, removeToken } from '@/utils/auth' |
| | | import defAva from '@/assets/images/profile.jpg' |
| | | import Cookies from "js-cookie"; |
| | | import { defineStore } from 'pinia' |
| | | import {getUserById} from "@/api/onlineEducation/user"; |
| | | const useUserStore = defineStore( |
| | | 'user', |
| | |
| | | token: getToken(), |
| | | id: '', |
| | | name: '', |
| | | companyId: null, |
| | | avatar: '', |
| | | roles: [], |
| | | permissions: [] |
| | |
| | | } |
| | | this.id = user.userId |
| | | this.name = user.userName |
| | | this.companyId = user.companyId |
| | | this.avatar = avatar |
| | | Cookies.set('userInfo',JSON.stringify(user)) |
| | | resolve(res) |