提交代码
This commit is contained in:
parent
febbab97da
commit
597ff218a9
@ -6,6 +6,7 @@ import 'dart:io';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../network/api_repository.dart';
|
import '../../network/api_repository.dart';
|
||||||
|
import '../../tools/storage.dart';
|
||||||
import 'udp_manage.dart';
|
import 'udp_manage.dart';
|
||||||
import 'udp_senderManage.dart';
|
import 'udp_senderManage.dart';
|
||||||
|
|
||||||
@ -38,9 +39,9 @@ class UdpHelp{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer timer = Timer.periodic(1.seconds, (timer) {
|
Timer timer = Timer.periodic(1.seconds, (timer) async {
|
||||||
UDPSenderManage.sendHeart(
|
UDPSenderManage.sendHeart(
|
||||||
userName: "15080825640",
|
userName: await Storage.getMobile(),
|
||||||
ipList: serversList,
|
ipList: serversList,
|
||||||
tokenStr: "b989fa15f75c2ac02718b7c9bb64f80e",
|
tokenStr: "b989fa15f75c2ac02718b7c9bb64f80e",
|
||||||
);
|
);
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class CommandUDPReciverManager {
|
|||||||
if (dataSize < 4) {
|
if (dataSize < 4) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
print("appDataReceiveData:$data");
|
print("appDataReceiveUDPData:$data");
|
||||||
|
|
||||||
Uint8List data1 = Uint8List.fromList(data);
|
Uint8List data1 = Uint8List.fromList(data);
|
||||||
if (data1.length == 1) {
|
if (data1.length == 1) {
|
||||||
|
|||||||
@ -136,13 +136,23 @@ class Storage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future<String?> getUid() async {
|
static Future<String?> getUid() async {
|
||||||
String? userId = '';
|
String? uid = '';
|
||||||
final data = await Storage.getString('userLoginData');
|
final data = await Storage.getString('userLoginData');
|
||||||
if (data != null && data.isNotEmpty) {
|
if (data != null && data.isNotEmpty) {
|
||||||
userId = LoginData.fromJson(jsonDecode(data)).uid.toString();
|
uid = LoginData.fromJson(jsonDecode(data)).uid.toString();
|
||||||
}
|
}
|
||||||
print("pubUserId:$userId");
|
print("pubUid:$uid");
|
||||||
return userId;
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<String?> getMobile() async {
|
||||||
|
String? mobile = '';
|
||||||
|
final data = await Storage.getString('userLoginData');
|
||||||
|
if (data != null && data.isNotEmpty) {
|
||||||
|
mobile = LoginData.fromJson(jsonDecode(data)).mobile.toString();
|
||||||
|
}
|
||||||
|
print("pubUserId:$mobile");
|
||||||
|
return mobile;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<LoginData?> getLoginData() async {
|
static Future<LoginData?> getLoginData() async {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user