赛思维服务调研
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
435 B

package controllers
import (
"SSW_WebPlatform/utils"
"SSW_WebPlatform/web/middleware/jwts"
"SSW_WebPlatform/web/models"
"SSW_WebPlatform/web/supports"
"github.com/kataras/iris/v12"
)
func DynamicMenu(ctx iris.Context) {
user, ok := jwts.ParseToken(ctx)
if !ok {
return
}
utils.TrimStruct(user,*user)
menu := new(models.Menu)
menuTree,_ := menu.SetMenuRole(user.Role)
supports.Ok(ctx, supports.OptionSuccess, menuTree)
}