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

<script>
	export default {
		data() {
			return {
				href: "",
				
				staff_num:"",
				mine_code:""
			};
		},
		onLoad() {
			this.staff_num = uni.getStorageSync('user').staff_num
			this.mine_code = uni.getStorageSync('mine_code')

			this.get_token()
		},
		methods:{
			get_token(){
				uni.request({
					// 登录 获取token
					method:"POST",
					url: "http://shangtang.nxjiewei.com:8011/v1/app/token/get",
					header:{
						"Content-Type": "application/json"
					},
					data: {
						staff_num: this.staff_num,
						area_code: this.mine_code
					},
					success: (res) => {
						console.log(res.data.data)
						
						this.href = "http://shangtang.nxjiewei.com:8011/?token=" + res.data.data.access_token
					},
					fail: (err) => {
						uni.showToast({
							icon:"none",
							title:err
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
