<template>
	<view class="content">
		<web-view :src="src"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				src: ''
			}
		},
		onShow() {
			// 必须登录
			let userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {}
			console.log(userInfo)
			if(userInfo.token) {
				this.src = 'http://localhost:8080/?token=' + userInfo.token
				// this.src = 'https://chang-map.js-dyyj.com?token=' + userInfo.token
				console.log(this.src)
			}else {
				uni.navigateTo({
					url: '/pages/login/login'
				})
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100vw;
		height: 100vh;
		padding-bottom: env(safe-area-inset-bottom)
	}
</style>