提交 5221d932 编写于 作者: 雪洛's avatar 雪洛

Merge branch 'request-info' into next

...@@ -128,6 +128,7 @@ context对象的属性清单如下: ...@@ -128,6 +128,7 @@ context对象的属性清单如下:
|CLIENTIP |string |客户端IP。如果调用来源是其他服务器,会返回调用方的ip | |CLIENTIP |string |客户端IP。如果调用来源是其他服务器,会返回调用方的ip |
|CLIENTUA |string |客户端userAgent。注意非本地运行环境下客户端getSystemInfoSync也会获取ua参数并上传给云函数,但是云函数会从http请求头里面获取ua而不是clientInfo里面的ua | |CLIENTUA |string |客户端userAgent。注意非本地运行环境下客户端getSystemInfoSync也会获取ua参数并上传给云函数,但是云函数会从http请求头里面获取ua而不是clientInfo里面的ua |
|uniIdToken |string |客户端uni-id token字符串,新增于HBuilderX 3.5.1。 | |uniIdToken |string |客户端uni-id token字符串,新增于HBuilderX 3.5.1。 |
|requestId |string |当前请求id,新增于HBuilderX 3.5.5。 |
除了上述属性,如果是uni-app客户端通过callfunction访问云函数,那么context还会追加一批客户端信息。 除了上述属性,如果是uni-app客户端通过callfunction访问云函数,那么context还会追加一批客户端信息。
- HBuilderX 3.4.9前,context 添加了一批大写属性,如APPID、OS。 - HBuilderX 3.4.9前,context 添加了一批大写属性,如APPID、OS。
......
...@@ -385,6 +385,25 @@ module.exports = { ...@@ -385,6 +385,25 @@ module.exports = {
} }
``` ```
### 获取当前请求id@get-request-id
**接口形式**
`this.getUniCloudRequestId()`
**示例**
```js
module.exports = {
_after: function(error, result) {
if(error) {
const requestId = this.getUniCloudRequestId()
// log(requestId, error) 出错时记录日志,log方法需自行实现
}
}
}
```
### 获取url化时的http信息@get-http-info ### 获取url化时的http信息@get-http-info
> 新增于HBuilderX 3.5.2 > 新增于HBuilderX 3.5.2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册