<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
import { useAuthStore } from '@/store/modules/auth';
import { autoLogin } from '@/utils/routeGuard';
import { useInfoStore } from '@/store';
const infoStore = useInfoStore();
onLaunch(async () => {
    console.log('App Launch');
    // 应用启动时检查登录状态
    try {
        // await autoLogin();
    } catch (error) {
        console.error('Auto login check failed:', error);
    }
});
// 设置token并指定过期时间（例如24小时）
console.log('设定token');
// infoStore.setToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJhcHBfdXNlcjoxOTQwMjQ1NzU5Mjk2ODY0MjU3Iiwicm5TdHIiOiJxRTE5RXhnZHVwa2hpdWo4eUo2M1pSZ0M1ZGxrNmt4YyIsImNsaWVudGlkIjoiMjAyNTAyMTQiLCJvcGVuaWQiOiJva0NHMjRrU29nT2VWTGFkc1JVYm8tS2JqR2Y4IiwidXNlcklkIjoxOTQwMjQ1NzU5Mjk2ODY0MjU3fQ.g8ZPjLyKcQQ2WOOsyoopjQMHepnutGJ5a1MGvAbgwzs');
console.log('获取用户信息,app');
// infoStore.getUserInfo();
// infoStore.getCompanyInfo();
onShow(() => {
    console.log('App Show');
});

onHide(() => {
    console.log('App Hide');
});
</script>
<style lang="scss">
@import 'uview-plus/index.scss';
@import '@/assets/styles/public.scss';
@import '@/assets/styles/uview-plus.scss';

// 设置背景色
page {
    background-color: #f7f7f7;
}
</style>
