refactor: 重构登陆模块

This commit is contained in:
2025-12-20 21:38:49 +07:00
parent 3d9785fdf2
commit 57bbebe961
28 changed files with 715 additions and 494 deletions

View File

@@ -1,18 +1,9 @@
<script setup lang="ts">
import { authClient, modelControllerLogin, modelControllerSignup } from "@/auth";
import { authClient } from "@/auth";
const page = useTemplateRef<PageInstance>("page");
const { user } = useAuth();
const tradingViewContainer = useTemplateRef<HTMLElement>("tradingViewContainer");
async function openSignin() {
const modal = await modelControllerLogin(page.value?.$el);
await modal.present();
}
async function openSignup() {
const modal = await modelControllerSignup(page.value?.$el);
await modal.present();
}
async function handleLogout() {
await authClient.signOut();
}
@@ -32,17 +23,17 @@ useTradingView(tradingViewContainer, {
</script>
<template>
<IonPage ref="page">
<IonPage>
<IonHeader>
<IonToolbar class="ui-tabbar">
<IonTitle>Home</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent :fullscreen="true">
<IonButton @click="openSignin">
<IonButton @click="$router.push('/auth/login')">
Log in
</IonButton>
<IonButton @click="openSignup">
<IonButton @click="$router.push('/auth/signup')">
Sign up
</IonButton>
<IonButton @click="handleLogout">