es6中对象转数组,转map
//对象转数组
let array = Object.keys(userPermission).map(key=> userPermission[key])
console.log(array)
userPermission是数据对象
//对象转map
objToStrMap(obj) {
let strMap = new Map();
for (let k of Object.keys(obj)) {
strMap.set(k, obj[k]);
}
return strMap;
}
//调用objToStrMap(obj)