连接数据库并修改页面

This commit is contained in:
not-like-juvenile
2026-02-02 18:20:22 +08:00
parent 5f856a96c9
commit 8efe6d5e89
22 changed files with 1630 additions and 992 deletions

View File

@@ -1,4 +1,4 @@
import { supabase, ensureSupabaseReady } from '@/components/supadb/aksupainstance.uts'
import supabase, { supaReady } from '@/components/supadb/aksupainstance.uts'
import type { UserProfile } from '@/types/mall-types.uts'
/**
@@ -8,8 +8,8 @@ import type { UserProfile } from '@/types/mall-types.uts'
*/
export async function ensureUserProfile(sessionUser: UTSJSONObject): Promise<UserProfile | null> {
try {
await ensureSupabaseReady()
await supaReady
// 从 sessionUser 中获取用户ID和邮箱
const userId = sessionUser.getString('id')
const email = sessionUser.getString('email') ?? ''