no message
This commit is contained in:
parent
4eb28224d3
commit
41bfa32ad6
|
|
@ -21,7 +21,6 @@ class Register extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _RegisterState extends State<Register> with CommonMixin {
|
||||
|
||||
late final FocusNode _theFocus;
|
||||
late final FocusNode _pwdFocus; // 密码
|
||||
//文本输入框控制器
|
||||
|
|
@ -60,6 +59,7 @@ class _RegisterState extends State<Register> with CommonMixin{
|
|||
|
||||
FocusScope.of(context).requestFocus(_theFocus);
|
||||
|
||||
try {
|
||||
String userName = _userNameController.text.trim();
|
||||
String userPwd = _passwordController.text.trim();
|
||||
if (userName == '') return toMsg('请填写用户账号');
|
||||
|
|
@ -70,15 +70,18 @@ class _RegisterState extends State<Register> with CommonMixin{
|
|||
print('注册userPwdMd5=$userPwdMd5');
|
||||
EasyLoading.show(status: 'loading...');
|
||||
RestClient client = await getClientLogin();
|
||||
BaseStructureResult<dynamic> resultData = await client.toRegister(UserLoginParams(userName, userPwdMd5));
|
||||
BaseStructureResult<dynamic> resultData = await client.toRegister(UserLoginParams(userName, userPwdMd5, 0));
|
||||
|
||||
if (resultData.code != 200) {
|
||||
return toMsg(resultData.message ?? '注册失败,请重试');
|
||||
}
|
||||
EasyLoading.dismiss();
|
||||
|
||||
ToastUtils.showSuccess('注册成功,请登录');
|
||||
// 跳转登录页
|
||||
RouterManager.router.navigateTo(context, RouterManager.loginPath);
|
||||
} finally {
|
||||
EasyLoading.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
void _showPassword() {
|
||||
|
|
@ -232,10 +235,8 @@ class _RegisterState extends State<Register> with CommonMixin{
|
|||
checkColor: Colors.white,
|
||||
value: readAgreement,
|
||||
onChanged: (value) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_pwdFocus);
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_theFocus);
|
||||
FocusScope.of(context).requestFocus(_pwdFocus);
|
||||
FocusScope.of(context).requestFocus(_theFocus);
|
||||
setState(() {
|
||||
readAgreement = value ?? false;
|
||||
});
|
||||
|
|
@ -270,8 +271,6 @@ class _RegisterState extends State<Register> with CommonMixin{
|
|||
),
|
||||
]),
|
||||
)
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
|
@ -280,8 +279,7 @@ class _RegisterState extends State<Register> with CommonMixin{
|
|||
left: 20.r,
|
||||
child: InkWell(
|
||||
onTap: () => Navigator.pop(context),
|
||||
child: Icon(Icons.arrow_back_ios_new_rounded,
|
||||
color: Colors.white, size: 24.sp),
|
||||
child: Icon(Icons.arrow_back_ios_new_rounded, color: Colors.white, size: 24.sp),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue