|
@@ -8,6 +8,7 @@ import org.apache.shiro.session.Session;
|
|
|
import org.apache.shiro.subject.Subject;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import com.xt.js.gkaq.common.BaseCtl;
|
|
|
import com.xt.js.gkaq.common.Constants;
|
|
@@ -24,13 +25,6 @@ public class LoginCtl extends BaseCtl {
|
|
|
|
|
|
@RequestMapping(value = "/index")
|
|
|
public String index() {
|
|
|
- Session session = SecurityUtils.getSubject().getSession();
|
|
|
- // TODO 获取当前用户菜单DEMO
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- List<MenuModel> menuList = (List<MenuModel>) session.getAttribute(Constants.SESSION_KEY_MENUS);
|
|
|
- for (MenuModel menu : menuList) {
|
|
|
- System.out.println("menu : " + menu.getCode() + " | " + menu.getName());
|
|
|
- }
|
|
|
return "sys/index";
|
|
|
}
|
|
|
|
|
@@ -64,4 +58,18 @@ public class LoginCtl extends BaseCtl {
|
|
|
public String noperm() {
|
|
|
return "sys/index";
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 初始化页面加载树
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @RequestMapping("getUserMenuTree")
|
|
|
+ @ResponseBody
|
|
|
+ public List<MenuModel> getUserMenuTree() {
|
|
|
+ Session session = SecurityUtils.getSubject().getSession();
|
|
|
+ List<MenuModel> menuList = (List<MenuModel>) session.getAttribute(FrameParam.SESSION_KEY_MENUS);
|
|
|
+ return menuList;
|
|
|
+ }
|
|
|
}
|