//后端返回的gbe里面的对象名abc edf 随机乱变var res ={gbe:{abc:{name:'eno1',bootproto:'static',ipaddr:'192.168.1.666',netmask:'255.255.255.0',gateway:'192.168.1.3',},edf:{name:'enp3s0',bootproto:'static',ipaddr:'192.168.1.666',netmask:'255.255.255.0',gateway:'192.168.1.3',},},dns:{dns0:'192.168.1.3',dns1:'8.9.8.8',},}//前端数据对象使用固定的对象名接受,需要绑定到表单var form ={eno1:{name:'res',bootproto:'static',ipaddr:'192.168.1.243',netmask:'255.255.255.0',gateway:'192.168.1.3',},eno2:{name:'res',bootproto:'static',ipaddr:'192.168.1.242',netmask:'255.255.255.0',gateway:'192.168.1.3',},}var i =0for(let prop in res){if(prop =='dns')continue;//多于的先不要for(item in res[prop]){
i++
form['eno'+i]= res.gbe[item]//后端的随便叫什么对象名}}
console.log(res)