27 lines
901 B
Dart
27 lines
901 B
Dart
import 'package:dio/dio.dart' as dio;
|
||
|
||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||
|
||
/// 终端 App 配置与版本接口入口,统一复用 HttpManage 的鉴权、租户和错误处理。
|
||
abstract class AppApi {
|
||
///
|
||
/// 分页获取匹配 App 编码和平台的已发布版本。
|
||
///
|
||
/// [pa] 包含 appUniqueCode、platform、current 和 size;[silent] 为 true 时后台任务
|
||
/// 只记录异常,不弹业务 Toast。
|
||
static Future<ServiceAppVersionPage?> openCardList(
|
||
dynamic pa, {
|
||
bool silent = false,
|
||
}) async {
|
||
final res = await HttpManage().dio.get(
|
||
"/integrated/app-version/ad/page",
|
||
queryParameters: pa,
|
||
options: dio.Options(
|
||
extra: {if (silent) HttpManage.silentRequestKey: true},
|
||
),
|
||
);
|
||
if (res.data == null) return null;
|
||
return ServiceAppVersionPage.fromJson(res.data);
|
||
}
|
||
}
|