From c82ee269cda82e935c97a4a9487bb321ef7b46bd Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Tue, 10 Aug 2021 15:25:29 +0800 Subject: [PATCH] aa --- business/jxstore/cms/job.go | 4 ++-- business/jxstore/partner/mt/mt.go | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index eac20ba35..ec2cd9c11 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -5,6 +5,7 @@ import ( "fmt" "git.rosy.net.cn/baseapi/platformapi/mtunionapi" "git.rosy.net.cn/baseapi/platformapi/tbunionapi" + "git.rosy.net.cn/jx-callback/business/jxstore/partner/mt" "math" "regexp" "strings" @@ -2159,11 +2160,10 @@ func MtUnionJobAutoUpdate(ctx *jxcontext.Context) (err error) { return err } //再查美团联盟上的所有活动 - acts, err := api.MtUnionAPI.ActivityList(1, 20, 0) + acts, err := mt.GetAPI().ActivityList(1, 20, 0) if err != nil { return err } - fmt.Println(utils.Format4Output(acts, true)) for _, v := range acts { if v.DateBound != "" { dateBegin := utils.Str2Time(v.DateBound[:strings.LastIndex(v.DateBound, "至")-1]) diff --git a/business/jxstore/partner/mt/mt.go b/business/jxstore/partner/mt/mt.go index 9f4cf9aa1..6a578980a 100644 --- a/business/jxstore/partner/mt/mt.go +++ b/business/jxstore/partner/mt/mt.go @@ -25,3 +25,10 @@ func getAPI() (apiobj *mtunionapi.API) { } return api.MtUnionAPI } + +func GetAPI() (apiobj *mtunionapi.API) { + if configs, err := dao.QueryConfigs(dao.GetDB(), "mtunionCookie", model.ConfigTypeCookie, ""); err == nil { + api.MtUnionAPI.SetCookieWithStr(configs[0].Value) + } + return api.MtUnionAPI +}