puzhibing
2023-12-04 3ad6b6ba2ba56fc0bcd2130e47190779c6e15acc
cloud-server-management/src/main/webapp/WEB-INF/view/password.html
@@ -60,13 +60,14 @@
        <img style="margin-left: 44px" src="${ctxPath}/img/logo.png" width="100px" height="120px"/>
        <br/>
        <h4 style="color: red;">${tips!}</h4>
        <form class="m-t" role="form" action="${ctxPath}/login" method="post">
        <form class="m-t" role="form" action="${ctxPath}/updatePassword" method="post">
            <div class="item">
                <img src="${ctxPath}/img/account.png" />
                <input class="itemInput" type="text" name="username" id="username"  placeholder="请输入账号" required="" value="">
            </div>
            <div  class="item">
                <input class="itemInput" name="sms_code" id="sms_code"  placeholder="请输入验证码" required="" value="" style="padding-left: 0px; text-align: center;">
                <input type="hidden" id="code">
                <button id="btn" type="button" onclick="sendSMSCode(this)" style="width: 150px; font-size: 14px;">获取验证码</button>
            </div>
            <div  class="item">
@@ -99,6 +100,17 @@
    var key = CryptoJS.enc.Utf8.parse("c53fd327353a09a1");
    var iv = CryptoJS.enc.Utf8.parse("3a0565e3b1d8ae3d");
    function sendSMSCode() {
        var phone  = $("#username").val()
        var ajax = new $ax(Feng.ctxPath + "/getSMSCode", function(data){
            if(data!=null){
            }
        });
        ajax.set("phone",phone);
        ajax.start();
    }
    //aes加密
    function encrypt(context) {
        var encrypted = '';
@@ -126,13 +138,27 @@
        return decryptedStr.toString();
    }
    function update(){
    function update() {
        let password = $('#password').val();
        password = encrypt(password);
        $('#password').val(password);
        $('#submit').submit();
    }
        $.ajax({
            url: 'your-submit-url',
            type: 'POST',
            data: $('#submit').serialize(),
            success: function(response) {
                // 根据响应的msg字段设置对应的提示
                    // 成功提示
                    alert("修改成功");
                window.location.href = Feng.ctxPath+"/login";
            },
            error: function() {
                // 错误处理
                alert('当前账号不存在');
            }
        });
    }
    window.addEventListener(
        "mousewheel",