relogin method
重登录
该接口在如果有其他同类型终端登录着则会登录失败,一般用于记住了账号后重启自动登录逻辑,登录结果通过 @ref JCClientCallback#onLogin "onLogin" 通知
@note 与 @ref login 接口的区别:
- 同一设备类型登录同一账号,使用“登录”接口后,后登录的账号会把前面的账号踢下线
- 同一设备类型登录同一账号,使用“重登录”接口后,后登录的账号会登录失败,上报已有账号登录错误
- 同一账号不同设备类型,使用“登录”和“重登录”都能正常登录
- 用户名区分大小写
userId 用户名
password 密码,免鉴权模式密码可以随意输入,但不能为空
loginParam 登录参数,用于指定https代理地址、设备id、是否自动创建账号、终端类型,null 则按默认值。详见 LoginParam
@return 调用是否成功
- true:正常执行调用流程
- false:调用失败
Implementation
@override
Future<bool> relogin(
String userId, String password, LoginParam loginParam) async {
return await NativeImpl.methodChannel.invokeMethod('${methodTag}relogin', {
'userId': userId,
'password': password,
'loginParam': {
'httpsProxy': loginParam.httpsProxy,
'deviceId': loginParam.deviceId,
'autoCreateAccount': loginParam.autoCreateAccount,
'terminalType': loginParam.terminalType,
'timeout': loginParam.timeout,
'stgEnable': loginParam.stgEnable,
'directConnectEnable': loginParam.directConnectEnable,
'subMsgType': loginParam.subMsgType
}
});
}