diff --git a/app/pages/auth/login.vue b/app/pages/auth/login.vue index 2cc16fe..0e12a89 100644 --- a/app/pages/auth/login.vue +++ b/app/pages/auth/login.vue @@ -60,6 +60,11 @@ async function handleLogin() { }) $toast.success('登录成功!') await refresh(true) + try { + await $fetch('/api/agent/migrate', { method: 'POST' }) + } catch (e) { + console.error('迁移临时会话失败', e) + } await navigateTo(redirect.value) } catch (e: any) { $toast.error(e?.data?.statusMessage || e?.message || '登录失败') @@ -69,12 +74,17 @@ async function handleLogin() { } } -onMounted(() => { +onMounted(async () => { fetchCaptcha() const url = new URL(window.location.href) if (url.searchParams.get('oauth_success') === '1') { - refresh(true) + await refresh(true) + try { + await $fetch('/api/agent/migrate', { method: 'POST' }) + } catch (e) { + console.error('迁移临时会话失败', e) + } router.push('/') } if (url.searchParams.get('oauth_error')) { diff --git a/packages/drizzle-pkg/db.sqlite b/packages/drizzle-pkg/db.sqlite index e457305..7f312a2 100644 Binary files a/packages/drizzle-pkg/db.sqlite and b/packages/drizzle-pkg/db.sqlite differ