|
|
@@ -27,6 +27,17 @@ func GetMasterId(baseDb *xorm.Engine, c *gin.Context) (masterId string) { |
|
|
|
masterId = svc.GetWebSiteDomainMasterId(baseDb, md.PLATFORM_WAP, c.Request.Host) |
|
|
|
} |
|
|
|
} |
|
|
|
if masterId == "" && c.GetHeader("Platform") == md.PLATFORM_WAP { // H5 要根据域名去获取mid |
|
|
|
hostList := strings.Split(c.Request.Host, ".") |
|
|
|
if isNumeric(hostList[0]) { |
|
|
|
masterId = hostList[0] |
|
|
|
} else if isNumeric(hostList[1]) { |
|
|
|
masterId = hostList[1] |
|
|
|
} else { |
|
|
|
// 自定义域名 |
|
|
|
masterId = svc.GetWebSiteDomainMasterId(baseDb, md.PLATFORM_PC, c.Request.Host) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
fmt.Println("master_id:::::::", masterId) |
|
|
|
return |
|
|
|