This commit is contained in:
suyl
2021-02-26 21:26:28 +08:00
parent 5ce6668185
commit 2060998750

View File

@@ -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 {