add logout api
This commit is contained in:
parent
54e0daf198
commit
eea74a7239
@ -55,6 +55,11 @@ r.post('/login', koaBody(), async (c, n) => {
|
||||
c.obj = resObject('Success')
|
||||
})
|
||||
|
||||
r.post('/logout', async (c, n) => {
|
||||
c.session = null
|
||||
c.obj = resObject('Success')
|
||||
})
|
||||
|
||||
r.get('/session', checkSession, async (c, n) => {
|
||||
c.obj = resObject('Success', {
|
||||
user: c.state.loginUser
|
||||
|
Loading…
Reference in New Issue
Block a user