Browse Source

新增密码重置&&修改

xieqy 2 years ago
parent
commit
d675ee1bb8
3 changed files with 648 additions and 36 deletions
  1. 304 16
      src/login/css/login.css
  2. 79 15
      src/login/index.html
  3. 265 5
      src/login/js/login.js

+ 304 - 16
src/login/css/login.css

@@ -2,6 +2,7 @@
     margin: 0;
     padding: 0;
 }
+
 html,
 body {
     height: 100%;
@@ -10,6 +11,7 @@ body {
     font-family: "宋体";
     overflow: hidden;
 }
+
 #mainContainer {
     width: 100%;
     height: 100%;
@@ -19,8 +21,9 @@ body {
     background: url("./img/background.png") no-repeat fixed center/100%;
     background-size: cover;
 }
+
 .company-name {
-    font-family: PingFang SC,Source Han Sans CN,Microsoft YaHei,Arial,sans-serif;
+    font-family: PingFang SC, Source Han Sans CN, Microsoft YaHei, Arial, sans-serif;
     line-height: 1.1;
     position: absolute;
     font-size: 40px;
@@ -32,6 +35,7 @@ body {
     top: calc((100% - 534px) / 2);
     -webkit-box-reflect: below 1px -webkit-gradient(linear, 0 0, 0 50%, from(transparent), color-stop(0.2, transparent), to(rgba(3, 3, 3, 0.1)));
 }
+
 .fill-container {
     position: relative;
     width: 926px;
@@ -41,20 +45,23 @@ body {
     left: calc((100% - 926px) / 2);
     top: calc((100% - 334px) / 2);
 }
+
 .fill-container .left {
     position: relative;
     float: left;
     width: 538px;
     overflow: hidden;
 }
+
 .fill-container .right {
     width: 388px;
-    width: 388px;
+    height: 100%;
     position: relative;
     float: left;
 }
+
 .fill-container .right .top {
-    font-family: PingFang SC,Source Han Sans CN,Microsoft YaHei,Arial,sans-serif;
+    font-family: PingFang SC, Source Han Sans CN, Microsoft YaHei, Arial, sans-serif;
     font-size: 25px;
     font-weight: 700;
     color: rgb(45, 116, 231);
@@ -64,12 +71,15 @@ body {
     position: relative;
     float: left;
 }
-.fill-container .right .top > span {
+
+.fill-container .right .top>span {
     line-height: 30px;
 }
-.fill-container .right .top > span:nth-of-type(2) {
+
+.fill-container .right .top>span:nth-of-type(2) {
     margin-top: 16px;
 }
+
 .middle {
     width: 320px;
     margin-bottom: 80px;
@@ -77,20 +87,25 @@ body {
     left: calc((100% - 320px) / 2);
     top: 100px;
 }
-.bottom{
+
+.bottom {
     position: relative;
-    top:35px;
+    top: 35px;
 }
-.middle > .form-input {
+
+.middle>.form-input {
     height: 36px;
     line-height: 36px;
 }
-.middle > .form-input :nth-of-type(2) {
+
+.middle>.form-input :nth-of-type(2) {
     margin-top: 15px;
 }
-.middle > .form-input :nth-of-type(3) {
+
+.middle>.form-input :nth-of-type(3) {
     margin-top: 15px;
 }
+
 .username,
 .password {
     text-align: left;
@@ -102,18 +117,23 @@ body {
     /*width: 272px !important;*/
     /*width: 20% !important;*/
 }
-.title{
+
+.title {
     display: inline-block;
 }
-input.title:focus{
+
+input.title:focus {
     box-shadow: none;
 }
+
 input.username::-webkit-input-placeholder {
     color: #999999;
 }
+
 input.password::-webkit-input-placeholder {
     color: #999999;
 }
+
 .login {
     border: none;
     color: white;
@@ -122,6 +142,7 @@ input.password::-webkit-input-placeholder {
     border-radius: 22px;
     margin-top: 20px;
 }
+
 .login .loginLoading {
     display: none;
     margin-left: 52px;
@@ -134,6 +155,7 @@ input.password::-webkit-input-placeholder {
     margin-top: -44px;
     margin-left: 44px;
 }
+
 .login p {
     text-align: center;
     font-size: 16px;
@@ -158,6 +180,7 @@ input.password::-webkit-input-placeholder {
     display: none;
     color: #ff0000;
 }
+
 .feedback {
     position: absolute;
     top: calc(71.5% + 102px);
@@ -169,17 +192,21 @@ input.password::-webkit-input-placeholder {
     text-shadow: 0px 0px 2px rgba(7, 61, 104, 0.24);
     width: 157px;
 }
+
 .feedback span {
     padding-bottom: 1px;
     border-bottom: 1px solid #1dddeb;
     cursor: pointer;
 }
+
 .feedback span:hover {
     color: #3cd5e0ed;
 }
+
 span.pwspan {
     float: left;
 }
+
 span.feedspan {
     float: right;
 }
@@ -208,6 +235,7 @@ span.feedspan {
 .info span.end {
     margin-right: 30px;
 }
+
 .shadow {
     /* height: 17.78%; */
     height: 18.78%;
@@ -216,27 +244,34 @@ span.feedspan {
     left: calc(19% + 50px);
     top: 70.5%;
 }
+
 .loginitem {
     flex-flow: row nowrap;
 }
+
 .loginimg {
     position: absolute;
     left: 10px;
     height: 44px;
     text-align: center;
 }
+
 .form-inline .form-control {
     display: inline-block;
     width: 100%;
 }
+
 .usernameContainer,
 .passwordContainer,
-.loginContainer,.codeContainer {
+.loginContainer,
+.codeContainer {
     position: relative;
 }
+
 .msginfo {
     padding-right: 90px;
 }
+
 .codeContainer .msgBtn {
     height: 44px;
     position: absolute;
@@ -249,24 +284,277 @@ span.feedspan {
     color: #555555;
     border-left: 1px solid #2f83bd;
 }
+
 .msgBtn:hover {
     background-color: #f8f9fa;
 }
+
 .msgBtn span {
     position: relative;
     left: 8px;
     letter-spacing: 1px;
     cursor: pointer;
 }
-.passwordContainer {
-    /* margin-left:308px; */
-}
+
+/* .passwordContainer {
+    margin-left:308px;
+} */
 
 .loginContainer {
     /* margin-left: 600px; */
     height: 44px;
     margin-top: 30px;
 }
+
 .loginimg img:last-child {
     margin-left: 10px;
 }
+
+.forgetpsw-btn {
+    position: absolute;
+    bottom: 7px;
+    left: 50%;
+    margin-left: -28px;
+    color: #409eff;
+    background: 0 0;
+    padding-left: 0;
+    padding-right: 0;
+    font-size: 14px;
+    font-weight: 500;
+    text-align: center;
+    border: none;
+    font-family: sans-serif;
+    cursor: pointer;
+}
+
+button:focus {
+    outline: none;
+}
+
+.fill-container>.right .forgetpsw-btn:last-of-type::before {
+    content: '';
+    position: absolute;
+    height: 12px;
+    width: 1px;
+    background: #01a2ff;
+    margin: 0 auto;
+    left: -10px;
+    bottom: 4px;
+}
+
+
+.modelDialog {
+    display: none;
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    overflow: auto;
+    margin: 0;
+    z-index: 2001;
+}
+
+.wrapDialog {
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    opacity: .5;
+    background: #000;
+    z-index: 2000;
+}
+
+.alertInfo {
+    position: absolute;
+    min-width: 150px;
+    max-width: fit-content;
+    z-index: 2003;
+    left: 50%;
+    top: 5%;
+    transform: translate(-50%, -50%);
+    animation: gradientDisplay 0.3s ease;
+}
+
+@keyframes gradientDisplay {
+    0% {
+        opacity: 0;
+    }
+
+    25% {
+        opacity: 0.25;
+    }
+
+    50% {
+        opacity: 0.5;
+    }
+
+    75% {
+        opacity: 0.75;
+    }
+
+    100% {
+        opacity: 1;
+    }
+}
+
+
+.alertInfo>strong {
+    white-space: nowrap;
+}
+
+.resetPswDialog {
+    z-index: 2002;
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    transform: translate(-50%, -50%);
+    width: 420px;
+    /* height: 200px; */
+    background-color: #f8f9fa;
+}
+
+.dialog-title {
+    background-color: #fff;
+    border-bottom: 1px solid #ccc;
+    text-indent: 10px;
+    padding: 20px 20px 10px;
+
+    line-height: 24px;
+    font-size: 18px;
+    font-family: sans-serif;
+    color: #303133;
+}
+
+.dialog-content {
+    padding: 30px 20px;
+    color: #606266;
+    font-size: 14px;
+    word-break: break-all;
+}
+
+.labelInput {
+    display: flex !important;
+    align-items: center;
+    margin-bottom: 20px;
+}
+
+.codeDiv {
+    align-items: center;
+}
+
+.labelInput>label,
+.codeDiv>label {
+    white-space: nowrap;
+    margin-bottom: 0;
+    margin-right: 15px;
+
+}
+
+.labelInput>label {
+    width: 110px;
+}
+
+.labelInput>label>i {
+    color: red;
+    margin-right: 10px;
+
+    text-align: right;
+}
+
+.passwordReset {
+    display: none;
+}
+
+.passwordModify {
+    display: none;
+}
+
+
+
+.dialog-footer {
+    padding: 10px 20px 20px;
+    text-align: right;
+    box-sizing: border-box;
+}
+
+.el-button {
+    display: inline-block;
+    line-height: 1;
+    white-space: nowrap;
+    cursor: pointer;
+    background: #fff;
+    border: 1px solid #dcdfe6;
+    color: #606266;
+    text-align: center;
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box;
+    outline: 0;
+    margin: 0;
+    -webkit-transition: .1s;
+    transition: .1s;
+    font-weight: 500;
+    padding: 12px 20px;
+    font-size: 14px;
+    border-radius: 4px;
+    font-family: sans-serif;
+}
+
+.el-button--primary {
+    color: #fff;
+    background-color: #409eff;
+    border-color: #409eff;
+}
+
+.el-button--primary:hover {
+    background: #66b1ff !important;
+    border-color: #66b1ff !important;
+    color: #fff !important;
+}
+
+.el-button:hover {
+    color: #409eff;
+    border-color: #c6e2ff;
+    background-color: #ecf5ff;
+}
+
+/*  */
+.el-input {
+    width: 300px;
+    margin-left: 45px;
+    position: relative;
+    font-size: 14px;
+    display: inline-block;
+}
+
+.el-input__inner {
+    background-color: #fff;
+    background-image: none;
+    border-radius: 4px;
+    border: 1px solid #dcdfe6;
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box;
+    color: #606266;
+    display: inline-block;
+    font-size: inherit;
+    height: 40px;
+    line-height: 40px;
+    outline: 0;
+    padding: 0 15px;
+    -webkit-transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
+    transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
+    width: 100%;
+}
+
+.el-input__prefix {
+    position: absolute;
+    top: 0;
+    transition: all .3s;
+    height: 100%;
+    color: #c0c4cc;
+    text-align: center;
+    left: 5px;
+}

+ 79 - 15
src/login/index.html

@@ -30,22 +30,24 @@
                                 <img src="./css/img/username.png">
                                 <img src="./css/img/login_line.png">
                             </div>
-                            <input type="text" class="form-control form-control-sm title username" autocomplete="off" placeholder="用户名/手机号">
+                            <input type="text" class="form-control form-control-sm title username" autocomplete="off"
+                                placeholder="用户名/手机号">
                         </div>
                         <div class='passwordContainer' style="margin-top: 15px;">
                             <div class='loginimg form-inline'>
                                 <img src="./css/img/password.png">
                                 <img src="./css/img/login_line.png">
                             </div>
-                            <input type="password" class="form-control form-control-sm title password" placeholder="密码" autocomplete="off">
+                            <input type="password" class="form-control form-control-sm title password" placeholder="密码"
+                                autocomplete="off">
                         </div>
                         <div class='codeContainer' style="margin-top: 15px;">
                             <div class='loginimg form-inline'>
                                 <img src="./css/img/msg.png">
                                 <img src="./css/img/login_line.png">
                             </div>
-                            <input type="text" autocomplete="off" class="form-control form-control-sm title username msginfo"
-                                placeholder="短信验证码">
+                            <input type="text" autocomplete="off"
+                                class="form-control form-control-sm title username msginfo" placeholder="短信验证码">
                             <div class="form-inline msgBtn">
                                 <span class="msgcode">获取验证码</span>
                             </div>
@@ -58,17 +60,19 @@
                         </div>
                     </div>
                 </div>
-                    <div class="error bottom">
-                        <img src="./css/img/error.png" />
-                        <span class="spanbackground">
-                            <span class="errorInfoUsername">
-                                <div class="errorInfoUsername1"></div>
-                                <div class="errorInfoUsername2"></div>
-                                <div class="errorInfoUsername3"></div>
-                                <div class="errorInfoUsername4"></div>
-                            </span>
+                <button class="forgetpsw-btn resetPsw" style="left: 38%;"><span>忘记密码?</span></button>
+                <button class="forgetpsw-btn modifyPsw" style="left: 60%;"><span>修改密码</span></button>
+                <div class="error bottom">
+                    <img src="./css/img/error.png" />
+                    <span class="spanbackground">
+                        <span class="errorInfoUsername">
+                            <div class="errorInfoUsername1"></div>
+                            <div class="errorInfoUsername2"></div>
+                            <div class="errorInfoUsername3"></div>
+                            <div class="errorInfoUsername4"></div>
                         </span>
-                    </div>
+                    </span>
+                </div>
             </div>
         </div>
         <!-- <div class="shadow form-inline">
@@ -110,7 +114,7 @@
             <span class="pwspan">忘记密码?</span>
             <span class="feedspan">问题反馈</span>
         </div> -->
-        
+
         <!--<div class="info">
             <p><span>技术支持:成都同飞科技有限责任公司</span>
             <span>客服电话:(028)8734870</span>
@@ -119,6 +123,66 @@
             
         </div>-->
     </div>
+    <div class="alert alertInfo">
+        <strong></strong>
+    </div>
+    <div class="modelDialog">
+        <div class="wrapDialog"></div>
+        <div class="resetPswDialog">
+            <div class="dialog-title"></div>
+            <div class="dialog-content">
+                <div class="nextOne">
+                    <div class="el-input userDiv">
+                        <input type="text" autocomplete="off" placeholder="请输入验证手机号"
+                            class="el-input__inner usernameInput">
+                    </div>
+                    <div class="el-input codeDiv ">
+                        <label>验证码</label>
+                        <input type="text" autocomplete="off" placeholder="请输入接收到的验证码短信"
+                            class="el-input__inner authCodeInput">
+                    </div>
+                </div>
+                <div class="passwordReset">
+                    <div class="el-input labelInput">
+                        <label><i>*</i>新密码</label>
+                        <input type="password" autocomplete="off" placeholder="请输入密码" class="el-input__inner newpass">
+                    </div>
+                    <div class="el-input labelInput">
+                        <label><i>*</i>确认密码</label>
+                        <input type="password" autocomplete="off" placeholder="请确认密码"
+                            class="el-input__inner checkNewPass">
+                    </div>
+                </div>
+                <div class="passwordModify">
+                    <!-- <div class="el-input labelInput">
+                        <label><i>*</i>用户名</label>
+                        <input type="text" autocomplete="off" placeholder="请输入用户名"
+                            class="el-input__inner modifyUsername">
+                    </div> -->
+                    <div class="el-input labelInput">
+                        <label><i>*</i>原始密码</label>
+                        <input type="password" autocomplete="off" placeholder="请输入原始密码"
+                            class="el-input__inner originalPassword">
+                    </div>
+                    <div class="el-input labelInput">
+                        <label><i>*</i>新密码</label>
+                        <input type="password" autocomplete="off" placeholder="请输入新密码"
+                            class="el-input__inner newPassword">
+                    </div>
+                    <div class="el-input labelInput">
+                        <label><i>*</i>确认密码</label>
+                        <input type="password" autocomplete="off" placeholder="请确认密码"
+                            class="el-input__inner checkNewPassword">
+                    </div>
+                </div>
+            </div>
+            <div class="dialog-footer">
+                <button type="button" class="el-button el-button--default cancel"><span>取消</span></button>
+                <button type="button" class="el-button el-button--primary next"><span>下一步</span></button>
+                <button type="button" class="el-button el-button--primary confirm"><span>确定</span></button>
+            </div>
+        </div>
+    </div>
 </body>
 <script type="text/javascript" src="../vendor/jquery-3.3.1/jquery.min.js"></script>
 <script type="text/javascript" src="../vendor/js-security/sha1.js"></script>

+ 265 - 5
src/login/js/login.js

@@ -3,8 +3,11 @@
 var API_ADDR = "",
     SYS_ADDR = location.href.replace(/login\/+$/, ""),
     COOKIE_EXPIRES = 1,
-    COOKIE_PATH = location.pathname.replace(/login\/+$/, "");
-    var configurejs=SYS_ADDR+"configure.js";
+    COOKIE_PATH = location.pathname.replace(/login\/+$/, "")
+var configurejs = SYS_ADDR + "configure.js";
+
+const regPhone = () => /^1[3456789]\d{9}$/ // 手机号码验证
+const regNewPassword = () => /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9!@#$%&+-]{12,}$/ // 密码强度验证
 //const mydeskUrl="http://10.37.5.54:8080/UAC/sso/login";
 /* CONFIGURE END */
 require([configurejs], function (AppX) {
@@ -202,13 +205,13 @@ function load() {
                 path: SYS_ADDR
             });
         } else {
-            Cookies.remove(hex_sha1("remember"),{
+            Cookies.remove(hex_sha1("remember"), {
                 path: COOKIE_PATH
             });
-            Cookies.remove(hex_sha1("username"),{
+            Cookies.remove(hex_sha1("username"), {
                 path: COOKIE_PATH
             });
-            Cookies.remove(hex_sha1("psw"),{
+            Cookies.remove(hex_sha1("psw"), {
                 path: COOKIE_PATH
             });
         }
@@ -258,4 +261,261 @@ function load() {
         else
             return "";
     }
+
+    /*
+    修改密码&&重置密码 
+     */
+    var passParam = null
+    var modifyParam = null
+    var isPass = false
+    var isReset = false
+    var authCode = null
+    //初始化状态
+    $('.codeDiv').hide()
+    // $('.alertInfo').hide()
+    $('.confirm').hide()
+    //重置密码
+    $(".resetPsw").off("click").on("click", function (e) {
+        $('.dialog-title').text('重置密码')
+        $(".modelDialog").css('display', 'block');
+        $('.next > span').text('下一步')
+    }.bind(this))
+
+    //下一步获取验证码
+    $('.next').off("click").on("click", function (e) {
+        getNext()
+    }.bind(this))
+
+    //确定提交
+    $('.confirm').off("click").on("click", function (e) {
+        isReset ? modifyThePassword() : reseThePassword()
+    }.bind(this))
+
+    //修改密码
+    $(".modifyPsw").off("click").on("click", function (e) {
+        $('.dialog-title').text('修改密码')
+        $(".modelDialog").css('display', 'block');
+        $('.next > span').text('下一步')
+        isReset = true
+    }.bind(this))
+
+    //取消
+    $(".cancel").off("click").on("click", function (e) {
+        $(".modelDialog").css('display', 'none');
+        //
+        close()
+        //
+        reset()
+    }.bind(this))
+
+    function reset() {
+        $('.usernameInput').val('')
+        passParam = null
+        modifyParam = null
+        isPass = false
+        isReset = false
+        authCode = null
+    }
+
+    function close() {
+        $('.userDiv').show()
+        $('.codeDiv').hide()
+        $('.next').show()
+        $('.confirm').hide()
+        $('.passwordReset').css('display', 'none')
+        $('.passwordModify').css('display', 'none')
+    }
+
+    function getNext() {
+        if (!isPass) {
+            let value = $('.usernameInput').val().trim()
+            if (new RegExp(/^1[3456789]\d{9}$/).test(value)) {
+                passParam = { phoneNumber: value }
+                modifyParam = { username: value }
+                getAuthCode()
+            } else {
+                showTipsInfo('alert-danger', '请输入正确的手机号!')
+                $('.userDiv').show()
+                $('.codeDiv').hide()
+            }
+
+        } else {
+            let val = $('.authCodeInput').val().trim()
+            if (val) {
+                authCode = val
+                checkCode()
+            } else {
+                showTipsInfo('alert-danger', '请输入验证码!')
+            }
+        }
+    }
+    //获取手机验证码
+    function getAuthCode() {
+        $.ajax({
+            url: API_ADDR + "/base/authcode/add",
+            data: JSON.stringify(passParam),
+            contentType: "application/json;charset=UTF-8",
+            type: "post",
+            dataType: "json",
+            success: function (result) {
+                if (result.code == 1) {
+                    showTipsInfo('alert-success', '已发送验证码')
+                    isPass = true
+                    $('.userDiv').hide()
+                    $('.codeDiv').css('display', 'flex');
+                } else {
+                    showTipsInfo('alert-danger', result.message)
+                }
+            },
+            error: function (err) {
+                console.log(err);
+            }
+        });
+    }
+    //验证手机验证码
+    function checkCode() {
+        $.ajax({
+            url: API_ADDR + "/base/authcode/check",
+            data: JSON.stringify({ ...passParam, codeInput: authCode }),
+            contentType: "application/json;charset=UTF-8",
+            type: "post",
+            dataType: "json",
+            success: function (result) {
+                if (result.code == 1 && result.result == 1) {
+                    $('.userDiv').hide()
+                    $('.codeDiv').hide()
+                    //
+                    $('.next').hide()
+                    $('.confirm').show()
+                    //
+                    if (!isReset) {
+                        $('.passwordReset').css('display', 'block')
+                    } else {
+                        $('.passwordModify').css('display', 'block')
+                    }
+                } else {
+                    showTipsInfo('alert-danger', '验证失败')
+                }
+            },
+            error: function (err) {
+                console.log(err);
+            }
+        });
+    }
+
+    //密码重置
+    function reseThePassword() {
+        let newpass = $('.newpass').val().trim()
+        let checkNewPass = $('.checkNewPass').val().trim()
+        if (!newpass) {
+            showTipsInfo('alert-danger', '请输入密码')
+            return
+        }
+        if (!regNewPassword().test(newpass)) {
+            showTipsInfo('alert-danger', '密码位数至少12位,必须包含大小写字母和数字,不可包含非法字符!')
+            return
+        }
+        if (!checkNewPass) {
+            showTipsInfo('alert-danger', '请再次输入密码')
+            return
+        }
+        if (checkNewPass !== newpass && checkNewPass !== '') {
+            showTipsInfo('alert-danger', '两次输入密码不一致!')
+            return
+        }
+        const data = {
+            ...passParam,
+            password: hex_sha1(checkNewPass)
+        }
+        $.ajax({
+            url: API_ADDR + "/base/user/info/updatePasswordByUser",
+            data: JSON.stringify(data),
+            contentType: "application/json;charset=UTF-8",
+            type: "put",
+            dataType: "json",
+            success: function (result) {
+                if (result.code == 1 && result.result) {
+                    showTipsInfo('alert-success', '重置密码成功!')
+                    $(".modelDialog").css('display', 'none');
+                    close()
+                    reset()
+                } else {
+                    showTipsInfo('alert-danger', '修改失败')
+                }
+            },
+            error: function (err) {
+                console.log(err);
+            }
+        });
+    }
+
+    //密码修改
+    function modifyThePassword() {
+        // let username = $('.modifyUsername').val().trim()
+        let originalPassword = $('.originalPassword').val().trim()
+        let newPassword = $('.newPassword').val().trim()
+        let checkNewPassword = $('.checkNewPassword').val().trim()
+        // if (!username) {
+        //     showTipsInfo('alert-danger', '请输入用户名!')
+        //     return
+        // }
+        if (!originalPassword) {
+            showTipsInfo('alert-danger', '请输入原密码!')
+            return
+        }
+        if (!newPassword) {
+            showTipsInfo('alert-danger', '请输入密码!')
+            return
+        }
+        if (!regNewPassword().test(newPassword)) {
+            showTipsInfo('alert-danger', '密码位数至少12位,必须包含大小写字母和数字,不可包含非法字符!')
+            return
+        }
+        if (checkNewPassword !== newPassword) {
+            showTipsInfo('alert-danger', '两次密码输入不相同!')
+            return
+        }
+        if (originalPassword === newPassword) {
+            showTipsInfo('alert-danger', '新密码和原始密码相同!')
+            return
+        }
+        let params = {
+            // username,
+            ...modifyParam,
+            originalPassword: hex_sha1(originalPassword),
+            password: hex_sha1(newPassword)
+        }
+        $.ajax({
+            url: API_ADDR + "/base/user/updatePassword",
+            data: JSON.stringify(params),
+            contentType: "application/json;charset=UTF-8",
+            type: "put",
+            dataType: "json",
+            success: function (result) {
+                if (result.code == 1 && result.result) {
+                    showTipsInfo('alert-success', '修改密码成功!')
+                    $(".modelDialog").css('display', 'none');
+                    close()
+                    reset()
+                } else {
+                    showTipsInfo('alert-danger', '修改失败')
+                }
+            },
+            error: function (err) {
+                console.log(err);
+            }
+        });
+    }
+
+    function showTipsInfo(className, text) {
+        if ($('.alertInfo').hasClass(className)) {
+            $('.alertInfo').removeClass(className)
+        }
+        $('.alertInfo').addClass(className)//'alert-success'
+        $('.alertInfo > strong').text(text)
+        $('.alertInfo').show()
+        setTimeout(() => {
+            $('.alertInfo').hide()
+        }, 2000)
+    }
 }