完善dockerfile构建镜像
This commit is contained in:
@ -2,14 +2,14 @@ package api
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"next-terminal/pkg/config"
|
||||
"next-terminal/pkg/global"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Auth(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
|
||||
urls := []string{"download", "login"}
|
||||
urls := []string{"download", "recording", "login", "static", "favicon", "logo"}
|
||||
|
||||
return func(c echo.Context) error {
|
||||
// 路由拦截 - 登录身份、资源权限判断等
|
||||
@ -23,12 +23,12 @@ func Auth(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
}
|
||||
|
||||
token := GetToken(c)
|
||||
user, found := config.Cache.Get(token)
|
||||
user, found := global.Cache.Get(token)
|
||||
if !found {
|
||||
c.Logger().Error("您的登录信息已失效,请重新登录后再试。")
|
||||
return Fail(c, 403, "您的登录信息已失效,请重新登录后再试。")
|
||||
}
|
||||
config.Cache.Set(token, user, time.Minute*time.Duration(30))
|
||||
global.Cache.Set(token, user, time.Minute*time.Duration(30))
|
||||
return next(c)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user