function getCookie(name) {
  const value = `; ${document.cookie}`;
  const parts = value.split(`; ${name}=`);
  if (parts.length === 2) return parts.pop().split(';').shift();
}
This function retrieves the token from the hoyolab check-in page.
To use this function, open the hoyolab check-in page, press F12 to enter the console, paste the code, and run it.
Visit: https://www.hoyolab.com/circles

Update on 2023-12-01:
hoyolab uses HttpOnly Cookie, which can no longer be obtained through document.cookie.
This script is invalid, please use the method of manually copying the cookie to obtain the token.