refactor(projects): 精简版+动态路由权限初步

This commit is contained in:
Soybean
2022-01-03 22:20:10 +08:00
parent 7a0648dba5
commit de2057f141
354 changed files with 2053 additions and 22117 deletions

View 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;
}

View File

@@ -1,23 +0,0 @@
import type { ResponseDictionary, Dictionary } from '@/interface';
export function fecthDictionaryMiddleware(data: ResponseDictionary[]): Dictionary[] {
return data.map(item => {
const {
modelName: label,
modelCharactorName: charactorLabel,
modelIndicator: indicatorKey,
modelIndicatorName: indicatorLabel,
remarks: remark,
formula
} = item;
return {
label,
charactorLabel,
indicatorKey,
indicatorLabel,
remark,
formula
};
});
}

View File

@@ -1 +1 @@
export * from './demo';
export * from './auth';