From 63f7fc749c2116a0526b5279c0bdeef64ea23db5 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 13 Feb 2020 11:57:18 +0800 Subject: [PATCH 1/5] =?UTF-8?q?2222-01-01=2000:00:00=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6=E4=B8=80=E4=BA=9B=E9=97=A8=E5=BA=97=E7=9A=84?= =?UTF-8?q?=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync_store_sku.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/business/jxstore/cms/sync_store_sku.go b/business/jxstore/cms/sync_store_sku.go index 6e500557a..2ff9a23ba 100644 --- a/business/jxstore/cms/sync_store_sku.go +++ b/business/jxstore/cms/sync_store_sku.go @@ -31,12 +31,7 @@ const ( var ( subSensitiveWordRegexp = regexp.MustCompile(`[^\[\]\"\}]`) - // 2020-02-10美团要求下架所有猪肉 - meatCatMap = map[int]bool{ - 20: true, - 184: true, - 59: true, - } + specailAutoEnableAt = utils.Str2Time("2222-01-01 00:00:00") ) func CreateStoreCategoryByStoreSku(ctx *jxcontext.Context, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs []int) (err error) { @@ -385,10 +380,9 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag sku.VendorPrice = 0 } sku.MergedStatus = MergeSkuSaleStatusWithStoreOpTime(sku, storeDetail, now) - // 2020-02-10美团要求下架所有猪肉 - // if globals.IsMainProductEnv() && vendorID == model.VendorIDMTWM && meatCatMap[sku.NameCategoryID] { - // sku.MergedStatus = model.SkuStatusDontSale - // } + if vendorID == model.VendorIDMTWM && storeDetail.Status != model.StoreStatusOpened && storeDetail.AutoEnableAt.Sub(specailAutoEnableAt) == 0 && sku.MergedStatus == model.SkuStatusNormal { + sku.MergedStatus = model.SkuStatusDontSale + } var bareSku *partner.StoreSkuInfo isNeedReorder := false if isStoreSkuSyncNeedDelete(sku) { From 67d4e461e2cddfe8c0ce75e92d23e14873d67782 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 13 Feb 2020 12:30:40 +0800 Subject: [PATCH 2/5] up --- business/jxstore/cms/sync_store_sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/jxstore/cms/sync_store_sku.go b/business/jxstore/cms/sync_store_sku.go index 2ff9a23ba..f6f42b782 100644 --- a/business/jxstore/cms/sync_store_sku.go +++ b/business/jxstore/cms/sync_store_sku.go @@ -380,7 +380,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag sku.VendorPrice = 0 } sku.MergedStatus = MergeSkuSaleStatusWithStoreOpTime(sku, storeDetail, now) - if vendorID == model.VendorIDMTWM && storeDetail.Status != model.StoreStatusOpened && storeDetail.AutoEnableAt.Sub(specailAutoEnableAt) == 0 && sku.MergedStatus == model.SkuStatusNormal { + if vendorID == model.VendorIDMTWM && storeDetail.Status != model.StoreStatusOpened && storeDetail.AutoEnableAt != nil && storeDetail.AutoEnableAt.Sub(specailAutoEnableAt) == 0 && sku.MergedStatus == model.SkuStatusNormal { sku.MergedStatus = model.SkuStatusDontSale } var bareSku *partner.StoreSkuInfo From d3cf404a41e79273d9672c2e7316192e162f00e4 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 13 Feb 2020 13:45:44 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E7=B1=BB=E5=9E=8B=E5=A4=9A=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/auth2/auth2.go | 10 ++++----- business/auth2/auth_info.go | 16 +++++++++----- business/auth2/authprovider/alipay/alipay.go | 2 +- business/auth2/authprovider/defauther.go | 22 ++++++++++++------- .../auth2/authprovider/dingding/qrcode.go | 2 +- business/auth2/authprovider/dingding/staff.go | 2 +- business/auth2/authprovider/mobile/mobile.go | 2 +- business/auth2/authprovider/weixin/weixin.go | 2 +- .../auth2/authprovider/weixin/weixin_mini.go | 4 ++-- business/model/auth2.go | 1 + controllers/auth2.go | 3 ++- 11 files changed, 39 insertions(+), 27 deletions(-) diff --git a/business/auth2/auth2.go b/business/auth2/auth2.go index b023acaed..039b112b2 100644 --- a/business/auth2/auth2.go +++ b/business/auth2/auth2.go @@ -82,7 +82,7 @@ type IAuther interface { // 负责验证secret,并找到相应的用户返回(password,email,mobile类型的不负责用户查找)如果找不到用户UserID为空 VerifySecret(authID, authSecret string) (authBindEx *AuthBindEx, err error) AddAuthBind(authBindEx *AuthBindEx, userName string) (err error) - UnbindAuth(userID, authType, userName string) (err error) + UnbindAuth(userID, authType, authTypeID, userName string) (err error) Logout(authInfo *AuthInfo) (err error) GetUserType() (userType int8) } @@ -314,7 +314,7 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) { } else { if handler := authers[newAuthInfo.AuthBindInfo.Type]; handler != nil { newAuthInfo.AuthBindInfo.UserID = user.GetID() - handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), user.GetName()) + handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName()) err = handler.AddAuthBind(newAuthInfo.AuthBindInfo, user.GetName()) } else { err = ErrIllegalAuthType @@ -323,10 +323,10 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) { return err } -func UnbindAuth(userID, authType, userName string) (err error) { - globals.SugarLogger.Debugf("UnbindAuth userID:%s, authType:%s, userName:%s", userID, authType, userName) +func UnbindAuth(userID, authType, authTypeID, userName string) (err error) { + globals.SugarLogger.Debugf("UnbindAuth userID:%s, authType:%s, authTypeID:%s, userName:%s", userID, authType, authTypeID, userName) if handler := authers[authType]; handler != nil { - err = handler.UnbindAuth(userID, authType, userName) + err = handler.UnbindAuth(userID, authType, authTypeID, userName) } else { err = ErrIllegalAuthType } diff --git a/business/auth2/auth_info.go b/business/auth2/auth_info.go index 8f98df47e..7ca58252d 100644 --- a/business/auth2/auth_info.go +++ b/business/auth2/auth_info.go @@ -13,12 +13,12 @@ const ( ) type UserBasic struct { - UserID string `json:"userID"` - UserID2 string `json:"userID2"` - Mobile string `json:"mobile"` - Email string `json:"email"` - Name string `json:"name"` - Avatar string `json:"avatar"` + UserID string `json:"userID"` + UserID2 string `json:"userID2"` + Mobile string `json:"mobile"` + Email string `json:"email"` + Name string `json:"name"` + Avatar string `json:"avatar"` } func (u *UserBasic) GetID() string { @@ -83,6 +83,10 @@ func (a *AuthInfo) GetAuthType() string { return a.AuthBindInfo.Type } +func (a *AuthInfo) GetAuthTypeID() string { + return a.AuthBindInfo.TypeID +} + func (a *AuthInfo) GetUserTag() string { userTag := a.GetID2() if userTag == "" { diff --git a/business/auth2/authprovider/alipay/alipay.go b/business/auth2/authprovider/alipay/alipay.go index 8c137ed68..64c60f144 100644 --- a/business/auth2/authprovider/alipay/alipay.go +++ b/business/auth2/authprovider/alipay/alipay.go @@ -31,7 +31,7 @@ func (a *Auther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthBindEx, if err == nil { userInfo, err2 := api.AliPayAPI.UserInfoShare(tokenInfo.AccessToken) if err = err2; err == nil { - if authBindEx, err = a.UnionFindAuthBind(AuthType, nil, userInfo.UserID, "", userInfo); err == nil { + if authBindEx, err = a.UnionFindAuthBind(AuthType, api.AliPayAPI.GetAppID(), nil, userInfo.UserID, "", userInfo); err == nil { authBindEx.UserHint = &auth2.UserBasic{ Name: userInfo.NickName, Avatar: userInfo.Avatar, diff --git a/business/auth2/authprovider/defauther.go b/business/auth2/authprovider/defauther.go index 517b5565d..1c6dc8583 100644 --- a/business/auth2/authprovider/defauther.go +++ b/business/auth2/authprovider/defauther.go @@ -35,13 +35,17 @@ func (a *DefAuther) AddAuthBind(authBindEx *auth2.AuthBindEx, userName string) ( return err } -func (a *DefAuther) UnbindAuth(userID, authType, userName string) (err error) { - globals.SugarLogger.Debugf("DefAuther.UnbindAuth userID:%s, authType:%s, userName:%s", userID, authType, userName) - _, err = dao.DeleteEntityLogically(nil, &model.AuthBind{}, nil, userName, map[string]interface{}{ +func (a *DefAuther) UnbindAuth(userID, authType, authTypeID, userName string) (err error) { + globals.SugarLogger.Debugf("DefAuther.UnbindAuth userID:%s, authType:%s, GetAuthTypeID:%s, userName:%s", userID, authType, authTypeID, userName) + condition := map[string]interface{}{ "UserID": userID, "Type": authType, model.FieldDeletedAt: utils.DefaultTimeValue, - }) + } + if authTypeID != "" { + condition["TypeID"] = authTypeID + } + _, err = dao.DeleteEntityLogically(dao.GetDB(), &model.AuthBind{}, nil, userName, condition) return err } @@ -59,9 +63,9 @@ func (a *DefAuther) GetUserType() (userType int8) { } // 此函数用于联合(通过unionID)查找用户 -func (a *DefAuther) UnionFindAuthBind(curAuthType string, unionAuthTypeList []string, openID, unionID string, authDetail interface{}) (authBindEx *auth2.AuthBindEx, err error) { - globals.SugarLogger.Debugf("UnionFindAuthBind curAuthType:%s, unionAuthTypeList:%v, openID:%s, unionID:%s, authDetail:%s", - curAuthType, unionAuthTypeList, openID, unionID, utils.Format4Output(authDetail, true)) +func (a *DefAuther) UnionFindAuthBind(curAuthType, curAuthTypeID string, unionAuthTypeList []string, openID, unionID string, authDetail interface{}) (authBindEx *auth2.AuthBindEx, err error) { + globals.SugarLogger.Debugf("UnionFindAuthBind curAuthType:%s, curAuthTypeID:%s, unionAuthTypeList:%v, openID:%s, unionID:%s, authDetail:%s", + curAuthType, curAuthTypeID, unionAuthTypeList, openID, unionID, utils.Format4Output(authDetail, true)) db := dao.GetDB() var authBind *model.AuthBind if authBind, err = dao.GetAuthBind(db, model.AuthBindTypeAuth, curAuthType, openID); err == nil { // 直接找到了 @@ -77,6 +81,7 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType string, unionAuthTypeList []st if authBindList, err = dao.GetUserBindAuthInfo(db, "", model.AuthBindTypeAuth, unionAuthTypeList, "", unionID); err == nil && len(authBindList) > 0 { // 通过unionID找到至少一个认证方式 authBind = authBindList[0] authBind.Type = curAuthType + authBind.TypeID = curAuthTypeID authBind.AuthID = openID if authDetail != nil { authBind.DetailData = string(utils.MustMarshal(authDetail)) @@ -84,7 +89,7 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType string, unionAuthTypeList []st authBindEx = &auth2.AuthBindEx{ AuthBind: *authBind, } - a.UnbindAuth(authBind.UserID, curAuthType, model.AdminName) + a.UnbindAuth(authBind.UserID, curAuthType, curAuthTypeID, model.AdminName) err = a.AddAuthBind(authBindEx, model.AdminName) // 自动绑定 } else if dao.IsNoRowsError(err) { err = nil @@ -97,6 +102,7 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType string, unionAuthTypeList []st authBindEx = &auth2.AuthBindEx{ AuthBind: model.AuthBind{ Type: curAuthType, + TypeID: curAuthTypeID, AuthID: openID, AuthID2: unionID, }, diff --git a/business/auth2/authprovider/dingding/qrcode.go b/business/auth2/authprovider/dingding/qrcode.go index 2ad75acc1..8e84d4a35 100644 --- a/business/auth2/authprovider/dingding/qrcode.go +++ b/business/auth2/authprovider/dingding/qrcode.go @@ -27,7 +27,7 @@ func (a *QRCodeAuther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthB userQRInfo, err := api.DingDingQRCodeAPI.GetUserInfoByCode(code) if err == nil { globals.SugarLogger.Debugf("dingding qrcode VerifySecret code:%s, userQRInfo:%s", code, utils.Format4Output(userQRInfo, false)) - if authBindEx, err = a.UnionFindAuthBind(AuthTypeQRCode, []string{AuthTypeStaff, AuthTypeQRCode}, userQRInfo.OpenID, userQRInfo.UnionID, userQRInfo); err == nil { + if authBindEx, err = a.UnionFindAuthBind(AuthTypeQRCode, api.DingDingQRCodeAPI.GetAppID(), []string{AuthTypeStaff, AuthTypeQRCode}, userQRInfo.OpenID, userQRInfo.UnionID, userQRInfo); err == nil { authBindEx.UserHint = &auth2.UserBasic{ Name: userQRInfo.Nickname, } diff --git a/business/auth2/authprovider/dingding/staff.go b/business/auth2/authprovider/dingding/staff.go index 14a4aeb4e..c1630497b 100644 --- a/business/auth2/authprovider/dingding/staff.go +++ b/business/auth2/authprovider/dingding/staff.go @@ -29,7 +29,7 @@ func (a *StaffAuther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthBi if err == nil { userDetail, err2 := api.DingDingAPI.GetUserDetail(userID.UserID) if err = err2; err == nil { - if authBindEx, err = a.UnionFindAuthBind(AuthTypeStaff, []string{AuthTypeStaff, AuthTypeQRCode}, userID.UserID, utils.Interface2String(userDetail["unionid"]), userDetail); err == nil { + if authBindEx, err = a.UnionFindAuthBind(AuthTypeStaff, api.DingDingQRCodeAPI.GetAppID(), []string{AuthTypeStaff, AuthTypeQRCode}, userID.UserID, utils.Interface2String(userDetail["unionid"]), userDetail); err == nil { authBindEx.UserHint = &auth2.UserBasic{ UserID2: userID.UserID, Mobile: utils.Interface2String(userDetail["mobile"]), diff --git a/business/auth2/authprovider/mobile/mobile.go b/business/auth2/authprovider/mobile/mobile.go index 43d6d48c3..bd40bb7e7 100644 --- a/business/auth2/authprovider/mobile/mobile.go +++ b/business/auth2/authprovider/mobile/mobile.go @@ -85,6 +85,6 @@ func (a *Auther) AddAuthBind(authBindEx *auth2.AuthBindEx, userName string) (err } // 此函数为空 -func (a *Auther) UnbindAuth(userID, authType, userName string) (err error) { +func (a *Auther) UnbindAuth(userID, authType, authTypeID, userName string) (err error) { return err } diff --git a/business/auth2/authprovider/weixin/weixin.go b/business/auth2/authprovider/weixin/weixin.go index fbf9df42e..ccb355a21 100644 --- a/business/auth2/authprovider/weixin/weixin.go +++ b/business/auth2/authprovider/weixin/weixin.go @@ -71,7 +71,7 @@ func (a *Auther) VerifySecret(id, secret string) (authBindEx *auth2.AuthBindEx, if err == nil { wxUserinfo, err2 := a.getAPI().SNSGetUserInfo(accessToken, openID) if err = err2; err == nil { - if authBindEx, err = a.UnionFindAuthBind(a.authType, []string{AuthTypeWeixin, AuthTypeMP, AuthTypeMini, AuthTypeWXNative}, wxUserinfo.OpenID, wxUserinfo.UnionID, wxUserinfo); err == nil { + if authBindEx, err = a.UnionFindAuthBind(a.authType, a.getAPI().GetAppID(), []string{AuthTypeWeixin, AuthTypeMP, AuthTypeMini, AuthTypeWXNative}, wxUserinfo.OpenID, wxUserinfo.UnionID, wxUserinfo); err == nil { authBindEx.UserHint = &auth2.UserBasic{ Name: wxUserinfo.NickName, Avatar: wxUserinfo.HeadImgURL, diff --git a/business/auth2/authprovider/weixin/weixin_mini.go b/business/auth2/authprovider/weixin/weixin_mini.go index 4c2d41db2..072ea9573 100644 --- a/business/auth2/authprovider/weixin/weixin_mini.go +++ b/business/auth2/authprovider/weixin/weixin_mini.go @@ -42,7 +42,7 @@ func (a *MiniAuther) VerifySecret(dummy, jsCode string) (authBindEx *auth2.AuthB if err == nil { sessionKey := sessionInfo.SessionKey sessionInfo.SessionKey = "" - if authBindEx, err = a.UnionFindAuthBind(AuthTypeMini, []string{AuthTypeWeixin, AuthTypeMP, AuthTypeMini, AuthTypeWXNative}, sessionInfo.OpenID, sessionInfo.UnionID, sessionInfo); err == nil { + if authBindEx, err = a.UnionFindAuthBind(AuthTypeMini, getWxApp(appID).GetAppID(), []string{AuthTypeWeixin, AuthTypeMP, AuthTypeMini, AuthTypeWXNative}, sessionInfo.OpenID, sessionInfo.UnionID, sessionInfo); err == nil { authBindEx.UserData = sessionKey } } @@ -57,7 +57,7 @@ func (a *MiniAuther) DecryptData(authInfo *auth2.AuthInfo, jsCode, encryptedData if jsCode != "" { sessionInfo, err := getWxApp(appID).SNSCode2Session(jsCode) if err == nil { - if authBindEx, err := a.UnionFindAuthBind(AuthTypeMini, []string{AuthTypeMini}, sessionInfo.OpenID, "", nil); err == nil { + if authBindEx, err := a.UnionFindAuthBind(AuthTypeMini, getWxApp(appID).GetAppID(), []string{AuthTypeMini}, sessionInfo.OpenID, "", nil); err == nil { if authBindEx.UserID != authInfo.GetID() { return "", fmt.Errorf("jsCode与token不匹配") } diff --git a/business/model/auth2.go b/business/model/auth2.go index 2eaefd61e..56e485665 100644 --- a/business/model/auth2.go +++ b/business/model/auth2.go @@ -20,6 +20,7 @@ type AuthBind struct { BindType int8 `json:"bindType"` Type string `orm:"size(16)" json:"type"` + TypeID string `orm:"size(32);column(type_id)" json:"typeID"` UserID string `orm:"size(48);column(user_id);index" json:"userID"` Status int8 `json:"status"` AuthID2 string `orm:"size(48);column(auth_id2);index" json:"authID2"` diff --git a/controllers/auth2.go b/controllers/auth2.go index a09e18fea..7b1e9fbf5 100644 --- a/controllers/auth2.go +++ b/controllers/auth2.go @@ -275,6 +275,7 @@ func (c *Auth2Controller) AddAuthBind() { // @Description 删除认证方式 // @Param token header string true "认证token" // @Param authType query string true "登录类型,参见Login的描述" +// @Param authTypeID query string false "登录类型标识" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult // @router /RemoveAuthBind [delete] @@ -282,7 +283,7 @@ func (c *Auth2Controller) RemoveAuthBind() { c.callRemoveAuthBind(func(params *tAuth2RemoveAuthBindParams) (retVal interface{}, errCode string, err error) { authInfo, err2 := params.Ctx.GetV2AuthInfo() if err = err2; err == nil { - err = auth2.UnbindAuth(authInfo.GetID(), params.AuthType, params.Ctx.GetUserName()) + err = auth2.UnbindAuth(authInfo.GetID(), params.AuthType, params.AuthTypeID, params.Ctx.GetUserName()) } return retVal, "", err }) From cb163e1ff1d4d4ac4bd34057f394262b38242e43 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 13 Feb 2020 23:45:43 +0800 Subject: [PATCH 4/5] =?UTF-8?q?AddEventDetail=E4=B8=AD=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=B2=A1=E6=9C=89request=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 0e9ba8287..632251d88 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -1204,21 +1204,24 @@ func getSkuSaleStatus(inSkuBind *StoreSkuBindSkuInfo, skuNameBindInfo *StoreSkuB } func AddEventDetail(db *dao.DaoDB, ctx *jxcontext.Context, operateType, thingID, thingType, storeID int, beforeData, afterData string) (err error) { - url := ctx.GetRequest().URL.Path - apiFunction := url[strings.LastIndex(url, "/")+1 : len(url)] - if ctx.GetUserName() == "jxadmin" && !strings.Contains(apiFunction, "AutoPayForPopluarMan") { - return err + req := ctx.GetRequest() + if req != nil { + url := req.URL.Path + apiFunction := url[strings.LastIndex(url, "/")+1 : len(url)] + if ctx.GetUserName() == "jxadmin" && !strings.Contains(apiFunction, "AutoPayForPopluarMan") { + return err + } + operateEventDetail := &model.OperateEventDetail{ + OperateType: operateType, + ThingID: thingID, + ThingType: thingType, + StoreID: storeID, + AccessUUID: ctx.GetTrackInfo()[0:strings.Index(ctx.GetTrackInfo(), ",")], + BeforeData: beforeData, + AfterData: afterData, + } + err = event.AddOperateEventDetail(db, operateEventDetail) } - operateEventDetail := &model.OperateEventDetail{ - OperateType: operateType, - ThingID: thingID, - ThingType: thingType, - StoreID: storeID, - AccessUUID: ctx.GetTrackInfo()[0:strings.Index(ctx.GetTrackInfo(), ",")], - BeforeData: beforeData, - AfterData: afterData, - } - err = event.AddOperateEventDetail(db, operateEventDetail) return err } From 34732dffa1f44bae71ff0f27299a35d780418a43 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 14 Feb 2020 10:06:22 +0800 Subject: [PATCH 5/5] =?UTF-8?q?UnionFindAuthBind=E5=9C=A8TypeID=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/auth2/authprovider/defauther.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/business/auth2/authprovider/defauther.go b/business/auth2/authprovider/defauther.go index 1c6dc8583..ea0ea4620 100644 --- a/business/auth2/authprovider/defauther.go +++ b/business/auth2/authprovider/defauther.go @@ -75,6 +75,10 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType, curAuthTypeID string, unionAu if authDetail != nil { authBindEx.DetailData = string(utils.MustMarshal(authDetail)) } + if authBind.TypeID == "" { + authBind.TypeID = curAuthTypeID + dao.UpdateEntity(db, authBind, "TypeID") + } } else if dao.IsNoRowsError(err) { // 直接找不到,尝试unionID if unionID != "" { // 且有unionID var authBindList []*model.AuthBind