.then&.catch不是只会执行一个吗,为什么for执行了,下面的代码不执行,还有catch里的error为什么报undefined,搞不懂啊 axios.post(url.logintools,this.userInfoFromData)
.then(response => { console.log(response) //获取权限
var permissionsChildren = new Array() var permissionsParent = new Array() for(var i = 0; i<=response.data.responseDataObject.permissionsAll.permissionsChildren.length; i++){
permissionsChildren.push(response.data.responseDataObject.permissionsAll.permissionsChildren[i].permissionName)
} console.log(this.permissionsChildren)//这行不执行
window.localStorage.setItem("permissionsChildren",permissionsChildren);//这行不执行
})
.catch(error => { console.log(error);//这行打印permissionName is undefined
});
添加回答
举报
0/150
提交
取消