client?23da:144 [WDS] Warnings while compiling.
warnings @ client?23da:144
onmessage @ socket.js?e5d0:38
EventTarget.dispatchEvent @ sockjs.js?3600:170
(anonymous) @ sockjs.js?3600:883
SockJS._transportMessage @ sockjs.js?3600:881
EventEmitter.emit @ sockjs.js?3600:86
WebSocketTransport.ws.onmessage @ sockjs.js?3600:2957
client?23da:147 ./src/main.js
63:24-33 "export 'default' (imported as 'AuthStore') was not found in './store/auth.js'
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/main.js
// Главные модули
import Vue from 'vue'
import VueRouter from 'vue-router'
import VeeValidate from 'vee-validate'
import axios from 'axios'
import VueAxios from 'vue-axios'
import Vuex from 'vuex'
// Второстепенные модули
import App from './App.vue'
import Routes from './routes.js'
// Store
import AuthStore from './store/auth.js'
// Styles
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.css'
// Использование главных модулей
Vue.use(VueRouter)
Vue.use(VeeValidate)
Vue.use(VueAxios, axios)
Vue.use(Vuex)
// Использование стилей
Vue.use(Vuetify)
// Настройка модулей
axios.defaults.baseURL = 'http://api.netronedev.ru/api/v1'; // Базовый URL адрес
axios.defaults.headers.common['X-CSRF-TOKEN'] = 'Bearer ' + 'VI6nE01JHHuSalvyJm1ZIjOPhgKNdDGM5QoenE1o'; // Токен
Routes.beforeEach(
(to, from, next) => {
if(to.matched.some(record => record.meta.forVisitors)){
if(Vue.Auth.authCheck()){
next({
path: '/feed'
})
} else next()
}else if(to.matched.some(record => record.meta.forAuth)){
if(!Vue.Auth.authCheck()){
next({
path: '/auth/login'
})
}else{
next()
}
} else next()
}
)
Vue.config.productionTip = false
new Vue({
el: '#app',
render: h => h(App),
router: Routes,
store: {AuthStore}
})
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)
const AuthStore = new Vuex.Store({
plugins: [createPersistedState({ storage: window.sessionStorage })],
state: {
isAuth: false,
user: {}
}
})