mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
bug fix
This commit is contained in:
parent
87c2fa520c
commit
855634cd45
10 changed files with 61 additions and 16 deletions
|
@ -51,12 +51,14 @@ func Login(c *gin.Context) {
|
|||
|
||||
func Logout(c *gin.Context) {
|
||||
token := c.GetHeader("Authorization")
|
||||
err := model.DeleteToken(token)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
"message": err.Error(),
|
||||
})
|
||||
return
|
||||
if token != "" {
|
||||
err := model.DeleteToken(token)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
"message": err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
c.JSON(http.StatusNoContent, gin.H{})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue