Parcourir la source

git-svn-id: https://192.168.57.71/svn/jsgkj@1207 931142cf-59ea-a443-aa0e-51397b428577

ld_zhoutl il y a 8 ans
Parent
commit
34fee23d07

+ 15 - 7
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/LoginCtl.java

@@ -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;
+    }
 }