提交 36bfaeea authored 作者: yueweilu's avatar yueweilu

1、校验密码

2、两次md5
上级 5893d8d2
...@@ -43,7 +43,7 @@ class ForgetPwdController extends GetxController { ...@@ -43,7 +43,7 @@ class ForgetPwdController extends GetxController {
} }
void setCanClick(){ void setCanClick(){
if (phoneInput.text.length == 11 && codeInput.text.length == 6){ if (ValidatorTool.isValidPhoneNumber(phoneInput.text)&& codeInput.text.length == 6){
_enable = true; _enable = true;
} }
else{ else{
......
...@@ -55,7 +55,7 @@ class _ForgetPwdPageState extends State<ForgetPwdPage> { ...@@ -55,7 +55,7 @@ class _ForgetPwdPageState extends State<ForgetPwdPage> {
GestureDetector( GestureDetector(
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 10.w), padding: EdgeInsets.symmetric(vertical: 10.w),
color: Colors.yellow, // color: Colors.yellow,
child: Text(controller.isCounting?'${controller.countDown}':'获取验证码',style: TextStyle(fontSize: 11.w,color: AppTheme.primary,height: 1.4),)), child: Text(controller.isCounting?'${controller.countDown}':'获取验证码',style: TextStyle(fontSize: 11.w,color: AppTheme.primary,height: 1.4),)),
onTap: (){ onTap: (){
if (controller.isCounting == false){ if (controller.isCounting == false){
......
...@@ -47,8 +47,8 @@ class ResetPwdController extends GetxController { ...@@ -47,8 +47,8 @@ class ResetPwdController extends GetxController {
final result = await AccountAPI.resetPassword( final result = await AccountAPI.resetPassword(
phone: phone, phone: phone,
code: code, code: code,
password: pwdInput.text, password: EncryptUtil.encodeMd5(EncryptUtil.encodeMd5(pwdInput.text)),
rePassword: pwd2Input.text rePassword: EncryptUtil.encodeMd5(EncryptUtil.encodeMd5(pwd2Input.text))
); );
if (result){ if (result){
if (context.mounted){ if (context.mounted){
......
...@@ -68,7 +68,7 @@ class _ResetPwdPageState extends State<ResetPwdPage> { ...@@ -68,7 +68,7 @@ class _ResetPwdPageState extends State<ResetPwdPage> {
), ),
Container( Container(
margin: EdgeInsets.only(left: 5.w,top: 5.w), margin: EdgeInsets.only(left: 5.w,top: 5.w),
child: Text('密码必须是6-20个英文字母、数字或符号',style: TextStyle(fontSize: 10.w,color: Colours.c9),), child: Text('密码必须是8-20个英文字母、数字或符号',style: TextStyle(fontSize: 10.w,color: Colours.c9),),
), ),
Gaps.vGaps40, Gaps.vGaps40,
CustomGradientButton( CustomGradientButton(
......
...@@ -89,9 +89,9 @@ class ValidatorTool { ...@@ -89,9 +89,9 @@ class ValidatorTool {
return phonePattern.hasMatch(value); return phonePattern.hasMatch(value);
} }
// 验证密码 // 密码
static bool isValidPassword(String value) { static bool isValidPassword(String value) {
RegExp passwordPattern = RegExp(r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{6,20}$');; RegExp passwordPattern = RegExp(r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{8,12}$');
return passwordPattern.hasMatch(value); return passwordPattern.hasMatch(value);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论