var a='account.type=1&account.id=&account.dependFlag=0&account.card.companyId=1&account.name=%E4%B8%AD%E9%93%B6VISA%E5%8D%A1&account.hidden=&account.card.cardNo=&account.moneyTypeId=0&account.card.billDay=1&account.card.repayType=0&account.card.repayDay=20&account.card.alert=2&account.comment=%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D';

var root={};

a.split('&').sort().map(function(s){
    var p=root;
    s.match(/(.+?)(?:\.|=)/g).map(function(ss){
        var t=ss.slice(0,-1);
        p[t]=p[t]||((ss.slice(-1)==='=')?decodeURIComponent(s.match(/=(.*)$/)[1]):{});
        p=p[t];
    });
});

console.log(root);

 

相关文章:

  • 2021-12-10
  • 2021-09-25
  • 2021-11-21
  • 2021-11-30
  • 2021-11-01
  • 2021-08-02
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2022-02-09
  • 2021-11-21
  • 2021-11-01
  • 2018-03-03
相关资源
相似解决方案