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

1、校验密码

2、两次md5
上级 5893d8d2
......@@ -43,7 +43,7 @@ class ForgetPwdController extends GetxController {
}
void setCanClick(){
if (phoneInput.text.length == 11 && codeInput.text.length == 6){
if (ValidatorTool.isValidPhoneNumber(phoneInput.text)&& codeInput.text.length == 6){
_enable = true;
}
else{
......
......@@ -55,7 +55,7 @@ class _ForgetPwdPageState extends State<ForgetPwdPage> {
GestureDetector(
child: Container(
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),)),
onTap: (){
if (controller.isCounting == false){
......
......@@ -47,8 +47,8 @@ class ResetPwdController extends GetxController {
final result = await AccountAPI.resetPassword(
phone: phone,
code: code,
password: pwdInput.text,
rePassword: pwd2Input.text
password: EncryptUtil.encodeMd5(EncryptUtil.encodeMd5(pwdInput.text)),
rePassword: EncryptUtil.encodeMd5(EncryptUtil.encodeMd5(pwd2Input.text))
);
if (result){
if (context.mounted){
......
......@@ -68,7 +68,7 @@ class _ResetPwdPageState extends State<ResetPwdPage> {
),
Container(
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,
CustomGradientButton(
......
......@@ -89,9 +89,9 @@ class ValidatorTool {
return phonePattern.hasMatch(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);
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论