feat: 实现用户登出功能并更新路由
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<script lang='ts' setup>
|
||||
import type { UpdateUserProfileBody, UserProfileData } from "@/api/types";
|
||||
import { alertController, toastController } from "@ionic/vue";
|
||||
import { arrowBackOutline, cameraOutline, chevronForwardOutline } from "ionicons/icons";
|
||||
import { arrowBackOutline } from "ionicons/icons";
|
||||
import { client } from "@/api";
|
||||
import { authClient } from "@/auth";
|
||||
|
||||
const router = useRouter();
|
||||
const userProfile = ref<UserProfileData | null>(null);
|
||||
@@ -81,8 +82,8 @@ async function handleSignOut() {
|
||||
text: "Sign Out",
|
||||
role: "destructive",
|
||||
handler: async () => {
|
||||
// TODO: 实现登出逻辑
|
||||
router.push("/");
|
||||
authClient.signOut();
|
||||
router.replace("/layout/riwa");
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user