Use splice to remove the specified items in the array, the result is incorrect

use splice to remove the items specified in the array, but the result is not correct
the following code, I need to keep children.path=allOrder | | items of children.path=accessPage

    let routers = [
        {
            path: "/index",
            name: "Index",
            children: [{
                path: "accountManagement",
                name: "accountManagement",
                meta: { title: "", icon: "el-icon-setting" }
            }]
        },
        {
            path: "/index",
            name: "paltform logs",
            meta: { title: "", icon: "el-icon-menu" },
            children: [{
                    path: "UserBehavior",
                    meta: { title: "" },
                    name: "UserBehavior"
                }, {
                    path: "errorOrder",
                    meta: { title: "" },
                    name: "errorOrder"
                }, {
                    path: "statisticRecharge",
                    meta: { title: "" },
                    name: "StatisticRecharge"
                },
                {
                    path: "allOrder",
                    meta: { title: "" },
                    name: "allOrder"
                }, {
                    path: "userRechargeError",
                    meta: { title: "" },
                    name: "userRechargeError"
                }
            ]
        },
        {
            path: "/index",
            name: "wechat api",
            meta: { title: "", icon: "el-icon-menu" },
            children: [{
                path: "chart",
                meta: { title: "" },
                name: "Chart"
            }, {
                path: "visitDistribution",
                meta: { title: "" },
                name: "VisitDistribution"
            }, {
                path: "accessRetention",
                meta: { title: "" },
                name: "AccessRetention"
            }, {
                path: "accessPage",
                meta: { title: "" },
                name: "accessPage"
            }, {
                path: "userPortrait",
                meta: { title: "" },
                name: "UserPortrait"
            }, {
                path: "payStatistics",
                meta: { title: "" },
                name: "PayStatistics"
            }]
        }
    ]

 
    function filterAsyncRouter(Router) {
        console.log(Router)
      if(Router && Router.length){
        for(let i=0;i<Router.length;iPP){
            if(Router[i].name && Router[i].children){
              for(let k=0;k<Router[i].children.length;kPP){
                  if(!hasPermissionName(Router[i].children[k].name)){
                    Router[i].children.splice(k,1)
                    kPP
                  }
              }
            }
          
        }
      }
      console.log(Router)
    }

   function hasPermissionName(routerName) {
       let permissions = ["allOrder","accessPage"]
      for (let i = 0; i < permissions.length; iPP) {
        if(permissions[i]===routerName){
          return true
        }
      }
    }

    filterAsyncRouter(routers)

Mar.30,2021

change kPP to KMY-

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e94980-472a5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e94980-472a5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?