encorehe
encorehe
  • 发布:2021-02-27 10:36
  • 更新:2021-04-24 11:59
  • 阅读:9582

getUserProfile

分类:uni-app

官方该增加微信小程序getUserProfile这个新方法了。。。

2021-02-27 10:36 负责人:无 分享
已邀请:
l***@139.com

l***@139.com

原为2.14.0时,报告相同错误,设置为2.16.0即可

z***@126.com

z***@126.com

大佬们,更新呀,影响贼大

2***@qq.com

2***@qq.com - 程序员王小鱼

uni.getUserProfile()

可以直接使用,也不用条件编译

亲测有效!!

  • atubo

    为啥我的出现这个错误提示:uni.getUserProfile is not a function

    2021-03-04 10:00

  • atubo

    我开发者工具的版本号是1.05.2103022

    2021-03-04 10:05

  • 金满斗

    回复 atubo: 确实是这样,我这边也不行,调试模式下可以用,发行模式就不行了。

    2021-03-05 20:35

  • 金满斗

    我这边调试模式可以,发行模式就不行了

    2021-03-05 20:36

  • 3***@qq.com

    请问一下button不用设置open-type了吗

    2021-03-11 17:15

  • 3***@qq.com

    大兄弟共享出来你的代码能行都是个鬼!

    2021-03-18 00:47

金满斗

金满斗 - 聚宝盆记账易,真的好用

解决了。1.05的开发工具表面上调试行,发行模式不行。但代码传上去了在真机上也行。就直接用的uni.getUserProfile() 命令。

  • 2***@qq.com

    怎么解决 ?我最新版本也不行啊

    2021-03-18 18:21

3***@qq.com

3***@qq.com - .。。。。。。。。。。。。。。。。

为毛我还是不行呢?

4***@qq.com

4***@qq.com

我这边也是不行,

基础库原来的2.7.7

    uni.getUserProfile();  
    console.log('uni.getUserProfile()-->',uni.getUserProfile());

提示

uni.getUserProfile is not a function;at api login success callback function

如果最新基础库 2.16.0用

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

提示出错 errMsg: "getUserProfile:fail can only be invoked by user TAP gesture."

  • wu1i

    解决了吗,我现在也报这个错

    2021-04-08 10:39

  • 4***@qq.com

    回复 wu1i: 解决了,没解决可以加我

    2021-04-14 17:31

q***@163.com

q***@163.com

调试基础库2.16.0,uni.getUserProfile()只能被点击事件触发,亲测安卓真机有效,ios未测。

_Yan

_Yan

使用这个接口,刚进入小程序,疯狂点授权按钮。会出现很多个小程序授权的弹窗,这个问题有人出现吗?咋解决吖

BBY

BBY - 80后梆梆硬

<button class="" type="default" @click="wxLogin">  
        <text style="color: #794315;">授权登录</text>  
</button>  
========================================  
// 授权登录  
      wxLogin(res) {  
        let that = this  
        console.log(res, 'ressssss');  
        if(uni.getUserProfile){  
          console.log('userprofile');  
        }  
        uni.getUserProfile({  
          desc: "用于完善会员资料",  
          success: (res) => {  
            console.log(res,'ressss');  
          }  
        })  
      }

新接口这样用

该问题目前已经被锁定, 无法添加新回复