Commit d2c99d52 by liuliufashi

update

parent 8a865fd2
VUE_APP_MODE = 'dev'
NODE_ENV = 'development'
NODE_ENV=production browserify -g envify -e main.js | uglifyjs -c -m > build.js
VUE_APP_BASE_URL = '/iships/'
VUE_APP_MODE = 'http://47.102.211.197:8092'
VUE_APP_TEXT = '测试环境'
\ No newline at end of file
No preview for this file type
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import {getToken} from "@/utils/token"
import Login from '@/views/login/index.vue'
import Home from '@/views/home/index.vue'
import Error from '@/views/404/index.vue'
import { onGetRouter } from '@/utils/userInfo'
console.log(onGetRouter(),'getRouter');
const routes: Array<RouteRecordRaw> = [
{
......@@ -63,15 +62,15 @@ const routes: Array<RouteRecordRaw> = [
}
]
const router = createRouter({
history: createWebHistory(),
history: createWebHashHistory(),
routes
})
// router.beforeEach((to,from,next)=>{
// const token:any = getToken
// if(token){
// next()
// }else{
// router.push('/login')
// }
// })
router.beforeEach((to,from,next)=>{
const token:any = getToken
if(token){
next()
}else{
router.push('/login')
}
})
export default router
module.exports = {
mode: 'production',
rules: [{
test: /\.less$/,
use: [{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment