export const getAuthToken = (): string | null => {
    try {
      const storedUser = localStorage.getItem('user');
      const user = storedUser ? JSON.parse(storedUser) : null;
      return user?.token || null;
    } catch (error) {
      console.error('获取token失败:', error);
      return null;
    }
  };
  