const getters = {
  token: state => state.user.token,
  userInfo: state => state.user.userInfo,
  isVip: state => {
    if (state.user.userInfo && state.user.userInfo.expireTime) {
      let expireTime = new Date(state.user.userInfo.expireTime).getTime()
      let nowTime = new Date().getTime()
      if (expireTime >= nowTime) {
        return true
      }
      else {
        return false
      }

    } else {
      return false
    }
  },
  avatar: state => state.user.avatar,
  name: state => state.user.name,
  introduction: state => state.user.introduction,
  roles: state => state.user.roles,
  permissions: state => state.user.permissions
}
export default getters
