mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-09 04:41:29 +03:00
Optimize HTTP calls
This commit is contained in:
@@ -10,8 +10,8 @@ import 'package:flutter_hbb/models/peer_model.dart';
|
||||
import 'package:flutter_hbb/models/platform_model.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../utils/http_service.dart' as http;
|
||||
import '../common.dart';
|
||||
|
||||
final syncAbOption = 'sync-ab-with-recent-sessions';
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:flutter_hbb/models/peer_model.dart';
|
||||
import 'package:flutter_hbb/models/platform_model.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import '../utils/http_service.dart' as http;
|
||||
|
||||
class GroupModel {
|
||||
final RxBool groupLoading = false.obs;
|
||||
|
||||
@@ -6,10 +6,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/common/hbbs/hbbs.dart';
|
||||
import 'package:flutter_hbb/models/ab_model.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../common.dart';
|
||||
import '../utils/http_service.dart' as httpR;
|
||||
import '../utils/http_service.dart' as http;
|
||||
import 'model.dart';
|
||||
import 'platform_model.dart';
|
||||
|
||||
@@ -18,6 +17,7 @@ bool refreshingUser = false;
|
||||
class UserModel {
|
||||
final RxString userName = ''.obs;
|
||||
final RxBool isAdmin = false.obs;
|
||||
|
||||
bool get isLogin => userName.isNotEmpty;
|
||||
WeakReference<FFI> parent;
|
||||
|
||||
@@ -136,7 +136,8 @@ class UserModel {
|
||||
/// throw [RequestException]
|
||||
Future<LoginResponse> login(LoginRequest loginRequest) async {
|
||||
final url = await bind.mainGetApiServer();
|
||||
final resp = await httpR.post('$url/api/login', body: jsonEncode(loginRequest.toJson()));
|
||||
final resp = await http.post(Uri.parse('$url/api/login'),
|
||||
body: jsonEncode(loginRequest.toJson()));
|
||||
|
||||
final Map<String, dynamic> body;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user