云函数代码如下:
exports.main = async (event, context) => {
const channel = uniCloud.deserializeSSEChannel(event.channel)
await channel.write({
a: 1
})
await channel.write({
a: 2
})
await channel.write({
a: 3
})
await channel.write({
a: 4
})
await channel.end({
a: 5
})
return {}
};
我用apifox在线调用url接口,一直响应错误:
{
"success": false,
"error": {
"code": "FunctionBizError",
"message": "Invalid sse channel"
}
}
1 个回复
e***@vip.qq.com
云函数改成这样子获取:
const httpInfo = this.getHttpInfo()
const param = JSON.parse(httpInfo.body)
await openAi(param)