|
@@ -128,13 +128,13 @@ func GetMenuList(token string, roleId int) (items []*system.SysMenu, err error)
|
|
|
|
|
|
// 先从缓存里面获取,如果取不到,那么再去调用接口
|
|
|
key := fmt.Sprintf("%s%s", utils.CACHE_USER_MENU, utils.MD5(token))
|
|
|
- //menuJsonStr, tmpErr := utils.Rc.RedisString(key)
|
|
|
- //if tmpErr == nil && menuJsonStr != `` {
|
|
|
- // err = json.Unmarshal([]byte(menuJsonStr), &items)
|
|
|
- // if err == nil {
|
|
|
- // return
|
|
|
- // }
|
|
|
- //}
|
|
|
+ menuJsonStr, tmpErr := utils.Rc.RedisString(key)
|
|
|
+ if tmpErr == nil && menuJsonStr != `` {
|
|
|
+ err = json.Unmarshal([]byte(menuJsonStr), &items)
|
|
|
+ if err == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
resp, err := third.GetUserInfo(token)
|
|
|
if err != nil {
|
|
@@ -143,7 +143,6 @@ func GetMenuList(token string, roleId int) (items []*system.SysMenu, err error)
|
|
|
}
|
|
|
|
|
|
if resp.Info.Resource != nil && len(resp.Info.Resource) > 0 {
|
|
|
-
|
|
|
for _, v := range resp.Info.Resource {
|
|
|
var nameEn, path, iconPath, component, levelPath, buttonCode, api string
|
|
|
if v.NameEn != nil {
|