feat: add authorize directive; 🌟
新增:权限验证指令;
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import {formatAuthority} from '@/utils/routerUtil'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
// 不需要登录拦截的路由配置
|
||||
const loginIgnore = {
|
||||
names: ['404'], //根据路由名称匹配
|
||||
names: ['404', '403'], //根据路由名称匹配
|
||||
paths: ['/login'], //根据路由fullPath匹配
|
||||
/**
|
||||
* 判断路由是否包含在该配置中
|
||||
@@ -24,6 +25,7 @@ const loginIgnore = {
|
||||
*/
|
||||
function initRouter(isAsync) {
|
||||
const options = isAsync ? require('./config.async').default : require('./config').default
|
||||
formatAuthority(options.routes)
|
||||
return new Router(options)
|
||||
}
|
||||
export {loginIgnore, initRouter}
|
||||
|
||||
Reference in New Issue
Block a user