| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta name='viewport' content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no' />
- <title>${realm.displayName}</title>
- <style>
- * {
- margin: 0;
- padding: 0;
- }
- html,
- body {
- width: 100%;
- height: 100%;
- }
- body {
- box-sizing: border-box;
- -moz-osx-font-smoothing: grayscale;
- -webkit-font-smoothing: antialiased;
- text-rendering: optimizeLegibility;
- font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
- background-color: #FFFFFF;
- }
- *,
- *::before,
- *::after {
- box-sizing: inherit;
- }
- a {
- border: none;
- outline: none;
- text-decoration: none;
- -webkit-touch-callout: none;
- -webkit-tap-highlight-color: transparent;
- }
- .c-login {
- display: flex;
- justify-content: center;
- align-items: center;
- min-height: 100%;
- width: 100%;
- }
- .c-login__main {
- flex: 1 0 auto;
- }
- .c-login-form {
- display: inline-flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 0 0 40px;
- overflow: auto;
- }
- .c-login-form__header {
- color: #1C5CB0;
- font-size: 28px;
- font-weight: bold;
- text-align: center;
- }
- .c-login-form__tip {
- padding: 20px;
- height: 60px;
- }
- .c-login-form__tip .success {
- color: #67C23A;
- }
- .c-login-form__tip .warning {
- color: #E6A23C;
- }
- .c-login-form__tip .error {
- color: #F56C6C;
- }
- .c-login-form__tip .info {
- color: #409EFF;
- }
- .c-login-form__section {
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .c-login-form__wrapper {
- display: flex;
- align-items: center;
- }
- .c-login-form__label {
- width: 150px;
- margin-right: 20px;
- color: #333333;
- font-size: 16px;
- text-align: right;
- }
- .c-login-form__label::before {
- content: "*";
- color: #FF0000;
- font-size: 14px;
- }
- .c-login-form__input {
- padding: 0 10px;
- width: 320px;
- height: 30px;
- font-size: 14px;
- line-height: 30px;
- border: 1px solid #C4C4C4;
- outline: none;
- }
- .c-login-form__input.password {
- -webkit-text-security: disc;
- }
- .c-login-form__error {
- display: inline-block;
- width: 320px;
- height: 30px;
- margin-left: 170px;
- color: #F56C6C;
- font-size: 12px;
- line-height: 24px;
- white-space: nowrap;
- }
- .c-login-form__submit {
- display: inline-flex;
- justify-content: center;
- align-items: center;
- height: 40px;
- padding: 0 40px;
- margin-top: 60px;
- color: #ffffff;
- font-size: 18px;
- border: none;
- background-color: #1C5CB0;
- border-radius: 8px;
- cursor: pointer;
- }
- .c-login-form__submit[disabled] {
- background-color: #C4C4C4;
- }
- </style>
- </head>
- <body>
- <div class="c-login">
- <form
- id="loginForm"
- class="c-login__main c-login-form"
- action="${url.loginAction}"
- method="post"
- onsubmit="return false;"
- >
- <div class="c-login-form__header">修改密码</div>
- <div class="c-login-form__tip">
- <#if !messagesPerField.existsError('password','password-confirm') && message?has_content && !isAppInitiatedAction??>
- <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">
- <div class="c-login-form__wrapper">
- <label
- for="passwordNewProxy"
- class="c-login-form__label"
- >
- 新密码:
- </label>
- <input
- id="passwordNewProxy"
- type="password"
- class="c-login-form__input"
- placeholder="请输入新密码"
- autocomplete="new-password"
- aria-autocomplete="none"
- >
- </div>
- <div class="c-login-form__error">
- <#if messagesPerField.existsError('password')>
- ${kcSanitize(messagesPerField.get('password'))?no_esc}
- </#if>
- </div>
- </div>
- <div class="c-login-form__section">
- <div class="c-login-form__wrapper">
- <label
- for="passwordConfirmProxy"
- class="c-login-form__label"
- >
- 确认新密码:
- </label>
- <input
- id="passwordConfirmProxy"
- type="password"
- class="c-login-form__input"
- placeholder="请输入新密码"
- autocomplete="new-password"
- aria-autocomplete="none"
- >
- </div>
- <div class="c-login-form__error">
- <#if messagesPerField.existsError('password-confirm')>
- ${kcSanitize(messagesPerField.get('password-confirm'))?no_esc}
- </#if>
- </div>
- </div>
- <input id="passwordNew" name="password-new" hidden >
- <input id="passwordConfirm" name="password-confirm" hidden >
- <button
- class="c-login-form__submit"
- name="login"
- onclick="onSubmit()"
- >
- 保存
- </button>
- </form>
- </div>
- <script src="${url.resourcesPath}/js/md5.js"></script>
- <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>
|