收藏
回答

调用wx.cloud.callContainer报错?

AppID
wx9a502d43f28c1e19
    const result = await wx.cloud.callContainer({
      config: {
        env: 'prod-4gle94hxd366118e'// 微信云托管的环境ID
      },
      path: '/api/sys.login'// 填入业务自定义路径和参数,根目录,就是 / 
      method: 'POST'// 按照自己的业务开发,选择对应的方法
      header: {
        'X-WX-SERVICE''springboot-lizc-004'// xxx中填入服务名称(微信云托管 - 服务管理 - 服务列表 - 服务名称)
      }
      // dataType:'text', // 默认不填是以JSON形式解析返回结果,若不想让SDK自己解析,可以填text
    })


报错:Error: cloud.callContainer:fail Error: errCode: -501000  | errMsg: Invalid host. For more information, please refer to https://docs.cloudbase.net/error-code/service (callId: 1718028984344-0.9449529851275107) (trace: 22:16:24 start->22:16:24 system error (Error: errCode: -501000  | errMsg: Invalid host. For more information, please refer to https://docs.cloudbase.net/error-code/service), abort)

    at R (<anonymous>:1:163369)

    at <anonymous>:1:225974(env: Windows,mp,1.06.2402040; lib: 2.32.3)

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

1 个回答

  • 乌卡
    乌卡
    2025-12-26

    您好,有解法了吗? 我也遇到相同的问题。

    2025-12-26
    有用
    回复
登录 后发表内容
问题标签