更新微信登录

This commit is contained in:
wyf
2025-08-19 18:20:47 +08:00
parent 2cca7c7716
commit 1efe130173
4 changed files with 103 additions and 49 deletions

View File

@@ -545,22 +545,50 @@ class THBindTelWidget extends GetView<AuthBindTelController> {
.button_container_radius, // 统一圆角
// 保留你原有的业务逻辑不变
onTap: () async {
String msg = await controller.bindTel();
if (msg == null || msg.isEmpty) {
MHTLoginController loginController =
Get.find();
//TODO 微信回调监听操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听
loginController.fluwxCancelable?.cancel();
// 登录成功移出网络检查监听
Checknetwork.subscription?.cancel();
final box = GetStorage();
box.remove('countdown');
CountdownController countdownController =
Get.find();
countdownController.countdown = 0.obs;
Get.offAndToNamed("/mianPageBottomChange");
} else {
TopSlideNotification.show(context,text: msg!,textColor: themeController.currentColor.sc9);
// String msg = await controller.bindTel(context);
// if (msg == null || msg.isEmpty) {
// MHTLoginController loginController =
// Get.find();
// //TODO 微信回调监听操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听
// loginController.fluwxCancelable?.cancel();
// // 登录成功移出网络检查监听
// Checknetwork.subscription?.cancel();
// final box = GetStorage();
// box.remove('countdown');
// CountdownController countdownController =
// Get.find();
// countdownController.countdown = 0.obs;
// Get.offAndToNamed("/mianPageBottomChange");
// } else {
// TopSlideNotification.show(context,text: msg!,textColor: themeController.currentColor.sc9);
// }
AuthBindTelController authBindTelController =
Get.find();
String message = "";
if (authBindTelController.model.phone ==
null ||
authBindTelController
.model.phone!.isEmpty) {
message = "请输入手机号".tr;
TopSlideNotification.show(context,
text: message);
return;
}
if (!MyUtils.isValidPhoneNumber(
authBindTelController.model.phone!)) {
message = '请输入正确的手机号'.tr;
TopSlideNotification.show(context,
text: message);
return;
}
if (authBindTelController.model.code ==
null ||
authBindTelController
.model.code!.isEmpty) {
message = "请输入验证码".tr;
TopSlideNotification.show(context,
text: message);
return;
}
ApiResponse apiResponse =
await controller.updateUserPhone();