请求参数是获取到的。但是云函数返回undefined

来源:4-7 数据库的更新和查找

qq_感觉在心中_03250223

2021-05-20

pages/index.vue

<template>
	<view>

	</view>
		
</template>

云函数cxget
’use strict’;

exports.main = async (event, context) => {
const db =uniCloud.database()
const pangxietb=db.collection(‘tc_liebiao’)
const id=event.id
console.log(id);

 return await pangxietb.where({
	
	tc_id:id

}).get()
 .then(res => {
    console.log(res);
  }).catch(err => {
    console.error(err)
  })

};

写回答

1回答

qq_感觉在心中_03250223

提问者

2021-05-21

现在能查询到,但是返回不出结果

0
1
qq_感觉在心中_03250223
还是undefined
2021-05-21
共1条回复

uni-app实战 以项目为导向 掌握完整开发流程

跟着uni-app团队开发成员快速上手高效率框架,打通前后端,完成初级全栈开发

1104 学习 · 544 问题

查看课程