Browse Source

上传绑定设备代码修复

weicu
liwei1dao 1 year ago
parent
commit
879e0a5620
  1. 9
      lib/data/services/network/api.dart
  2. 3
      lib/modules/pairing/controllers/pairing_controller.dart

9
lib/data/services/network/api.dart

@ -135,4 +135,13 @@ class Api {
params: params, params: params,
); );
} }
//绑定设备
static bindauthcode([params]) {
return DioManager().request(
NWMethod.post,
'/api/home/user_bindauthcode',
params: params,
);
}
} }

3
lib/modules/pairing/controllers/pairing_controller.dart

@ -535,7 +535,6 @@ class PairingController extends GetxController {
// 调用BLE管理器的自动绑定方法 // 调用BLE管理器的自动绑定方法
final response = await Api.bindearphone({ final response = await Api.bindearphone({
"earphonemac": currentDevice?.address, "earphonemac": currentDevice?.address,
"earphoneauthcode": "",
}); });
Logger.i(_tag, '手动授权结果 ${response}'); Logger.i(_tag, '手动授权结果 ${response}');
if (response != null) { if (response != null) {
@ -551,7 +550,7 @@ class PairingController extends GetxController {
/// 用户点击授权码输入框 /// 用户点击授权码输入框
void onAutoCodeInputTap() async { void onAutoCodeInputTap() async {
// 调用BLE管理器的自动绑定方法 // 调用BLE管理器的自动绑定方法
final response = await Api.bindearphone({ final response = await Api.bindauthcode({
"earphonemac": currentDevice?.address, "earphonemac": currentDevice?.address,
"earphoneauthcode": codeInputController.text.trim(), "earphoneauthcode": codeInputController.text.trim(),
}); });

Loading…
Cancel
Save