feat:完善项目信息

This commit is contained in:
henry
2022-01-11 10:41:46 +08:00
parent 6712feec35
commit 7cab0fb354
24 changed files with 188 additions and 169 deletions

View File

@ -2,6 +2,7 @@ package serve
import (
"SciencesServer/app"
"SciencesServer/app/session"
"SciencesServer/config"
"SciencesServer/cron"
"SciencesServer/router"
@ -81,13 +82,18 @@ func run() {
},
}).Init()),
web.WithFunction(func(src string) (bool, func(r *http.Request)) {
value, _ := cache.Cache.HGet(config.RedisKeyForTenant, src)
// 安全域名
_cache, _ := cache.Cache.HGet(config.RedisKeyForTenant, src)
if value == "" {
if _cache == "" {
return true, nil
}
// 解析信息
out := new(session.Tenant)
_ = out.UnmarshalBinary([]byte(_cache))
return true, func(r *http.Request) {
r.Header.Set("", value)
r.Header.Set(config.ContentForTenantID, out.IDToString())
}
}),
).Run()