feat: 重构用户认证逻辑,添加导航重定向功能,更新相关组件和路由
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import { App as CapacitorApp } from "@capacitor/app";
|
||||
|
||||
const { isAuthenticated } = useAuth();
|
||||
const userStore = useUserStore();
|
||||
const { isAuthenticated } = storeToRefs(userStore);
|
||||
const { locale, loadSavedLanguage } = useLanguage();
|
||||
const { initializeWallet } = useWalletStore();
|
||||
const { updateProfile } = useUserStore();
|
||||
|
||||
onMounted(() => {
|
||||
updateProfile();
|
||||
initializeWallet();
|
||||
CapacitorApp.addListener("appStateChange", async ({ isActive }) => {
|
||||
if (isActive && isAuthenticated.value) {
|
||||
await userStore.updateProfile();
|
||||
|
||||
Reference in New Issue
Block a user