初始提交
This commit is contained in:
25
src/main.js
Normal file
25
src/main.js
Normal file
@ -0,0 +1,25 @@
|
||||
import {
|
||||
createApp
|
||||
} from 'vue';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
import vant from 'vant';
|
||||
import 'vant/lib/index.css';
|
||||
import './assets/styles/common.scss';
|
||||
import store from './store';
|
||||
import Vconsole from 'vconsole';
|
||||
let vConsole = new Vconsole()
|
||||
//NFC
|
||||
router.beforeEach((to, from, next) => {
|
||||
let token = window.localStorage.getItem('token')
|
||||
let user = window.localStorage.getItem('userInfo')
|
||||
if (token && user) {
|
||||
next();
|
||||
} else {
|
||||
if (to.name == 'login') next()
|
||||
else next('/')
|
||||
}
|
||||
})
|
||||
|
||||
// .use(vConsole)
|
||||
createApp(App).use(vant).use(router).use(store).mount('#app');
|
||||
Reference in New Issue
Block a user