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>


