// 获取页面cookie
export const getCookie = (name: string) => {
  const strCookie = document.cookie;
  const arrCookie = strCookie.split("; ");
  let i: number;
  for (i = 0; i < arrCookie.length; i++) {
    const arr = arrCookie[i].split("=");
    if (arr[0] === name) {
      return arr.filter((_, index) => index !== 0).join("=");
    }
  }
  return "";
};
