diff --git a/bin/www b/bin/www index a799577969860673075c5ea9fe6c676993486104..a2cfb54ad47e378f74757105655eb1143a80c9ef 100644 --- a/bin/www +++ b/bin/www @@ -44,7 +44,7 @@ app.use(dept); app.use(errorHandler) -const server = app.listen(3002, function () { +const server = app.listen(3102, function () { try { let host = server.address().address; host = host.replace("::", "localhost"); diff --git a/services/userServices.js b/services/userServices.js index dbb61f6ce816446317015ec3791282298cdc1c1a..d20788415d6f14c3ac5433fa00b2d19528326ddb 100644 --- a/services/userServices.js +++ b/services/userServices.js @@ -56,11 +56,15 @@ class UserServices { const menuIdArrNew = []; menuIdArr.forEach((menuId) => { - menuIdArrNew.push(menuId); const menu = menuList.find((x) => { return x.id === menuId; }); - const pid = menu.pid; + if(!menu){ + return + } + menuIdArrNew.push(menuId); + console.log('menu',menu); + const pid = menu?.pid; const index = menuIdArrNew.indexOf(pid); if (pid !== 0 && index === -1) { menuIdArrNew.push(pid); @@ -69,6 +73,9 @@ class UserServices { return x.id === pid; }); const pid1 = parentMenu.pid; + if(!parentMenu){ + return + } const index1 = menuIdArrNew.indexOf(pid1); if (pid1 !== 0 && index1 === -1) { menuIdArrNew.push(pid1);