Authored by weiqingting

修改 新建对象

... ... @@ -297,12 +297,23 @@ var util = {
var name = arr.shift();
obj = obj || {};
if(arr.length){
obj[name] = obj[name] || {};
util.__buildobj(arr.join(symble),symble,obj[name],fn);
if(/^\d+$/.test(name)){
var objArr=$.extend(true,{},obj);
if($.inArray(obj)){
obj=[];
}
obj[name] = objArr[name] || {};
}else{
obj[name] = obj[name] || {};
}
obj[name]=util.__buildobj(arr.join(symble),symble,obj[name],fn);
}else{
if(typeof fn == 'function'){
fn(obj,name);
}
if(typeof fn == 'function'){
if(/^\d+$/.test(name)){
obj=[];
}
fn(obj,name);
}
}
return obj;
},
... ...
... ... @@ -511,7 +511,7 @@ $(document).on("click", "#submit", function() {
/*测试*/
var AAA={};
common.util.__buildobj("a.1.b",".",AAA,function(obj,name){
var bbb=common.util.__buildobj("a.0.b",".",AAA,function(obj,name){
obj[name]="1";
});
console.log(AAA);
\ No newline at end of file
console.log(bbb);
\ No newline at end of file
... ...
... ... @@ -14,11 +14,11 @@ var config = {
apiKey: 'sd4H1ecAqlp',
// domain:'http://192.168.102.216:8080/platform',
// domain: 'http://172.16.6.240:8088/platform',
domain:'http://172.16.6.176:8088/platform',// 王书生
// domain:'http://172.16.6.176:8088/platform',// 王书生
// domain: 'http://172.16.6.214:8088/platform',//陈超
//http://172.16.6.124:8088/platform/product/queryAllProductAttr
//domain: 'http://172.16.6.146:8088/platform', //玛丽
// domain: 'http://192.168.102.202:8088/platform',
domain: 'http://192.168.102.202:8088/platform',
//domain:'http://172.16.6.157:8080/yohobuy-platform-web',//葛超
//domain: 'http://172.16.6.239:8080', //孙杰翔
//domain:'http://172.16.6.189:8088/platform', //李健1
... ...