getuserinfo接口获取失败,这是为何?

发布于 6 年前作者 zhangping13569 次浏览最后编辑 6 年前来自 issues

<template>

<button type=“primary” open-type=“getUserInfo” @getuserinfo=“getuserInfo” withCreadentials=“true”>

微信登录

</button>

</template>

<script>

export default{

data:{

 

},

onLoad:function(){

 

},

methods:{

getuserInfo:function(res){

console.log(res);

if(!res.detail.iv){

uni.showToast({

title:“您取消了授权,登录失败”,

icon:“none”

});

return false;

}

}

}

 

}

</script>

<style>

</style>

代码如上

4 回复
qiangguo
qiangguo1 楼6 年前

你打印出来res是啥?

min09
min092 楼6 年前

看看打印的数据res 是什么

xiuying27
xiuying273 楼6 年前

sorry, 问题已经fix了,原来是我appid 写错了 囧

chaofu
chaofu4 楼4 年前

建议您在开发者工具里新建一个小程序项目,有源码哟