feat:完善项目

This commit is contained in:
henry
2021-11-02 17:01:04 +08:00
parent 20d81825e1
commit 0fa2630933
19 changed files with 171 additions and 267 deletions

View File

@ -2,6 +2,7 @@ package api
import (
"ArmedPolice/app/controller/account"
"ArmedPolice/app/service"
"github.com/gin-gonic/gin"
)
@ -50,8 +51,8 @@ func (a *Account) Login(c *gin.Context) {
APIFailure(err.(error))(c)
return
}
//c.GetHeader("x-equipment")
data, err := account.NewInstance()(nil).Login()
data, err := account.NewInstance()(nil).Login(form.Account, form.Password, form.Captcha.Key,
form.Captcha.Value, c.ClientIP())
APIResponse(err, data)(c)
}
@ -75,6 +76,13 @@ func (a *Account) Login(c *gin.Context) {
* }
*/
func (a *Account) Logout(c *gin.Context) {
//err := controller.NewAccount()(getSession()(c).(*service.Session)).Logout()
//APIResponse(err)(c)
handle := getSession()(c)
session := new(service.Session)
if handle != nil {
session = handle.(*service.Session)
}
err := account.NewInstance()(session).Logout()
APIResponse(err)(c)
}