loginVisitor static method

void loginVisitor(
  1. String username,
  2. String password,
  3. String appkey,
  4. String subDomain,
)

Implementation

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