feat:完善项目

This commit is contained in:
henry
2021-11-15 17:32:23 +08:00
parent f5e2063685
commit 78128277ff
27 changed files with 717 additions and 105 deletions

View File

@ -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)
}