feat:完善项目信息
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user