嘟嘟嘟aaa
嘟嘟嘟aaa
  • 发布:2022-02-21 21:32
  • 更新:2022-03-10 16:55
  • 阅读:797

uniId小程序H5都会报这个错this.t is not a function

分类:uniCloud

客户端:

<template>  
    <view class="content">  
            <button @click="login">微信一键登录</button>  
    </view>  
</template>  

<script>  
    export default {  
        methods: {  
        login(){  
            uni.login({  
                provider:"weixin",  
                success: (res) => {  
                    uniCloud.callFunction({  
                        name:'weixinlogin',  
                        data:{code:res.code},  
                        success(res) {  
                            console.log(res)  
                        },  
                        fail(err) {  
                            console.log(err)  
                        }  
                    })  
                }  
            })  
        }  
        }  
    }  
</script>

云函数:

'use strict';  
const uniID= require('uni-id')  
exports.main = async (event, context) => {  
const res = await uniID.loginByWeixin({  
    code:event.code  
})  
return res  
};

报错:


目录结构:

2022-02-21 21:32 负责人:无 分享
已邀请:
DCloud_UNI_Anne

DCloud_UNI_Anne

  • z***@qq.com

    更新了还是报错呢

    2022-03-27 15:54

  • tikyz

    请问这个问题解决了吗

    2022-04-16 23:25

  • 3***@qq.com

    回复 tikyz: 我也遇到了,把 common/uni-config-center/uni-id/config.json 配置文件中“//”及注释去掉就行了。

    2022-05-01 00:46

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