param
This commit is contained in:
@@ -161,7 +161,6 @@ func getFixedTokenName(token string) *AuthInfo {
|
|||||||
func createAuthInfo(user IUser, authBindInfo *AuthBindEx) (authInfo *AuthInfo) {
|
func createAuthInfo(user IUser, authBindInfo *AuthBindEx) (authInfo *AuthInfo) {
|
||||||
token, tokenType := createToken(user, authBindInfo)
|
token, tokenType := createToken(user, authBindInfo)
|
||||||
//user为空 tokenType=2
|
//user为空 tokenType=2
|
||||||
globals.SugarLogger.Debug("token,tokenType,user============", token, tokenType, user)
|
|
||||||
expireDuration := DefTokenDuration
|
expireDuration := DefTokenDuration
|
||||||
authInfo = &AuthInfo{
|
authInfo = &AuthInfo{
|
||||||
AuthBindInfo: authBindInfo,
|
AuthBindInfo: authBindInfo,
|
||||||
@@ -249,7 +248,6 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
|
|||||||
}
|
}
|
||||||
realAuthID = user.GetID()
|
realAuthID = user.GetID()
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("打印realAuthID检测是否为空==================", realAuthID)
|
|
||||||
if authBindEx, err = handler.VerifySecret(realAuthID, authSecret); err == nil {
|
if authBindEx, err = handler.VerifySecret(realAuthID, authSecret); err == nil {
|
||||||
globals.SugarLogger.Debugf("Login authBindEx", utils.Format4Output(authBindEx, false))
|
globals.SugarLogger.Debugf("Login authBindEx", utils.Format4Output(authBindEx, false))
|
||||||
if authBindEx == nil { // mobile, email会返回nil(表示不会新建AuthBind实体)
|
if authBindEx == nil { // mobile, email会返回nil(表示不会新建AuthBind实体)
|
||||||
@@ -282,7 +280,6 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
authInfo = createAuthInfo(user, authBindEx)
|
authInfo = createAuthInfo(user, authBindEx)
|
||||||
globals.SugarLogger.Debug("authInfo==================", authInfo)
|
|
||||||
if user != nil && user.GetID() != "" {
|
if user != nil && user.GetID() != "" {
|
||||||
userProvider.UpdateLastLogin(user.GetID(), authType, ctx.GetRealRemoteIP())
|
userProvider.UpdateLastLogin(user.GetID(), authType, ctx.GetRealRemoteIP())
|
||||||
}
|
}
|
||||||
@@ -378,14 +375,12 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
|
|||||||
}
|
}
|
||||||
RemoveUserInfo(newAuthInfo.Token)
|
RemoveUserInfo(newAuthInfo.Token)
|
||||||
if newAuthInfo.AuthBindInfo.Type == AuthTypeMobile {
|
if newAuthInfo.AuthBindInfo.Type == AuthTypeMobile {
|
||||||
globals.SugarLogger.Debug("进入AuthTypeMobile,输出newAuthInfo.AuthBindInfo.AuthID", newAuthInfo.AuthBindInfo.AuthID)
|
|
||||||
err = userProvider.UpdateUserMobile(user.GetID(), newAuthInfo.AuthBindInfo.AuthID)
|
err = userProvider.UpdateUserMobile(user.GetID(), newAuthInfo.AuthBindInfo.AuthID)
|
||||||
} else if newAuthInfo.AuthBindInfo.Type == AuthTypeEmail {
|
} else if newAuthInfo.AuthBindInfo.Type == AuthTypeEmail {
|
||||||
err = userProvider.UpdateUserEmail(user.GetID(), newAuthInfo.AuthBindInfo.AuthID)
|
err = userProvider.UpdateUserEmail(user.GetID(), newAuthInfo.AuthBindInfo.AuthID)
|
||||||
} else {
|
} else {
|
||||||
if handler := authers[newAuthInfo.AuthBindInfo.Type]; handler != nil {
|
if handler := authers[newAuthInfo.AuthBindInfo.Type]; handler != nil {
|
||||||
newAuthInfo.AuthBindInfo.UserID = user.GetID()
|
newAuthInfo.AuthBindInfo.UserID = user.GetID()
|
||||||
globals.SugarLogger.Debug("进入AddAuthBind获取userID", newAuthInfo.AuthBindInfo.UserID)
|
|
||||||
handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())
|
handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())
|
||||||
err = handler.AddAuthBind(newAuthInfo.AuthBindInfo, user.GetName())
|
err = handler.AddAuthBind(newAuthInfo.AuthBindInfo, user.GetName())
|
||||||
} else {
|
} else {
|
||||||
@@ -398,7 +393,6 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
|
|||||||
func AddAuthBindWithMobile(authInfo *AuthInfo, mobile string) (err error) {
|
func AddAuthBindWithMobile(authInfo *AuthInfo, mobile string) (err error) {
|
||||||
if handler := authers[authInfo.AuthBindInfo.Type]; handler != nil {
|
if handler := authers[authInfo.AuthBindInfo.Type]; handler != nil {
|
||||||
user, err := dao.GetUserByID(dao.GetDB(), "mobile", mobile)
|
user, err := dao.GetUserByID(dao.GetDB(), "mobile", mobile)
|
||||||
globals.SugarLogger.Debug("user===============", user)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("此接口有执行顺序,请先调用注册登录接口:【第一步:Login,第二不:TiktokDecrypt】")
|
return errors.New("此接口有执行顺序,请先调用注册登录接口:【第一步:Login,第二不:TiktokDecrypt】")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5664,13 +5664,11 @@ func FilterByB2B(locationList []*common.Store4User, token string) (retVal []*com
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("检测数据userAuth,user,total==============", userAuth, user, total)
|
|
||||||
// 获取位置附近门店列表
|
// 获取位置附近门店列表
|
||||||
storeIDs := make([]int, 0, len(locationList))
|
storeIDs := make([]int, 0, len(locationList))
|
||||||
for _, v := range locationList {
|
for _, v := range locationList {
|
||||||
storeIDs = append(storeIDs, v.ID)
|
storeIDs = append(storeIDs, v.ID)
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("检测数据locationList,storeIDs==============", locationList, storeIDs)
|
|
||||||
// 判断门店是不是b2b门店,如果是,用户必须为系统管理员(门店老板和运营人员)
|
// 判断门店是不是b2b门店,如果是,用户必须为系统管理员(门店老板和运营人员)
|
||||||
store, err := dao.GetStoreList(dao.GetDB(), storeIDs, nil, nil, nil, nil, "")
|
store, err := dao.GetStoreList(dao.GetDB(), storeIDs, nil, nil, nil, nil, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -5719,8 +5717,9 @@ func FilterByB2B(locationList []*common.Store4User, token string) (retVal []*com
|
|||||||
// }
|
// }
|
||||||
// for _, v := range result {
|
// for _, v := range result {
|
||||||
// //获取门店信息
|
// //获取门店信息
|
||||||
// //storeInfos, err := GetStores(ctx, )
|
// store, err := GetStores(ctx, )
|
||||||
// //获取热销商品
|
// //获取热销商品
|
||||||
|
//
|
||||||
// //获取满减策略
|
// //获取满减策略
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
|
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
"github.com/astaxie/beego/server/web"
|
"github.com/astaxie/beego/server/web"
|
||||||
)
|
)
|
||||||
@@ -63,6 +64,7 @@ func (c *StoreController) GetStores() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("检测数据param", params)
|
||||||
retVal, err = cms.GetStores(params.Ctx, params.Keyword, params.MapData, params.Offset, params.PageSize, timeList[0], timeList[1], params.OrderCountFrom, params.OrderCountTo)
|
retVal, err = cms.GetStores(params.Ctx, params.Keyword, params.MapData, params.Offset, params.PageSize, timeList[0], timeList[1], params.OrderCountFrom, params.OrderCountTo)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
|
||||||
|
|
||||||
"errors"
|
"errors"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||||
@@ -54,7 +52,6 @@ type StoreSkuController struct {
|
|||||||
func (c *StoreSkuController) GetStoreSkus() {
|
func (c *StoreSkuController) GetStoreSkus() {
|
||||||
c.callGetStoreSkus(func(params *tStoreSkuGetStoreSkusParams) (retVal interface{}, errCode string, err error) {
|
c.callGetStoreSkus(func(params *tStoreSkuGetStoreSkusParams) (retVal interface{}, errCode string, err error) {
|
||||||
var skuIDs []int
|
var skuIDs []int
|
||||||
globals.SugarLogger.Debug("检测param=============", params)
|
|
||||||
if err = jxutils.Strings2Objs(params.SkuIDs, &skuIDs); err == nil {
|
if err = jxutils.Strings2Objs(params.SkuIDs, &skuIDs); err == nil {
|
||||||
retVal, err = cms.GetStoreSkus(params.Ctx, params.StoreID, skuIDs, params.IsFocus, params.Keyword, params.IsBySku, params.IsAct, params.MapData, params.Offset, params.PageSize)
|
retVal, err = cms.GetStoreSkus(params.Ctx, params.StoreID, skuIDs, params.IsFocus, params.Keyword, params.IsBySku, params.IsAct, params.MapData, params.Offset, params.PageSize)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user