<template>
	<view>登录页</view>
</template>

<script>
	import loginApi from '@/api/login.js'
export default {
	data() {
		return {};
	},
	created() {
		this.loginWeixin()
	},
	methods: {
		loginWeixin() {
			uni.login({
				provider: 'weixin',
				success: loginRes => {
					const code = loginRes.code
					loginApi.loginWeixin(code).then(res=>{
						console.log(res)
					})
				},
				fail: err => {
					console.log(err)
				}
			});
		}
	}
};
</script>

<style></style>
