设备分享

This commit is contained in:
czz
2025-07-22 14:16:41 +08:00
parent b1323fa676
commit e80011161c

View File

@@ -49,11 +49,11 @@ class MHDeviceShareController extends GetControllerEx<MHDeviceShareModel> {
// RxString account = "".obs; // RxString account = "".obs;
// RxString msg = "".obs; // RxString msg = "".obs;
// RxInt code = 0.obs; // RxInt code = 0.obs;
@override // @override
Future<void> onInit() async { // Future<void> onInit() async {
super.onInit(); // super.onInit();
await shareDeviceList(Get.arguments["mac"]); // await shareDeviceList(Get.arguments["mac"]);
} // }
Future<ApiResponse> shareDevice(String mac) async { Future<ApiResponse> shareDevice(String mac) async {
ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr); ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr);
@@ -85,7 +85,12 @@ class MHDeviceShareController extends GetControllerEx<MHDeviceShareModel> {
queryUrl += "?lang=$language"; queryUrl += "?lang=$language";
} }
} }
var data = {"type": model.type, "userName": model.account, "mac": mac}; var data = {
"type": 1,
"userName": model.account,
"mac": mac,
"opType": model.type
};
var response = var response =
await EasyDartModule.dio.post(queryUrl, data: jsonEncode(data)); await EasyDartModule.dio.post(queryUrl, data: jsonEncode(data));
if (response != null) { if (response != null) {