/**
* @description 对象递归
* @param {Object} obj1
* @param {Object} obj2
*/
function MergeRecursive(obj1, obj2) {
let arr = Object.keys(obj2)
let index = -1
while (++index < arr.length) {
let p = arr[index]
try {
if (obj2[p].constructor == Object) {
obj1[p] = MergeRecursive(obj1[p], obj2[p])
} else {
obj1[p] = obj2[p]
}
} catch (e) {
obj1[p] = obj2[p]
}
}
return obj1
}