// 转化字符串（key,value)
export const objToParam = function (param) {
    if (Object.prototype.toString.call(param) !== '[object Object]') {
      return ''
    }
    let queryParam = ''
    for (let key in param) {
      if (param.hasOwnProperty(key)) {
        let value = param[key]
        queryParam += toQueryPair(key, value)
      }
    }
    return queryParam
  }
  function toQueryPair(key, value) {
    if (typeof value == 'undefined') {
      return `${key}=&`
    }
    return `${key}=${value}&`
  }