全局store
小于 1 分钟
全局store
介绍
ASPDEV
内置了基本的全局状态,获取当前登录用户的相关信息,方便开发者使用。
提示
全局状态使用示例
export default {
name: 'MyComponents',
methods: {
test(){
// 获取当前登录的用户ID
const userId = this.$store.getters.userId
}
}
......
用户ID
this.$store.getters.userId
用户名称
this.$store.getters.username
部门ID
this.$store.getters.deptId
用户token
this.$store.getters.token