login static method
Implementation
static void login(String username, String password, String appkey,
String subDomain, String role) async {
//
SpUtil.putString(BytedeskConstants.role, role);
if (role == BytedeskConstants.ROLE_ADMIN) {
if (!username.contains("@")) {
username = "$username@$subDomain";
}
}
await BytedeskUserHttpApi().oauth(username, password);
// 登录成功之后,建立长连接
connect();
// if (role == BytedeskConstants.ROLE_ADMIN) {
// // TODO: 如果是客服账号,加载个人信息
// }
// 上传设备信息
await BytedeskDeviceHttpApi().setDeviceInfo();
}