From 2060998750dc9bbc832cebcae9c7690fb0ebca44 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Fri, 26 Feb 2021 21:26:28 +0800 Subject: [PATCH] aa --- business/jxstore/cms/store.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 1feb65f08..8be7abc60 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -18,8 +18,10 @@ import ( "git.rosy.net.cn/jx-callback/business/authz" + "git.rosy.net.cn/baseapi/platformapi/mtwmapi" "git.rosy.net.cn/baseapi/platformapi/yinbaoapi" + "git.rosy.net.cn/jx-callback/globals/api/apimanager" "git.rosy.net.cn/jx-callback/globals/refutil" "github.com/360EntSecGroup-Skylar/excelize" @@ -1278,13 +1280,13 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend } else if vendorID == model.VendorIDMTWM { //如果是绑的美团超市,要去更新token if outStoreMap.VendorOrgCode == globals.Mtwm2Code { - // mtapi := apimanager.CurAPIManager.GetAPI(model.VendorIDMTWM, outStoreMap.VendorOrgCode).(*mtwmapi.API) - // if result, err := mtapi.GetOAuthCode(outStoreMap.VendorStoreID); result != nil && err == nil { - // if token, err := mtapi.GetAccessToken(result.(string)); err == nil && token != nil { - // outStoreMap.MtwmToken = token.(string) - // dao.UpdateEntity(db, outStoreMap, "MtwmToken") - // } - // } + mtapi := apimanager.CurAPIManager.GetAPI(model.VendorIDMTWM, outStoreMap.VendorOrgCode).(*mtwmapi.API) + if result, err := mtapi.GetOAuthCode(outStoreMap.VendorStoreID); result != nil && err == nil { + if token, err := mtapi.GetAccessToken(result.(string)); err == nil && token != nil { + outStoreMap.MtwmToken = token.(string) + dao.UpdateEntity(db, outStoreMap, "MtwmToken") + } + } } } if globals.IsAddEvent {