慕后森
供参考const obj = url .substr(1) .split('&') .reduce((o, p) => { let [k, v = ''] = p.split('=') v = v === '' || (isNaN(v) ? v : Number(v)) o[k] = o[k] ? Array.isArray(o[k]) ? [...o[k], v] : [o[k], v] : v return o }, {})