mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-11 18:47:47 +00:00
refactor user login:
1. opt request json type. 2. desktop and mobile use same loginDialog. 3. opt loginDialog UI style. 4. opt login request Exception catch.
This commit is contained in:
@@ -27,8 +27,7 @@ class AbModel {
|
||||
abError.value = "";
|
||||
final api = "${await bind.mainGetApiServer()}/api/ab/get";
|
||||
try {
|
||||
final resp =
|
||||
await http.post(Uri.parse(api), headers: await getHttpHeaders());
|
||||
final resp = await http.post(Uri.parse(api), headers: getHttpHeaders());
|
||||
if (resp.body.isNotEmpty && resp.body.toLowerCase() != "null") {
|
||||
Map<String, dynamic> json = jsonDecode(resp.body);
|
||||
if (json.containsKey('error')) {
|
||||
@@ -102,7 +101,7 @@ class AbModel {
|
||||
Future<void> pushAb() async {
|
||||
abLoading.value = true;
|
||||
final api = "${await bind.mainGetApiServer()}/api/ab";
|
||||
var authHeaders = await getHttpHeaders();
|
||||
var authHeaders = getHttpHeaders();
|
||||
authHeaders['Content-Type'] = "application/json";
|
||||
final peersJsonData = peers.map((e) => e.toJson()).toList();
|
||||
final body = jsonEncode({
|
||||
|
||||
Reference in New Issue
Block a user