Skip to content

Commit 6710451

Browse files
author
Zheng Yibo
committed
增加处理 错误参数接口
1 parent 8855f89 commit 6710451

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

router/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,22 @@ export default (app) => {
88
ctx.redirect('/404')
99
return;
1010
}
11-
ctx.throw(500)
11+
ctx.throw(500);
1212
}
1313

1414
router.get(/^(?!\/(api|dist|404))\/*/, async (ctx) => {
1515
await ctx.render(ctx);
1616
})
1717

18+
router.get('/api/getUserInfo', async (ctx) => {
19+
ctx.body = {
20+
code : 1,
21+
data : {
22+
name : '我叫mmv'
23+
}
24+
}
25+
})
26+
1827
router.get('/404', async (ctx) => {
1928
await ctx.render();
2029
})

0 commit comments

Comments
 (0)