查看: 86|回覆: 0

uni app 微信小程序登录问题 getUserProfile

[複製鏈接]

1

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2008-4-7
發表於 2021-4-17 18:12:00 | 顯示全部樓層 |閲讀模式

uni app 开发微信小程序发布后被拒绝了,是因为我用的是以前的微信登录方式
4.13号后一定要来新的登录方式(getUserProfile)实现登录功能,否则腾讯被拒绝。

不需要以前那样什么open-type等等;直接用@click方法调用

<button @click="newWxLogin">新登录</button>

  newWxLogin(){
    uni.getUserProfile({
        desc:'登录',
        success:(res)=>{
	     console.log(res);
	},
	fail:(err)=>{
	     console.log(err);
        }
    })
 }

可是我的报错了uni.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>



来源:https://www.cnblogs.com/nurmemet/p/14671695.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部