This commit is contained in:
苏尹岚
2021-01-22 10:28:35 +08:00
parent 1dc91f6f9a
commit a1ddba2c78
2 changed files with 2 additions and 5 deletions

View File

@@ -518,10 +518,8 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
}
//权限
if ctx.GetUserName() != "jxadmin" {
fmt.Println("111111111111111111111111111111111111111111")
if user, err := dao.GetUserByID(db, "user_id", ctx.GetUserID()); err == nil {
if user.Type&model.UserTypeRole != 0 {
fmt.Println("22222222222222222222222222222222222222222")
if storeIDsMap, err := GetUserStoresResultMap(user.UserID); err == nil {
var storeList2 []*StoreExt
for _, v := range retVal.Stores {
@@ -529,7 +527,6 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
storeList2 = append(storeList2, v)
}
}
fmt.Println("3333333333333333333333333333333333333333333", storeIDsMap)
retVal.Stores = nil
retVal.Stores = storeList2
}

View File

@@ -230,8 +230,8 @@ type Role struct {
Name string `json:"name"` //角色名
BrandID int `orm:"column(brand_id)" json:"brandID"`
CityCodes string `json:"cityCodes"`
StoreIDs string `orm:"column(store_ids)" json:"storeIDs"`
CityCodes string `orm:"type(text)" json:"cityCodes"`
StoreIDs string `orm:"column(store_ids);type(text)" json:"storeIDs"`
}
func (*Role) TableUnique() [][]string {