pengwei
2025-03-12 18fcb8ad28f583e3e1b99b23e4f7d9e1833dcd83
ÏîÄ¿´úÂë/client/src/layout/index.vue
@@ -84,7 +84,7 @@
              </div>
              <div style="margin-left: 2rem">
                <span style="color: rgb(255, 255, 255); font-size: 0.88rem"
                  >姓名:超级管理员</span
                  >姓名:{{ userName }}</span
                >
              </div>
              <img
@@ -179,7 +179,7 @@
@import "./index.less";
</style>
<script>
import { getTreeMenu } from "@/api/menu.js";
// import { getTreeMenu } from "@/api/menu.js";
import { baseUrl } from "../utils";
import loading from "@/components/basic/RouterLoading";
@@ -558,52 +558,52 @@
      Object.assign(_config.$tabs, { open: open, close: close });
      //初始化菜单
      getTreeMenu().then((res) => {
        console.log("meanu", res);
        res.push({ id: "1", name: "首页", url: "/home" }); // ä¸ºäº†èŽ·å–é€‰ä¸­id使用
        res.forEach((d) => {
          d.path = (d.url || "").replace("/Manager", "");
          d.to = (d.url || "").replace("/Manager", "");
          if (!d.icon || d.icon.substring(0, 3) != "el-") {
            d.icon = "el-icon-menu";
          }
        });
      // getTreeMenu().then((res) => {
      //   console.log("meanu", res);
      //   res.push({ id: "1", name: "首页", url: "/home" }); // ä¸ºäº†èŽ·å–é€‰ä¸­id使用
      //   res.forEach((d) => {
      //     d.path = (d.url || "").replace("/Manager", "");
      //     d.to = (d.url || "").replace("/Manager", "");
      //     if (!d.icon || d.icon.substring(0, 3) != "el-") {
      //       d.icon = "el-icon-menu";
      //     }
      //   });
        store.dispatch("setPermission", res);
      //   store.dispatch("setPermission", res);
        console.log("权限", store.state);
        menuOptions.value = res;
        permissionInited.value = true;
      //   console.log("权限", store.state);
      //   menuOptions.value = res;
      //   permissionInited.value = true;
        //开启消息推送(main.js中设置是否开启signalR)2022.05.05
        if (_config.$global.signalR) {
          MessageConfig(http, (result) => {
            messageList.unshift(result);
            //    console.log(result)
          });
        }
      //   //开启消息推送(main.js中设置是否开启signalR)2022.05.05
      //   if (_config.$global.signalR) {
      //     MessageConfig(http, (result) => {
      //       messageList.unshift(result);
      //       //    console.log(result)
      //     });
      //   }
        //当前刷新是不是首页
        if (router.currentRoute.value.path != navigation[0].path) {
          //查找系统菜单
          let item = menuOptions.value.find((x) => {
            return x.path == router.currentRoute.value.path; //this.$route.path;
          });
          if (item) return onSelect(item.id);
          //查找顶部快捷连接
          item = links.value.find((x) => {
            return x.path == router.currentRoute.value.path; //this.$route.path;
          });
          //查找最后一次跳转的页面
          if (!item) {
            item = getItem();
          }
          if (item) {
            return open(item, false);
          }
        }
        selectId.value = "1";
      });
      //   //当前刷新是不是首页
      //   if (router.currentRoute.value.path != navigation[0].path) {
      //     //查找系统菜单
      //     let item = menuOptions.value.find((x) => {
      //       return x.path == router.currentRoute.value.path; //this.$route.path;
      //     });
      //     if (item) return onSelect(item.id);
      //     //查找顶部快捷连接
      //     item = links.value.find((x) => {
      //       return x.path == router.currentRoute.value.path; //this.$route.path;
      //     });
      //     //查找最后一次跳转的页面
      //     if (!item) {
      //       item = getItem();
      //     }
      //     if (item) {
      //       return open(item, false);
      //     }
      //   }
      //   selectId.value = "1";
      // });
    };
    created();
    return {