pan-mini/App.vue

46 lines
1022 B
Vue

<script>
export default {
onLaunch: function() {
console.log('App Launch')
// this.initLoginStatus();
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
methods:{
async initLoginStatus() {
try {
uni.showLoading({
title: '初始化中...',
mask: true
});
// 初始化登录
const success = await initLogin();
if (success) {
console.log('登录状态初始化成功');
} else {
throw new Error('登录状态初始化失败');
}
} catch (error) {
console.error('登录状态初始化失败:', error);
uni.showToast({
title: '自动登录失败,请手动登录',
icon: 'none'
});
} finally {
uni.hideLoading();
}
}
}
}
</script>
<style>
/*每个页面公共css */
</style>