<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			let userInfo = uni.getStorageSync('userInfo')
			if (!userInfo || !userInfo.userId) {
				return
			}
			this.API.getAppAuthorize().then(res => {
				if (res.code === 200 && res.data) {
					// 将菜单数据存储到本地存储
					uni.setStorageSync('appMenuData', res.data)
					console.log('菜单数据已保存:', res.data)
				}
			}).catch(err => {
				console.error('获取菜单数据失败:', err)
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
	
</style>
