·
Across the Great Wall, we can reach every corner in the world.

satisfied 手写了一个给你:

export function getCookie(name: string): string {
  const value = `; ${document.cookie}`;
  const parts: string[] = value.split(`; ${name}=`);
  if (parts.length === 2) {
    return parts.pop()!.split(';').shift() || '';
  }
  return '';
}