微信小程序解决wx.getUserProfile is not a function 问题

微信登录问题

第一步,把基础库设置成,2.16.0
在这里插入图片描述
第二步,清除所有缓存

在这里插入图片描述
第三步,重新加载编译程序
在这里插入图片描述
第四步,查看成功打印

在这里插入图片描述
参考代码

<template>
	<view style="padding-top: 100upx;">
		<button  @click="newWxLogin">新登录</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			newWxLogin(){
				uni.getUserProfile({
					desc:'登录',
					success:(res)=>{
						console.log(res);
					},
					fail:(err)=>{
						console.log(err);
					}
				})
			}
		}
	}
</script>

<style>


</style>

感谢大家,观看我们下次见


版权声明:本文为ab15176142633原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。