* 对象序列化 * @param {Object} obj * @return {String}
(obj)
| 565 | * @return {String} |
| 566 | */ |
| 567 | paramSerializer(obj) { |
| 568 | if (!obj) return '' |
| 569 | let that = this |
| 570 | let parts = [] |
| 571 | for (let key in obj) { |
| 572 | //if(key=='url')continue; |
| 573 | const value = obj[key] |
| 574 | if (value === null || that.isUndefined(value)) return |
| 575 | if (that.isArray(value)) { |
| 576 | value.forEach(function(v) { |
| 577 | parts.push(that.encodeUriQuery(key) + '=' + that.encodeUriQuery(that.serializeValue(v))) |
| 578 | }) |
| 579 | } else { |
| 580 | parts.push(that.encodeUriQuery(key) + '=' + that.encodeUriQuery(that.serializeValue(value))) |
| 581 | } |
| 582 | } |
| 583 | return parts.join('&') |
| 584 | } |
| 585 | |
| 586 | /** |
| 587 | * 拼接URL |
no test coverage detected