赞
踩
function authCallback (ctx, result) {
const expires = new Date();
expires.setDate(expires.getDate() + 1);
ctx.cookies.set(‘auth_info’, JSON.stringify(result), {
httpOnly: true,
domain: ‘www.vwood.xyz’,
expires,
});
ctx.redirect(’/’);
}
router.post(’/auth’, async ctx => {
const body = ctx.request.body;
const result = await auth({
email: body.email,
password: body.password,
});
authCallback(ctx, result);
})
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。