|
|
@@ -6,7 +6,7 @@ import ( |
|
|
|
"applet/app/svc" |
|
|
|
"applet/app/utils" |
|
|
|
db "code.fnuoos.com/zhimeng/model.git/src" |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/super/implement" |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/super/model" |
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
) |
|
|
|
|
|
|
@@ -22,20 +22,20 @@ import ( |
|
|
|
// @Router /api/setCenter/share/index [GET] |
|
|
|
func ShareIndex(c *gin.Context) { |
|
|
|
masterId := svc.GetMasterId(c) |
|
|
|
userAppDomainDb := implement.NewUserAppDomainDb(db.Db) |
|
|
|
agent, err := userAppDomainDb.GetAppDomainByType("agent", masterId) |
|
|
|
medium := new(model.UserAppDomain) |
|
|
|
_, err := db.Db.Where("type =?", "medium").And("uuid =?", masterId).And("is_ssl =1").Get(medium) |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
agentDomain := "" |
|
|
|
if agent != nil { |
|
|
|
agentDomain = agent.Domain |
|
|
|
mediumDomain := "" |
|
|
|
if medium != nil { |
|
|
|
mediumDomain = medium.Domain |
|
|
|
} |
|
|
|
user := svc.GetUser(c) |
|
|
|
e.OutSuc(c, md.ShareIndexResp{ |
|
|
|
MasterId: masterId, |
|
|
|
AgentDomain: agentDomain + "?agent_id=" + utils.IntToStr(user.AgentId), |
|
|
|
MasterId: masterId, |
|
|
|
MediumDomain: mediumDomain + "?agent_id=" + utils.IntToStr(user.AgentId), |
|
|
|
}, nil) |
|
|
|
return |
|
|
|
} |