|
|
@@ -166,7 +166,7 @@
|
|
|
class="c-login__main c-login-form"
|
|
|
action="${url.loginAction}"
|
|
|
method="post"
|
|
|
- onsubmit="login.disabled = true; return false;"
|
|
|
+ onsubmit="return false;"
|
|
|
>
|
|
|
<div class="c-login-form__header">修改密码</div>
|
|
|
<div class="c-login-form__tip">
|
|
|
@@ -174,6 +174,9 @@
|
|
|
<span class="${message.type}">${kcSanitize(message.summary)?no_esc}</span>
|
|
|
</#if>
|
|
|
</div>
|
|
|
+ <div class="c-login-form__tip">
|
|
|
+ <span class="warning"> 至少包含数字、字符、小写字母、大写字母 字符范围:+_!@#$%^&*.,?</span>
|
|
|
+ </div>
|
|
|
<input id="username" name="username" type="text" value="${username}" autocomplete="username" readonly="readonly" style="display:none;"/>
|
|
|
<input id="password" name="password" type="password" autocomplete="current-password" style="display:none;"/>
|
|
|
<div class="c-login-form__section">
|
|
|
@@ -237,10 +240,37 @@
|
|
|
<script>
|
|
|
function onSubmit () {
|
|
|
var form = document.getElementById('loginForm')
|
|
|
+ var value =document.getElementById('passwordNewProxy').value
|
|
|
+ var res = checkPassword(value)
|
|
|
+ if(res){
|
|
|
+ window.alert(res)
|
|
|
+ return
|
|
|
+ }
|
|
|
document.getElementById('passwordNew').value = MD5Salt(document.getElementById('passwordNewProxy').value)
|
|
|
document.getElementById('passwordConfirm').value = MD5Salt(document.getElementById('passwordConfirmProxy').value)
|
|
|
form.submit()
|
|
|
}
|
|
|
+ function checkPassword (password) {
|
|
|
+ if (password.length < 8) {
|
|
|
+ return '密码最少8位'
|
|
|
+ }
|
|
|
+ if (!/^[\da-zA-Z+_!@#$%^&*.,?]+$/.test(password)) {
|
|
|
+ return '包含非法字符'
|
|
|
+ }
|
|
|
+ if (!/\d/.test(password)) {
|
|
|
+ return '缺少数字'
|
|
|
+ }
|
|
|
+ if (!/[a-z]/.test(password)) {
|
|
|
+ return '缺少小写字母'
|
|
|
+ }
|
|
|
+ if (!/[A-Z]/.test(password)) {
|
|
|
+ return '缺少大写字母'
|
|
|
+ }
|
|
|
+ if (!/[+_!@#$%^&*.,?]/.test(password)) {
|
|
|
+ return '缺少特殊字符'
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|