Authored by baoss

优化代码 review by bevishuang

... ... @@ -52,6 +52,12 @@ App({
})
```
注意某些缓存key的设置:
**会话id: 'sid'**
**union_id: 'WXUnion_ID' **
**open_id: 'openID'**
## 插件功能列表
### # api请求调用
... ... @@ -185,6 +191,7 @@ App({
### # 监控上报 appReport(args, app)
**参数**
args Object 包含以下属性 具体上报参数可参考:('http://git.yoho.cn/mobile/YHAppReport')
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| ---- | ---- | ---- | ---- | ---- |
| reportType | string | 'hb' | 否 | "start"或"destory"或"stop"或"hb" |
... ... @@ -195,10 +202,10 @@ args Object 包含以下属性 具体上报参数可参考:('http://git.yoho
app 小程序app实例 必填
使用示例
```javascript
let app = getApp()
plugin.appReport({ reportType:'start', pt:'LIFECYCLE', pn:'RESUME' }, app)
```
```javascript
let app = getApp()
plugin.appReport({ reportType:'start', pt:'LIFECYCLE', pn:'RESUME' }, app)
```
### # 大数据上报 yasReport(eventId, data, app)
**参数**
... ... @@ -210,10 +217,10 @@ app 小程序app实例 必填
| app | Object | | 是 | 小程序app实例 |
使用示例
```javascript
let params = { 'CHANNEL': channel, 'TYPE': channelType };
let app = getApp()
plugin.yasReport(YB_LAUNCH_APP, params, app);
```
```javascript
let params = { 'CHANNEL': channel, 'TYPE': channelType };
let app = getApp()
plugin.yasReport(YB_LAUNCH_APP, params, app);
```
 
\ No newline at end of file
... ...
... ... @@ -20,7 +20,6 @@ export const yasReport = async function (eventId = '', data = {}, app) {
let cid = dataUtils.getConfig().reportParams.cid;
let open_id = dataUtils.getGlobalDataByKey('openID');
let union_id = dataUtils.getGlobalDataByKey('WXUnion_ID');
let union_type = app.getUnion_type();
... ...