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