feat: 添加登录组件,更新认证流程,优化输入标签组件

This commit is contained in:
2025-12-12 02:50:52 +07:00
parent 2050184075
commit 5bd063f982
7 changed files with 408 additions and 6 deletions

View File

@@ -0,0 +1,51 @@
<script lang='ts' setup>
import { modalController } from "@ionic/vue";
import { logoGoogle } from "ionicons/icons";
async function closeModal() {
await modalController.dismiss();
}
</script>
<template>
<IonPage>
<IonHeader class="ion-no-border">
<IonToolbar>
<IonButtons slot="start">
<IonButton @click="closeModal">
Close
</IonButton>
</IonButtons>
</IonToolbar>
</IonHeader>
<IonContent :fullscreen="true" class="ion-padding">
<h1 class="title">
<strong>Log in</strong>
</h1>
<ui-input-label
label="Email"
type="email"
placeholder="Enter your email"
clear-input
/>
<ion-button expand="block" class="ion-margin-top" shape="round">
Next
</ion-button>
<ui-divider text="Or continue with" />
<ion-button color="medium" expand="block" class="ion-margin-top" shape="round">
<IonIcon slot="start" aria-hidden="true" :icon="logoGoogle" />
Google
</ion-button>
</IonContent>
</IonPage>
</template>
<style scoped>
.title {
margin-bottom: 30px;
}
</style>

View File

@@ -1,7 +1,6 @@
import { modalController } from "@ionic/vue";
import { emailOTPClient } from "better-auth/client/plugins";
import { createAuthClient } from "better-auth/vue";
import SignupContent from "./components/signup.vue";
export const authClient = createAuthClient({
fetchOptions: {
@@ -11,8 +10,22 @@ export const authClient = createAuthClient({
});
export async function modelControllerSignup(presentingElement?: HTMLElement) {
const SignupContent = await import("./components/signup.vue");
const modal = await modalController.create({
component: SignupContent,
component: SignupContent.default,
presentingElement,
canDismiss: async (data, role) => role !== "gesture",
});
return modal;
}
export async function modelControllerLogin(presentingElement?: HTMLElement) {
const LoginContent = await import("./components/login.vue");
const modal = await modalController.create({
component: LoginContent.default,
presentingElement,
canDismiss: async (data, role) => role !== "gesture",
});