index.js 578 Bytes
Newer Older
fukai committed
1 2 3 4 5
import Api from "~/service/Api"

export default {
  async getMenuTree() {
    
fukai committed
6
    let rtnmsg = await Api.post("/admin/menu/getMenuTree", {});
fukai committed
7 8 9 10 11 12 13 14 15 16 17 18 19
    if (rtnmsg.respCode == SUCCESS) {
      this.menuTree = rtnmsg.data
      this.menuTree.forEach((item) => {
        this.expandedKeys.push(item.id);
     });
      
    }
  },
  //获取菜单详情
  async getMenuById(data) {
    let params = {
      "id": data.id
    }
fukai committed
20
    let rtnmsg = await Api.post("/admin/menu/getMenuById", params);
fukai committed
21 22 23 24 25 26 27
    
    if (rtnmsg.respCode == SUCCESS) {
      this.menuInfo = rtnmsg.data
    }
  },

}