1.0.0 • Published 6 years ago

wquser v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

##Module User Module with CRUD for users, and profile admin.

##Required

####Plugins

  • helper
  • vuelidate
  • axios

##Usage

####Routes and Middleware

In file src/router/routes add:

import user from '@wegoo/quser/_router/routes' //Routes module
import auth from '@wegoo/quser/_router/middlewares/auth' //Middleware auth
import access from '@wegoo/quser/_router/middlewares/access' //Middleware access

####Stores

In file src/store/index add:

import auth from '@wegoo/quser/_store/auth/index'; //Import this file //Import this file
Vue.use(Vuex)
const store = new Vuex.Store({
  modules: {
    auth //Add authStore
  }
});

####Config

In file src/config/index add:

import auth from '@wegoo/quser/_config/auth'; //Import this file

####Sidebar in file src/config/slidebar add:

/*User*/
user: {
  title: 'Users',
  icon: 'fas fa-users',
  children: [
    {
      title: 'Create',
      icon: 'fas fa-user-plus',
      to: 'user.users.create',
      can:'user.users.create'
    },
    {
      title: 'List/Search',
      icon: 'fas fa-list-alt',
      to: 'user.users.index',
      can:'user.users.index'
    },
    {
      title: 'My profile',
      icon: 'fas fa-user-tie',
      to: 'user.profile.me'
    },
    {
      title: 'Departments',
      icon: 'fas fa-cube',
      to: 'user.department'
    }
  ]
},
/*logout*/
logout: {
  title: 'Sign out',
  icon: 'fas fa-sign-out-alt',
  to: 'auth.logout'
}

##Components

  • widget-use: component with route to my profile and sign out:

import WidgetUser from "@wegoo/quser/_components/widget-user";

##Plugins

  • auth: plugin with method hasAccess for validate user permisions import {authPlugin} from "@wegoo/quser/_plugins/auth"; or define it in data likeauth: require('@wegoo/quser/_plugins/auth').default