/**
* 对象序列化
* @param {Object} obj
* @return {String}
*/
paramSerializer(obj) {
console.log(obj)
if (!obj) return ‘’
let that = this
let parts = []
for(let key in obj) {
const value = obj[key]
if (value === null || that.isUndefined(value)) return
if (that.isArray(value)) {
value.forEach(function(v) {
parts.push(that.encodeUriQuery(key) + ‘=’ + that.encodeUriQuery(that.serializeValue(v)))
})
} else {
console.log(key)
parts.push(that.encodeUriQuery(key) + ‘=’ + that.encodeUriQuery(that.serializeValue(value)))
console.log(that.encodeUriQuery(key) + ‘=’ + that.encodeUriQuery(that.serializeValue(value)))
}
}
console.log(parts)
return parts.join(’&’)
}
参数:
{
id: 896
}
升级IDE之前是好的,返回正常[“id=16”] 但是 升级之后, 放在手机上就解析成了 16=16 ,电脑上就没事 ,急急急