refactor: 重构登陆模块
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user