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