feat: 完善推送绑定设备逻辑:与后台约定新增Device数组字段

This commit is contained in:
“DaisyWu” 2025-02-12 09:19:48 +08:00
parent 05f9cad8c9
commit 057eef285f
3 changed files with 11 additions and 2 deletions

View File

@ -70,11 +70,14 @@ class LockMainLogic extends BaseGetXController {
}
Storage.setBool(saveIsVip, entity.data!.isVip == 1);
// deviceId deviceIds deviceId
if (entity.data!.deviceId != null) {
if (entity.data!.deviceId!.isEmpty) {
if (entity.data!.deviceId!.isEmpty ||
!entity.data!.deviceIds!.contains(entity.data!.deviceId)) {
bindPushDevice();
}
}
if (entity.data!.starchart != null) {
if (entity.data!.starchart!.starchartId == null) {
bindStarChart();

View File

@ -47,8 +47,10 @@ class LockMainXHJLogic extends BaseGetXController {
}
Storage.setBool(saveIsVip, entity.data!.isVip == 1);
// deviceId deviceIds deviceId
if (entity.data!.deviceId != null) {
if (entity.data!.deviceId!.isEmpty) {
if (entity.data!.deviceId!.isEmpty ||
!entity.data!.deviceIds!.contains(entity.data!.deviceId)) {
bindPushDevice();
}
}

View File

@ -39,6 +39,7 @@ class MinePersonInfoData {
this.countryName,
this.isVip,
this.deviceId,
this.deviceIds,
this.lang,
this.amazonAlexa,
this.googleHome,
@ -56,6 +57,7 @@ class MinePersonInfoData {
countryName = json['countryName'];
isVip = json['isVip'];
deviceId = json['deviceId'];
deviceIds = json['deviceIds'];
lang = json['lang'];
amazonAlexa = json['amazonAlexa'] != null
? AmazonAlexa.fromJson(json['amazonAlexa'])
@ -78,6 +80,7 @@ class MinePersonInfoData {
String? countryName;
int? isVip;
String? deviceId;
List? deviceIds;
String? lang;
AmazonAlexa? amazonAlexa;
GoogleHome? googleHome;
@ -96,6 +99,7 @@ class MinePersonInfoData {
data['countryName'] = countryName;
data['isVip'] = isVip;
data['deviceId'] = deviceId;
data['deviceIds'] = deviceIds;
data['lang'] = lang;
if (amazonAlexa != null) {
data['amazonAlexa'] = amazonAlexa!.toJson();