<template>
	<view>
	
	</view>
</template>

<script>
		import cacheManager from "@/utils/cacheManager.js";
	export default {
		onLoad() {
			// 检查登录状态
			const token = cacheManager.get('auth');
			const isLoggedIn = !!token;
			
			if (isLoggedIn) {
				console.log('已登录，跳转到主tab页面');	
				// 已登录，跳转到主tab页面
				uni.switchTab({
					url: '/pages/chanpinXuanze/index'
				});
			} else {
				// 未登录，跳转到登录页
					console.log('未登录，跳转到登录页');	
				uni.redirectTo({
					url: '/pages/login/index'
				});
			}
		}
	}
</script>