mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 18:01:05 +03:30
structure user and izitoast and add medicalcenter
This commit is contained in:
Vendored
+13
-3
@@ -18,18 +18,28 @@ import i18n from '@/i18n'
|
||||
import router from '@/router'
|
||||
import store from '@/store'
|
||||
|
||||
|
||||
import { ApiService, TokenService } from '@/services'
|
||||
// Sync store with router
|
||||
sync(store, router)
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
ApiService.setHeader();
|
||||
// Set the base URL of the API
|
||||
ApiService.init(process.env.MIX_APP_ROOT_API)
|
||||
|
||||
// If token exists set header
|
||||
require('./services/global/errorHandler.service');
|
||||
// If token exists set Authorizion header
|
||||
if (TokenService.getToken()) {
|
||||
ApiService.setHeader()
|
||||
ApiService.setAuthHeader();
|
||||
|
||||
// If info exists set info in Store
|
||||
if(TokenService.getInfo()) {
|
||||
let info = TokenService.getInfo();
|
||||
store.commit('setInfo', info);
|
||||
} else {
|
||||
store.dispatch('info');
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-disable no-new */
|
||||
|
||||
Reference in New Issue
Block a user