<script>
	import { getUserRolesPermissionMenu } from '@/apis/modules/user.js'
	export default {
		onLaunch: function() {
			// 查询当前角色权限
			uni.getStorageSync('token') && getUserRolesPermissionMenu({
				platformId: 4
			}).then(({ permissionMenu }) => {
				const auth = []
				const generateAuth = (list, parent) => {
					list.map(e => {
						const name = `${parent ? parent + ':' : ''}${e.name}`
						auth.push(name)
						generateAuth(e.children, name)
					})
				}
				generateAuth(permissionMenu[0].children, '')
				console.log(333, auth)
				uni.setStorageSync('auth', auth)
			}).catch(e => {})
		},
		onShow: function() {
			
		}
	}
</script>

<style lang="scss">
	@import '@/uni_modules/uni-scss/index.scss';
</style>
