From 982b9580a6e1e13fc4f47f91a21e31939b15d391 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Wed, 6 Sep 2023 11:30:20 +0800 Subject: [PATCH] fix --- fs_template/reset_confirm.tpl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fs_template/reset_confirm.tpl b/fs_template/reset_confirm.tpl index b0c5d893..071f8e30 100644 --- a/fs_template/reset_confirm.tpl +++ b/fs_template/reset_confirm.tpl @@ -51,7 +51,7 @@ button { background-color: #007bff; color: #fff; border: none; - border-radius: 3px; + border-radius: 5px; cursor: pointer; } @@ -125,6 +125,12 @@ button:hover { function resetPassword() { const new_password = document.getElementById("new_password").value; const confirm_password = document.getElementById("confirm_password").value; + + if (!/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$/.test(new_password)) { + alert("The password must be at least 8 characters in length, and contain at least 1 number, 1 lowercase letter and 1 uppercase letter."); + return; + } + if (new_password !== confirm_password) { alert("Passwords do not match"); return; @@ -145,11 +151,11 @@ function resetPassword() { .then(response => response.json()) .then(data => { if (data.code == 200 ) { - alert(data.msg); - {{/* window.location.href = "{{.HomePage}}"; */}} - setTimeout(function() { + alert("reset password success"); + window.location.href = "{{.HomePage}}"; + {{/* setTimeout(function() { window.location.href = "{{.HomePage}}"; - }, 1000); + }, 1000); */}} } else { alert(data.msg); }