分享设备用户列表
This commit is contained in:
@@ -80,7 +80,7 @@ import 'routers/routers.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
|
||||
final Locale? deviceLocale = Get.deviceLocale;
|
||||
print('系统语言: ${deviceLocale?.languageCode}');
|
||||
|
||||
@@ -99,7 +99,7 @@ Future<void> main() async {
|
||||
await initLogin();
|
||||
await messageStatus();
|
||||
|
||||
startMessagePolling();
|
||||
startMessagePolling(selectapp);
|
||||
// 检查网络
|
||||
Checknetwork.checkNetwork();
|
||||
// 微信开放平台注册
|
||||
@@ -139,26 +139,45 @@ initLanguageSetting() {
|
||||
Future<void> initWX() async {
|
||||
Fluwx fluwx = Fluwx();
|
||||
fluwx.registerApi(
|
||||
//请填写自己的微信appid
|
||||
// appId: "wxeb2688220799e2c5",//太和
|
||||
appId: "wx929c548fea6af9c7",//眠花糖
|
||||
doOnAndroid: true,
|
||||
doOnIOS: true,
|
||||
// universalLink: "https://app.he-info.com/theh/",
|
||||
universalLink: "https://zhmht.swes.com.cn/app/",
|
||||
);
|
||||
//请填写自己的微信appid
|
||||
// appId: "wxeb2688220799e2c5",//太和
|
||||
appId: "wx929c548fea6af9c7", //眠花糖
|
||||
doOnAndroid: true,
|
||||
doOnIOS: true,
|
||||
// universalLink: "https://app.he-info.com/theh/",
|
||||
universalLink: "https://zhmht.swes.com.cn/app/",
|
||||
);
|
||||
}
|
||||
|
||||
Timer? _messageTimer;
|
||||
void startMessagePolling() {
|
||||
// 避免重复启动
|
||||
// void startMessagePolling() {
|
||||
// // 避免重复启动
|
||||
// _messageTimer?.cancel();
|
||||
|
||||
// _messageTimer = Timer.periodic(Duration(seconds: 10), (timer) async {
|
||||
// try {
|
||||
// MessageController messageController = Get.find();
|
||||
// messageController.getMessageStatus();
|
||||
// // print("轮询消息状态成功");
|
||||
// } catch (e) {
|
||||
// print("轮询消息状态失败: $e");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
void startMessagePolling(String selectapp) {
|
||||
_messageTimer?.cancel();
|
||||
|
||||
_messageTimer = Timer.periodic(Duration(seconds: 10), (timer) async {
|
||||
try {
|
||||
MessageController messageController = Get.find();
|
||||
messageController.getMessageStatus();
|
||||
// print("轮询消息状态成功");
|
||||
if (selectapp == 'mht') {
|
||||
if (Get.isRegistered<MhMessageController>()) {
|
||||
Get.find<MhMessageController>().getMessageStatus();
|
||||
}
|
||||
} else {
|
||||
if (Get.isRegistered<MessageController>()) {
|
||||
Get.find<MessageController>().getMessageStatus();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
print("轮询消息状态失败: $e");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user