云开发环境共享,调用方函数写法

                let that = this
                // 声明新的 cloud 实例
                var c1 = new wx.cloud.Cloud({
                  // appid:'wxc10c8b55add8774e',
                  // 资源方 小程序A的 AppID
                  resourceAppid: 'wx55a611d16344349a29b78',
                  // 资源方 小程序A的 的云开发环境ID
                  resourceEnv: 'clock-4gqj41ly1bffs',
              })
        
              // 跨账号调用,必须等待 init 完成
              // init 过程中,资源方小程序对应环境下的 cloudbase_auth 函数会被调用,并需返回协议字段(见下)来确认允许访问、并可自定义安全规则
              await c1.init()
        
              // wx.cloud.database().collection('xiaoshitou').get()
              // c1.database().collection('doc').get()
              //     .then(res => {
              //         console.log('共享环境请求数据成功', res)
              //     })
              that.setData({
                c1:c1
              })

              c1.callFunction({
                name:'getOpenid',//上一步上传云函数的名字
                success(res) {
                  console.log('默认获取的openid',res.result._openid_)
                  // that.setData({
                  //   openid:res.result._openid_
                  // })
                }
              })

=============其他代码块使用 this.data.c1

// this.data.c1.callFunction({
//   // 云函数名称
//   name: 'openapi',
//   // 传给云函数的参数
//   data: ({
//     // openid:'of0NI5X-ei8B6JdcLVOEh_uLCpMI',
//     openid:that.data.openid,
//     action:'security.msgSecCheck', //模式
//     msg:e.detail.value
//   }),
// })