- auth1与auth2以为是兼容

This commit is contained in:
gazebo
2019-08-26 15:16:05 +08:00
parent fcc87c34af
commit 20c63e7f59
11 changed files with 79 additions and 25 deletions

View File

@@ -423,7 +423,7 @@ func Strings2Objs(strAndObjAddPairs ...interface{}) (err error) {
return nil
}
func HandleUserWXRemark(db *dao.DaoDB, mobile string) (err error) {
func HandleUserWXRemark(db *dao.DaoDB, mobile string, mobileIsUerID bool) (err error) {
if db == nil {
db = dao.GetDB()
}
@@ -438,9 +438,16 @@ func HandleUserWXRemark(db *dao.DaoDB, mobile string) (err error) {
storeID = wxinfo.JxStoreID
}
} else {
userList, _, err2 := dao.GetUsers(db, model.UserTypeStoreBoss, "", nil, "", mobile, 0, -1)
if err = err2; len(userList) > 0 {
userID := userList[0].GetID()
userID := ""
if mobileIsUerID {
userID = mobile
} else {
userList, _, err2 := dao.GetUsers(db, model.UserTypeStoreBoss, "", nil, "", mobile, 0, -1)
if err = err2; len(userList) > 0 {
userID = userList[0].GetID()
}
}
if userID != "" {
authBind, err2 := dao.GetAuthBind(db, userID, weixin.AuthTypeMP, "")
if err = err2; err == nil {
openID = authBind.AuthID