收藏
回答

共享云环境,被授权小程序如何使用AI相关接口?

目前有小程序A(appid:wxb576617375e9e426)已共享云环境,也添加云函数clcloudbase_authcloudbase_authoudbase_authcloudbase_auth

被授权小程序B (appid:wx7a0a44d28d932ebe),按照如下初始化:

    var c1 = new wx.cloud.Cloud({

      resourceAppid: 'wxb576617375e9e426',//A小程序APPID

      resourceEnv: 'cloud1-0gtmj0jad44e58ac',//A小程序云环境

    })

  

    await c1.init()

调用AI:

 let list = await c1.extend.AI.bot.list({

        pageNumber: 1,

        pageSize: 10

      });

结果返回错误:

tcbapi_get_tcb_access_info fail Error: errCode: -501000  | errMsg: TCB_PROVIDER_ERROR_4XX 请前往云开发AI小助手查看问题:https://tcb.cloud.tencent.com/dev#/helper/copilot?q=AUTH_SIGNIN_FAILED

    at new C (<anonymous>:1:255747)

    at success (<anonymous>:1:268121)

    at Function.success (WAServiceMainContext.js?t=wechat&s=1740040493611&v=3.7.8:1)

    at p (WAServiceMainContext.js?t=wechat&s=1740040493611&v=3.7.8:1)

    at Object.success (WAServiceMainContext.js?t=wechat&s=1740040493611&v=3.7.8:1)

    at i (WAServiceMainContext.js?t=wechat&s=1740040493611&v=3.7.8:1)

    at np (WAServiceMainContext.js?t=wechat&s=1740040493611&v=3.7.8:1)

    at up (WAServiceMainContext.js?t=wechat&s=1740040493611&v=3.7.8:1)

    at WAServiceMainContext.js?t=wechat&s=1740040493611&v=3.7.8:1

    at a (WAServiceMainContext.js?t=wechat&s=1740040493611&v=3.7.8:1)

是还需要做什么设置吗,或者是方法没有调用正确

回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容