增加删除用户时也删除缓存中的授权信息

This commit is contained in:
dushixiang
2021-01-26 22:11:11 +08:00
parent d771ad6ab6
commit 661435f80a
3 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package api
import (
"github.com/labstack/echo/v4"
"next-terminal/pkg/global"
"next-terminal/pkg/model"
"next-terminal/pkg/utils"
"strconv"
@ -79,6 +80,7 @@ func UserDeleteEndpoint(c echo.Context) error {
}
if loginLogs != nil && len(loginLogs) > 0 {
for j := range loginLogs {
global.Cache.Delete(loginLogs[j].ID)
model.Logout(loginLogs[j].ID)
}
}