m***@163.com
m***@163.com
  • 发布:2024-09-12 17:59
  • 更新:2024-09-13 01:04
  • 阅读:204

【报Bug】云对象url化,checkToken报错"Check token failed"

分类:uniCloud

产品分类: uniCloud/App

示例代码:
const cloudTest = async () => {  

await uni.request({  

url: baseUrl + '/order/test',  

method: 'POST',  

data: {  

token: uni.getStorageSync('uni_id_token')  

}  

}).then((res) => {  

console.log('cloudTest', res);  

})  

}
_before: function () { // 通用预处理器  
        this.startTime = Date.now()  

        this.uniID = uniID.createInstance({ // 创建uni-id实例,其上方法同uniID  
            clientInfo: this.getClientInfo()  
        })  

        if(this.getHttpInfo().body) {  
          params = JSON.parse(this.getHttpInfo().body)  
        }  
        query = this.getHttpInfo().queryStringParameters  

        dbJQL = uniCloud.databaseForJQL({ // 获取JQL database引用,此处需要传入云对象的clientInfo  
              clientInfo: this.getClientInfo()  
        })  
    },  

test: async function () {  
        let {token} = params;  
        const res = await this.uniID.checkToken(token)  
        return  {  
            token,  
            res  
        }  
    },

操作步骤:

如代码示例中所示

预期结果:

token校验返回uid等

实际结果:

code: 30202
errCode: "uni-id-check-token-failed"
errMsg: "Check token failed

bug描述:

checkToken报错,如何解决

code: 30202
errCode: "uni-id-check-token-failed"
errMsg: "Check token failed"

2024-09-12 17:59 负责人:DCloud_uniCloud_CRL 分享
已邀请:
DCloud_uniCloud_CRL

DCloud_uniCloud_CRL

按照你的代码 test 函数内 params 变量应该不存在吧

  • m***@163.com (作者)

    params 变量是存在的

    2024-09-12 18:25

m***@163.com

m***@163.com (作者)

解决了,把uni-id相关的云对象全都覆盖了,checkToken不报错了

要回复问题请先登录注册