diff --git a/business/jxstore/cms/permission.go b/business/jxstore/cms/permission.go index bb8aa5b11..fd825c452 100644 --- a/business/jxstore/cms/permission.go +++ b/business/jxstore/cms/permission.go @@ -323,14 +323,18 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) { if _, ok := brandIDMap[v.BrandID]; !ok { brandIDMap[v.BrandID] = 1 } - for _, cityCode := range jxutils.StrListToIntList(strings.Split(v.CityCodes, ",")) { - if _, ok := cityCodeMap[cityCode]; !ok { - cityCodeMap[cityCode] = 1 + if v.CityCodes != "" { + for _, cityCode := range jxutils.StrListToIntList(strings.Split(v.CityCodes, ",")) { + if _, ok := cityCodeMap[cityCode]; !ok { + cityCodeMap[cityCode] = 1 + } } } - for _, storeID := range jxutils.StrListToIntList(strings.Split(v.StoreIDs, ",")) { - if _, ok := storeIDMap[storeID]; !ok { - storeIDMap[storeID] = 1 + if v.StoreIDs != "" { + for _, storeID := range jxutils.StrListToIntList(strings.Split(v.StoreIDs, ",")) { + if _, ok := storeIDMap[storeID]; !ok { + storeIDMap[storeID] = 1 + } } } }