This commit is contained in:
邹宗楠
2022-03-30 10:12:16 +08:00
parent 98835938e2
commit 8a52877e97
5 changed files with 15 additions and 2 deletions

View File

@@ -736,7 +736,13 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []strin
func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string, isFocus, isHighPrice bool, priceType int, keyword string, isBySku, isAct bool, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *dao.StoreSkuNamesInfo, err error) {
//权限 管理员/未登录人员不进入,商城不进入
if permission.IsRoled(ctx) || ("weixinmini" == strings.Split(ctx.GetToken(), ".")[4]) {
cc, _ := ctx.GetV2AuthInfo()
fmt.Println("111111111111111111", cc.AppID)
fmt.Println("111111111111111111", cc.Token)
fmt.Println("111111111111111111", cc.TokenType)
fmt.Println("111111111111111111", permission.IsRoled(ctx))
fmt.Println("111111111111111111", cc.Name, cc.Mobile)
if permission.IsRoled(ctx) {
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
var storeIDs2 []int
if len(storeIDs) > 0 {
@@ -746,7 +752,6 @@ func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string
}
}
if len(storeIDs2) == 0 {
// todo 可能有问题
storeIDs2 = append(storeIDs2, storeIDs...)
}
} else {

View File

@@ -419,6 +419,7 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) {
func IsRoled(ctx *jxcontext.Context) bool {
if ctx.GetUserName() != "jxadmin" {
if user, err := dao.GetUserByID(dao.GetDB(), "user_id", ctx.GetUserID()); err == nil {
fmt.Println("user111111111111111", user.Type)
if user.Type&model.UserTypeRole != 0 {
return true
}