1
export function urlAddParams(params) {
  let str = '';
  let keys = Object.keys(params);
  let len = keys.length - 1;
  keys.forEach((key, index) => {
    str += key + '=' + params[key] + (index < len ? '&' : '');
  });
  let { origin, pathname, search, hash } = window.location;
  search = search === '' ? '?' : search + '&';
  return origin + pathname + search + str + hash;
}

起风了
120 声望35 粉丝

北冥有鱼,其名为鲲。鲲之大,不知其几千里也;化而为鸟,其名为鹏。鹏之背,不知其几千里也;怒而飞,其翼若垂天之云。是鸟也,海运则将徙于南冥。南冥者,天池也。