Class: ServiceApi

ServiceApi

ServiceApi


new ServiceApi()

service sdk入口

Methods


<async> getToken(oauth_consumer_key, oauth_consumer_secret) → {promise}

获取认证Token

Parameters:
Name Type Description
oauth_consumer_key string

认证的软件key

oauth_consumer_secret string

认证软件key对应的value

Returns:

返回一个promise,data.accountToken为token值

Type
promise

<async> heartbeat() → {promise}

用户心跳保活

Returns:

返回一个promise

Type
promise

<async> heartbeatAPS() → {promise}

aps保活

Returns:

返回一个promise

Type
promise

<async> heartbeatToken() → {promise}

token 保活

Returns:

返回一个promise

Type
promise

init(options)

初始化接口, 保存信息, 后续接口缺失参数可从中读取

Parameters:
Name Type Description
options object

参数对象

Properties
Name Type Description
app_key string

认证的软件key

app_secret string

认证软件key对应的value

username string

登录用户名

password string

登录密码

aps_params object

aps登录参数

Properties
Name Type Description
Version string

终端版本号

IsSecurity number

是否支持账号安全规则,0:否,1:是 默认值:0

DeviceType string

必填,终端型号

ApsLocalIp string

必填,APS的本地IP地址

UserName string

必填,登录账号

PassWord string

必填,登录密码,需要使用MD5加密

OemMark string

运营商信息

PreferredApsIp string

优选APS地址,即界面配置的登陆地址(域名需解析成IP)

SN string

终端SN序列号(适用于硬终端

MainType string

设备主型号

SubType string

设备子型号

IsAnonymous string

是否匿名登录,非匿名登录不要添加此参数,匿名登陆填写True


<async> login(username, password) → {promise}

登录接口

Parameters:
Name Type Description
username string

登录用户名

password string

登录密码

Returns:

返回一个promise,data为登录返回信息

Type
promise

<async> loginAPS(aps_params) → {promise}

aps 登录

Parameters:
Name Type Description
aps_params object

aps登录参数

Properties
Name Type Description
Version string

终端版本号

IsSecurity number

是否支持账号安全规则,0:否,1:是 默认值:0

DeviceType string

必填,终端型号

ApsLocalIp string

必填,APS的本地IP地址

UserName string

必填,登录账号

PassWord string

必填,登录密码,需要使用MD5加密

OemMark string

运营商信息

PreferredApsIp string

优选APS地址,即界面配置的登陆地址(域名需解析成IP)

SN string

终端SN序列号(适用于硬终端

MainType string

设备主型号

SubType string

设备子型号

IsAnonymous string

是否匿名登录,非匿名登录不要添加此参数,匿名登陆填写True

Returns:

返回一个promise,data为登录返回信息

Type
promise

<async> queryDepartmentAccounts(quary_params) → {promise}

查询单个部门的用户信息

Parameters:
Name Type Description
quary_params object

参数

Properties
Name Type Description
department_moid string

部门moid

start number

获取的用户信息列表的起始行,0标示第一行数据,默认为0

count number

获取的用户信息列表的行数,即包括start在内的后count行数据,0代表获取所有,默认为10

Returns:

返回一个promise,data为查询结果

Type
promise

<async> queryDepartments() → {promise}

查询部门信息

Returns:

返回一个promise,data为查询结果

Type
promise

<async> queryUserDetails() → {promise}

查询用户信息

Returns:

返回一个promise,data为查询结果

Type
promise