From d6de60f5e91abadf19b349559c49435534bd6e6c Mon Sep 17 00:00:00 2001 From: wangjiaoyan <715068310@qq.com> Date: Wed, 18 Dec 2024 18:52:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/pages/user/login.jsp | 162 +++++++++++---------- web/pages/user/login_success.jsp | 48 +++---- web/pages/user/regist.jsp | 229 ++++++++++++++++++------------ web/pages/user/regist_success.jsp | 36 ++++- web/pages/user/userinfo.jsp | 60 ++++---- 5 files changed, 306 insertions(+), 229 deletions(-) diff --git a/web/pages/user/login.jsp b/web/pages/user/login.jsp index fc46037..57e65c0 100644 --- a/web/pages/user/login.jsp +++ b/web/pages/user/login.jsp @@ -2,96 +2,92 @@ - -登录页面 -<%@include file="/pages/common/header.jsp"%> - + // 获取密码输入框的值 + var passwordValue = $("#password").val(); + // 定义正则表达式,验证密码是否合法(同样的规则) + var passwordReg = /^\w{5,15}$/; + // 验证密码信息 + if (!passwordReg.test(passwordValue)) { + // 如果不合法,提示用户 + $("span.errorMsg").text("密码不合法!"); + return false; // 阻止表单提交 + } + + // 如果验证通过,允许表单提交 + return true; + }); + + }); + -
- -
- -
- -
- +
+ +
+ +