青春纸盒子

文: 芦苇

你喜欢我笑的样子

我靠上了落寞的窗子

晚风吹起了我的袖子

明月沾湿了你的眸子


转身,你走出了两个人的圈子

树影婆娑,整座院子


挽起袖子

回头,把揽你忧伤一地的影子

装进,青春,这纸盒子


更多代码请关注我的微信小程序: "ecoder"

luwei0915

导航

demo_01 创建并使用云函数

1. 创建并使用云函数

1.1 创建button调用方法:

      btn:

<button type="primary" @click="getList">调用get_list云函数</button>

      method:

getList(){
    uniCloud.callFunction({
        name:"get_list",
        data:{
            name: 'Bob',
            age: 18
        },
        success(res) {
            console.log(res);
        },
        fail(err) {
            console.log(err)
        }
    })
}
 
1.2 云函数
'use strict';
exports.main = async (event, context) => {
  //event为客户端上传的参数
  console.log('event : ' + event)
  //返回数据给客户端
  return {
      // 返回json对象,自己随便构造
      code: 200,
      msg: event.name + '的年龄是' + event.age,
      // 不知道为啥,这个 context 拿不到
      // context
  }
};

posted on 2020-07-18 10:58  芦苇の  阅读(158)  评论(0编辑  收藏  举报