From 8e8b3a6adfdbb53ccd182e235701ce788cd227b5 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 6 Sep 2024 09:40:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_set_center.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/hdl/hdl_set_center.go b/app/hdl/hdl_set_center.go index 9d893d3..aa4ecd8 100644 --- a/app/hdl/hdl_set_center.go +++ b/app/hdl/hdl_set_center.go @@ -443,7 +443,7 @@ func AppletUnauthorized(c *gin.Context) { // @Router /api/setCenter/share/index [GET] func ShareIndex(c *gin.Context) { masterId := svc.GetMasterId(c) - userAppDomainDb := implement.NewUserAppDomainDb(db.DBs[masterId]) + userAppDomainDb := implement.NewUserAppDomainDb(db.Db) agent, err := userAppDomainDb.GetAppDomainByType("agent", masterId) if err != nil { e.OutErr(c, e.ERR_DB_ORM, err.Error()) @@ -454,10 +454,18 @@ func ShareIndex(c *gin.Context) { e.OutErr(c, e.ERR_DB_ORM, err.Error()) return } + agentDomain := "" + if agent != nil { + agentDomain = agent.Domain + } + mediumDomain := "" + if medium != nil { + mediumDomain = medium.Domain + } e.OutSuc(c, md.ShareIndexResp{ MasterId: masterId, - AgentDomain: agent.Domain, - MediumDomain: medium.Domain, + AgentDomain: agentDomain, + MediumDomain: mediumDomain, }, nil) return }