fix:app检测更新补充逻辑
This commit is contained in:
1 parent
05e89b80bb
commit
b4343ea528
5 files changed
+260
-56
No files matched your search
@@ -34,6 +34,7 @@ class DeviceHeaderService {
|
||||
static const _umengChannel = String.fromEnvironment('UMENG_CHANNEL');
|
||||
|
||||
String _deviceId = '';
|
||||
String _packageName = '';
|
||||
String _version = '';
|
||||
String _build = '';
|
||||
String _deviceModel = '';
|
||||
@@ -68,6 +69,7 @@ class DeviceHeaderService {
|
||||
Future<void> _initializeBase() async {
|
||||
try {
|
||||
final info = await PackageInfo.fromPlatform();
|
||||
_packageName = info.packageName.trim();
|
||||
_version = info.version;
|
||||
_build = info.buildNumber;
|
||||
} catch (_) {}
|
||||
@@ -244,6 +246,7 @@ class DeviceHeaderService {
|
||||
/// 公共 header(不含 token)。11
|
||||
Map<String, String> commonHeaders() => _compact({
|
||||
'X-Device-Id': _deviceId,
|
||||
'pkg': _packageName,
|
||||
'User-Version': _version,
|
||||
'User-BuildID': _build,
|
||||
'User-Platform': _platform(),
|
||||
|
||||
Reference in new issue
Block a user