feat:完善项目
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user