new agent(opts)
代理对象
| Name | Type | Description |
|---|---|---|
opts |
Object | 配置属性 格式:{uri:'网络地址'} |
Methods
-
userAgent(opts, cb)
-
获取用户属于哪个渠道
Name Type Default Description optsObject {} optional 参数 cbcallback function(err,result){} optional 回调 Examples
opts参数:{ "userId": 指定用户ObjectId,需有相应权限,如无,取当前token用户 }cb参数格式: 注:没渠道返回空对象 result参数:{ _id: 渠道ID, code: 渠道编码, name: "渠道名" } err参数:{ err: 错误码, msg: 错误信息 }