/** 直接当前页面跳转到指定url */
export const jump = (url: string) => {
  window.location.href = url;
};

/** 在新标签页中跳转到指定url */
export const jumpBlank = (url: string) => {
  window.open(url, "_blank");
};

/** 将对象转换为url查询字符串 */
export const queryFormat = (query: Record<string, any>) => {
  const params = new URLSearchParams(query);
  return params.toString() ? `?${params}` : "";
};
