feat:完善项目
This commit is contained in:
@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"ArmedPolice/app/controller/account"
|
||||
"ArmedPolice/app/service"
|
||||
"ArmedPolice/config"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@ -82,13 +83,11 @@ func (a *Account) Login(c *gin.Context) {
|
||||
* }
|
||||
*/
|
||||
func (a *Account) Logout(c *gin.Context) {
|
||||
handle := getSession()(c)
|
||||
// 因跳过中间键,故只能自己去获取token用户信息
|
||||
token := c.GetHeader(config.APIRequestToken)
|
||||
|
||||
session := new(service.Session)
|
||||
session, _ := service.NewAuthToken(token).Auth()
|
||||
|
||||
if handle != nil {
|
||||
session = handle.(*service.Session)
|
||||
}
|
||||
err := account.NewInstance()(session).Logout()
|
||||
APIResponse(err)(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user