<template>
	<view class="container">
		<button class="confirm-btn" @click="login1">微信授权登录</button>
		<view class="v">
			{{text}}
		</view>	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				text: ''
			}
		},
		onLoad() {
			
		},
		methods: {
			login1() {
				uni.login({
				  provider: 'weixin',
				  success: function (loginRes) {
				    console.log(loginRes);
				    // 获取用户信息
				    uni.getUserInfo({
				      provider: 'weixin',
				      success: function (infoRes) {
				        console.log('用户昵称为：' + JSON.stringify(infoRes));
				      }
				    });
				  }
				});
			}
		}
	}
</script>

<style>
.v {
	white-space: normal;
	word-wrap: break-word;
}
</style>
