更新棉花糖

This commit is contained in:
wyf
2025-06-16 09:32:24 +08:00
parent d8b46c41ad
commit acde8340a8
27 changed files with 6762 additions and 658 deletions

View File

@@ -19,7 +19,7 @@ part 'mht_login_controller.g.dart';
@JsonSerializable()
class LoginModel {
//版本id
int? loginStyle = 1; //1.密码登录 2.短信登录
int? loginStyle = 1; //1.密码登录 2.短信登录(登录类型: 1:手机号/邮箱+验证码 2:微信一键登录 3:手机号+密码)
String? account = '17649984946'; //账户
// String? account = '13953240733'; //账户
@@ -124,13 +124,20 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
if (registerController.model.register_agree == null ||
registerController.model.register_agree != true) {
message = "需要同意协议".tr;
showToast(message);
TopSlideNotification.show(context,
text: message, textColor: themeController.currentColor.sc9);
return message;
}
int type = 1;
if (model.loginStyle == 1) {
type = 3;
} else if (model.loginStyle == 2) {
type = 1;
}
var data = {
"type": model.loginStyle == 1 ? 3 : 2,
"type": type,
"userName": model.account,
"password": model.password,
"password": password,
};
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
@@ -169,20 +176,42 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
if (registerController.model.register_agree == null ||
registerController.model.register_agree != true) {
message = "需要同意协议".tr;
showToast(message);
TopSlideNotification.show(context,
text: message, textColor: themeController.currentColor.sc9);
return message;
}
if (model.phone == null || model.phone!.isEmpty) {
message = "请输入手机号".tr;
showToast(message);
TopSlideNotification.show(context,
text: message, textColor: themeController.currentColor.sc9);
return message;
}
if (!MyUtils.isValidPhoneNumber(model.phone!)) {
message = '请输入正确的手机号'.tr;
showToast(message);
TopSlideNotification.show(context,
text: message, textColor: themeController.currentColor.sc9);
return message;
}
return '';
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.send_code;
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
var data = {"userName": model.phone, "type": 1};
await requestWithLog(
data: data,
logTitle: "发送验证码",
method: MyHttpMethod.post,
queryUrl: queryUrl,
onSuccess: (res) {
TopSlideNotification.show(context, text: "发送验证码成功".tr);
},
onFailure: (res) {
message = res.msg!;
TopSlideNotification.show(context,
text: message, textColor: themeController.currentColor.sc9);
},
);
return message;
}
//微信登录