-
-
Save pankajjha/ae0da57176923affcc0a467e1ae42652 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* First we will load all of this project's JavaScript dependencies which | |
* includes Vue and other libraries. It is a great starting point when | |
* building robust, powerful web applications using Vue and Laravel. | |
*/ | |
require('./bootstrap'); | |
import Vue from 'vue' | |
import VueRouter from 'vue-router' | |
import BootstrapVue from 'bootstrap-vue' //Importing | |
// Installing whole coreui-package | |
import CoreuiVue from '@coreui/vue'; | |
//import { freeSet } from '@coreui/icons' | |
import { iconsSet as icons } from './components/icons/icons.js' | |
import store from "./store"; | |
import routes from './router' | |
import Multiselect from 'vue-multiselect' | |
import VueSession from 'vue-session' | |
import VueBus from 'vue-bus'; | |
import axios from 'axios'; | |
import VueAxios from 'vue-axios'; | |
import {createAuth} from '@websanova/vue-auth/dist/v3/vue-auth'; | |
import driverAuthBearer from '@websanova/vue-auth/dist/drivers/auth/bearer.esm.js'; | |
import driverHttpAxios from '@websanova/vue-auth/dist/drivers/http/axios.1.x.esm.js'; | |
import driverRouterVueRouter from '@websanova/vue-auth/dist/drivers/router/vue-router.2.x.esm.js'; | |
Vue.use(VueRouter) | |
Vue.use(BootstrapVue) | |
Vue.use(CoreuiVue); | |
Vue.use(VueAxios, axios); | |
//importing session | |
var options = { | |
persist: true | |
} | |
Vue.use(VueSession, options) | |
//importing vue-bus | |
Vue.use(VueBus); | |
// register globally | |
Vue.component('multiselect', Multiselect) | |
Vue.component('FrontendLayout', require('./components/Frontend/Layout.vue').default); | |
Vue.component('InternalLayout', require('./components/Internal/Layout.vue').default); | |
Vue.component('BackendLayout', require('./components/Backend/Layout.vue').default); | |
Vue.component('csrf', require('./components/Csrf.vue').default); | |
Vue.component('geotargetSearchBox', require('./components/GeotargetSearchBox.vue').default); | |
const router = new VueRouter(routes); | |
Vue.router = router; | |
axios.defaults.baseURL = `http://xxx.test/api` | |
var auth = createAuth({ | |
plugins: { | |
http: axios, | |
router: router | |
}, | |
drivers: { | |
http: driverHttpAxios, | |
auth: driverAuthBearer, | |
router: driverRouterVueRouter, | |
}, | |
options: { | |
rolesKey: 'type', | |
notFoundRedirect: {name: 'user-account'}, | |
} | |
}); | |
Vue.use(auth); | |
/** | |
* Next, we will create a fresh Vue application instance and attach it to | |
* the page. Then, you may begin adding components to this application | |
* or customize the JavaScript scaffolding to fit your unique needs. | |
*/ | |
const app = new Vue({ | |
el: '#app', | |
store, | |
icons, | |
router: router, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment