diff --git a/.gitignore b/.gitignore index 3c3629e..35ccbe5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules + +dist \ No newline at end of file diff --git a/src/admin/index.ts b/src/admin/index.ts index 566861b..78783fe 100644 --- a/src/admin/index.ts +++ b/src/admin/index.ts @@ -26,6 +26,7 @@ router.add(removeRouter); // add router export const addRouter = new Route('admin', 'addRouter'); + addRouter.run = async (ctx) => { const { path, key } = ctx.query; router.add(new Route(path, key)); @@ -38,7 +39,7 @@ router.add(addRouter); export const updateRouter = new Route('admin', 'updateRouter'); updateRouter.run = async (ctx) => { const { path, key } = ctx.query; - // router.update(path, key); + router.add(new Route(path, key)); ctx.body = 'success'; return ctx; }