<template>
	<view>
		<u-button @click="loginUse">点击登录</u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				infoData: {}
			}
		},
		methods: {
			loginUse() {
				let that = this;
				wx.login({
					success: function(e) {
						console.log('数据：', e)

						uni.request({
							url: 'http://36.137.224.81:8030/auth/miniLogin?tenantId=000000&code=' + e
								.code,
							header: {
								"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", //
								// "Content-Type": "application/json;charset=UTF-8", //
							},
							method: 'post',
							success: res => {
								console.log('登录成功：', res)
								uni.hideLoading()
								if (res.data.code == 200) {
									that.infoData = res.data.data
								}

							},
							fail: err => {
								uni.hideLoading()
							}
						})
					}
				})
			}

		}
	}
</script>

<style>

</style>