mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(projects): 精简版+动态路由权限初步
This commit is contained in:
10
src/service/middleware/auth.ts
Normal file
10
src/service/middleware/auth.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
import { transformAuthRouteToVueRoute } from '@/utils';
|
||||
|
||||
export function userRoutesMiddleware(data: ApiRoute.ResponseRoute | null) {
|
||||
if (!data) return [];
|
||||
|
||||
const routes: RouteRecordRaw[] = data.routes.map(item => transformAuthRouteToVueRoute(item));
|
||||
|
||||
return routes;
|
||||
}
|
Reference in New Issue
Block a user