Browse Source

更新

master
huangjiajun 1 day ago
parent
commit
622c8aa10d
2 changed files with 10 additions and 10 deletions
  1. +8
    -8
      app/hdl/hdl_set_center.go
  2. +2
    -2
      app/md/md_set_center.go

+ 8
- 8
app/hdl/hdl_set_center.go View File

@@ -6,7 +6,7 @@ import (
"applet/app/svc" "applet/app/svc"
"applet/app/utils" "applet/app/utils"
db "code.fnuoos.com/zhimeng/model.git/src" 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" "github.com/gin-gonic/gin"
) )


@@ -22,20 +22,20 @@ import (
// @Router /api/setCenter/share/index [GET] // @Router /api/setCenter/share/index [GET]
func ShareIndex(c *gin.Context) { func ShareIndex(c *gin.Context) {
masterId := svc.GetMasterId(c) 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 { if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error()) e.OutErr(c, e.ERR_DB_ORM, err.Error())
return return
} }
agentDomain := ""
if agent != nil {
agentDomain = agent.Domain
mediumDomain := ""
if medium != nil {
mediumDomain = medium.Domain
} }
user := svc.GetUser(c) user := svc.GetUser(c)
e.OutSuc(c, md.ShareIndexResp{ 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) }, nil)
return return
} }

+ 2
- 2
app/md/md_set_center.go View File

@@ -1,6 +1,6 @@
package md package md


type ShareIndexResp struct { type ShareIndexResp struct {
MasterId string `json:"master_id"`
AgentDomain string `json:"agent_domain" example:"代理分享地址"`
MasterId string `json:"master_id"`
MediumDomain string `json:"medium_domain" example:"媒体分享地址"`
} }

Loading…
Cancel
Save