async login(ctx) {
const token = jsonwebtoken.sign({ _id: 'a' }, config.JWT_SECRET, {
expiresIn: '1d'
})
// let a = await Dictionaries.create({ keys: '13', values: '223' })
console.log(+new Date()) // 这行和写入数据都会执行两遍
ctx.body = {
code: 0,
data: {
token
},
success: true
}koa-router router.get里的方法为什么会执行两遍
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-