1.更新消息阅读时间
2.修复配置wifi时wifi名称存在空格时配置失败 3.修复门店体验列表刷新失败
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/controller/login/login_controller.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
|
||||
class ApiService {
|
||||
static Dio dio = Dio();
|
||||
|
||||
static Dio request = Dio();
|
||||
static Dio requestNoInfo = Dio();
|
||||
static Dio requestNoError = Dio(); //不处理错误的请求,用于设备操作上报
|
||||
|
||||
static Dio reservation = Dio();
|
||||
|
||||
static void init() {
|
||||
|
||||
reservationInit();
|
||||
}
|
||||
|
||||
static void reservationInit() {
|
||||
reservation.options.baseUrl = "https://crm-api.swes.com.cn";
|
||||
reservation.options.connectTimeout = const Duration(seconds: 15);
|
||||
reservation.options.receiveTimeout = const Duration(seconds: 10);
|
||||
reservation.options.sendTimeout = const Duration(seconds: 10);
|
||||
reservation.interceptors.add(InterceptorsWrapper(
|
||||
onRequest: (options, handler) {
|
||||
print("---> ${options.method}, ${options.path}, ${options.data}");
|
||||
options.headers['token'] =
|
||||
"bMAQVR1x48t66u8EDYSftAJGo17r0rIB3z15JgyyoGz1rAEZHs1htHOCorYFJ2RT";
|
||||
return handler.next(options);
|
||||
},
|
||||
onResponse: (response, ResponseInterceptorHandler handler) {
|
||||
print("<--- ${response.statusCode} ${response.data}");
|
||||
return handler.next(response);
|
||||
},
|
||||
onError: (e, handler) {
|
||||
// 错误处理,例如打印错误信息
|
||||
showToast("网络异常或服务连接异常,请稍候再试", color: color_error);
|
||||
print("DioError: $e");
|
||||
return handler.reject(e);
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ class ExperienceStoreListController
|
||||
// if (page == 0) {
|
||||
// position = await weatherModelController.determinePosition();
|
||||
// }
|
||||
|
||||
|
||||
lock = true;
|
||||
int page_ = page;
|
||||
ApiService.reservation
|
||||
@@ -74,6 +74,7 @@ class ExperienceStoreListController
|
||||
.indexWhere((item2) => item2["id"] == item["id"]) ==
|
||||
-1) {
|
||||
model.experienceStoreModelList.add(item);
|
||||
attr.refresh();
|
||||
} else {
|
||||
model.experienceStoreModelList[index] = item;
|
||||
}
|
||||
@@ -82,10 +83,10 @@ class ExperienceStoreListController
|
||||
}
|
||||
page = page_ + 1;
|
||||
total = d.data["total"];
|
||||
updateAll();
|
||||
// updateAll();
|
||||
attr.refresh();
|
||||
}).catchError((d) {
|
||||
lock = false;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user