完善dockerfile构建镜像

This commit is contained in:
dushixiang
2020-12-24 23:21:51 +08:00
parent 348074670e
commit 72f7dd5dc6
36 changed files with 369 additions and 277 deletions

View File

@ -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)
}
}