Blame view

ant-design-vue-jeecg/src/store/getters.js 1.04 KB
肖超群 authored
1
import Vue from 'vue'
肖超群 authored
2
3
import {USER_INFO, ENHANCE_PRE} from "@/store/mutation-types"
肖超群 authored
4
5
6
7
8
const getters = {
  device: state => state.app.device,
  theme: state => state.app.theme,
  color: state => state.app.color,
  token: state => state.user.token,
肖超群 authored
9
10
11
12
  avatar: state => {
    state.user.avatar = Vue.ls.get(USER_INFO).avatar;
    return state.user.avatar
  },
肖超群 authored
13
  username: state => state.user.info.username,
肖超群 authored
14
15
16
17
  nickname: state => {
    state.user.info.realname = Vue.ls.get(USER_INFO).realname;
    return state.user.info.realname
  },
肖超群 authored
18
19
  welcome: state => state.user.welcome,
  permissionList: state => state.user.permissionList,
肖超群 authored
20
21
22
23
  userInfo: state => {
    state.user.info = Vue.ls.get(USER_INFO);
    return state.user.info
  },
肖超群 authored
24
  addRouters: state => state.permission.addRouters,
肖超群 authored
25
26
27
28
29
  onlAuthFields: state => {
    return state.online.authFields
  },
  enhanceJs: (state) => (code) => {
    state.enhance.enhanceJs[code] = Vue.ls.get(ENHANCE_PRE + code);
肖超群 authored
30
31
32
33
34
35
36
    return state.enhance.enhanceJs[code]
  },
  sysSafeMode: state => state.user.sysSafeMode,

}

export default getters