fix(tenant): 隔离经营租户与旧分销站点上下文
This commit is contained in:
@@ -99,18 +99,21 @@ func (h *Handler) SendSMS(c *gin.Context) {
|
||||
}
|
||||
|
||||
siteCode := sitecode.FromRequest(c)
|
||||
if siteCode == "" {
|
||||
siteCode = strings.TrimSpace(req.SiteCode)
|
||||
}
|
||||
domain := strings.TrimSpace(firstNonEmpty(
|
||||
c.GetHeader("X-Distribution-Domain"),
|
||||
c.Query("distribution_domain"),
|
||||
c.Query("domain"),
|
||||
))
|
||||
if siteCode == "" && domain == "" {
|
||||
host := sitecode.ExtractHost(c.Request.Host)
|
||||
if host != "" && !sitecode.IsLocalHost(host) {
|
||||
domain = host
|
||||
domain := ""
|
||||
if !sitecode.HasTenantScope(c.Request.Context()) {
|
||||
if siteCode == "" {
|
||||
siteCode = strings.TrimSpace(req.SiteCode)
|
||||
}
|
||||
domain = strings.TrimSpace(firstNonEmpty(
|
||||
c.GetHeader("X-Distribution-Domain"),
|
||||
c.Query("distribution_domain"),
|
||||
c.Query("domain"),
|
||||
))
|
||||
if siteCode == "" && domain == "" {
|
||||
host := sitecode.ExtractHost(c.Request.Host)
|
||||
if host != "" && !sitecode.IsLocalHost(host) {
|
||||
domain = host
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user