<template>
	<web-view :src="webSrc"></web-view>
</template>

<script>
export default {
	data() {
		return {
			webSrc: ''
		}
	},
	onLoad() {
		const value = uni.getStorageSync('userinfo_storage_key')
		if (value) {
			const cardNumber = value.card_number
			this.webSrc = `https://chtech.ncjti.edu.cn/classSchedule/#/?number=${cardNumber}`
		} else {
			uni.showToast({
				title: '请授权后再查看课表',
				icon: 'none',
				duration: 2000
			})
			setTimeout(() => {
				uni.reLaunch({
					url: '/pages/index/index'
				})
			}, 2000)
		}
	}
}
</script>

<style></style>
