自动化立体仓库 - WMS系统
lty
2026-01-14 1995bf7ac28f2648bd157692bf2f531ea1f6b6c9
src/main/webapp/views/password.html
@@ -39,7 +39,7 @@
        <div class="layui-form-item">
            <label class="layui-form-label">当前密码</label>
            <div class="layui-input-inline">
                <input id="oldPassword" type="password" class="layui-input" lay-verify="checkPwd" lay-vertype="tips">
                <input id="oldPassword" type="password" class="layui-input" lay-verify="checkPwd" lay-vertype="tips" autocomplete="off">
            </div>
        </div>
        <div class="layui-form-item">
@@ -63,6 +63,8 @@
</div>
</body>
<script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../static/js/tools/md5.js"></script>
<script type="text/javascript" src="../static/js/common.js" charset="utf-8"></script>
<script src="../static/layui/layui.js"></script>
<script>
    layui.use(['form'], function() {
@@ -73,9 +75,9 @@
        form.verify({
            checkPwd: function(val) {
                if (val === ""){
                    return "当前密码不能为空";
                    // return "当前密码不能为空";
                }
                if (parent.$('#password').val() !== val) {
                if (parent.$('#password').val() !== hex_md5(val)) {
                    return "密码不匹配";
                }
            },
@@ -86,7 +88,7 @@
                if (val.length < 4) {
                    return "不能少于4个字符";
                }
                if (parent.$('#password').val() === val) {
                if (parent.$('#password').val() === hex_md5(val)) {
                    return "与旧密码不能相同";
                }
            },
@@ -100,7 +102,7 @@
        form.on('submit(savePwd)', function (data) {
            var user = {
                id: parent.$('#id').val(),
                password: $('#password').val(),
                password: hex_md5($('#password').val()),
            };
            $.ajax({
                url: baseUrl+"/user/update/auth",
@@ -114,17 +116,17 @@
                            btn: ['确定'],
                            btn1: function(){
                                localStorage.removeItem("token");
                                top.location.href = "/";
                                top.location.href = baseUrl+"/";
                            },
                            cancel: function(){
                                localStorage.removeItem("token");
                                top.location.href = "/";
                                top.location.href = baseUrl+"/";
                            },
                            closeBtn: 0,
                            shadeClose: false,
                        })
                    } else if (res.code === 403){
                        top.location.href = "/";
                        top.location.href = baseUrl+"/";
                    } else {
                        layer.msg(res.msg);
                    }
@@ -141,4 +143,11 @@
        parent.layer.closeAll();
    });
</script>
<script src="../../static/js/translate.js"></script>
<script>
    translate.selectLanguageTag.show = false; //不出现的select的选择语言
    translate.service.use('client.edge'); //设置翻译服务
    translate.listener.start(); //开启页面元素动态监控,js改变的内容也会被翻译,参考文档: http://translate.zvo.cn/4067.html
    translate.execute();
</script>
</html>