<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:66:"/www/wwwroot/10.168.1.202/public/../app/index/view/index/info.html";i:1609314480;}*/ ?>
<!-- 修改密码表单 -->
<form class="layui-form model-form">
    
    <div class="layui-form-item">
        <label class="layui-form-label">原始密码:</label>
        <div class="layui-input-block">
            <input type="password" name="oldPsw" placeholder="请输入原始密码,不修改请留空" class="layui-input"
                   lay-verType="tips"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">新密码:</label>
        <div class="layui-input-block">
            <input type="password" name="newPsw" placeholder="请输入新密码,不修改请留空" class="layui-input"
                   lay-verType="tips" lay-verify="psw" required/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认密码:</label>
        <div class="layui-input-block">
            <input type="password" name="rePsw" placeholder="请再次输入新密码,不修改请留空" class="layui-input"
                   lay-verType="tips" lay-verify="equalTo" lay-equalTo="input[name=newPsw]"/>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block text-right">
            <button class="layui-btn" lay-filter="submit-psw" lay-submit>保存</button>
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
        </div>
    </div>
</form>

<!-- js部分 -->
<script>
    layui.use(['layer', 'form', 'admin', 'formX'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var admin = layui.admin;

        // 监听提交
        form.on('submit(submit-psw)', function (data) {
            $.post('<?php echo url("index/info_save"); ?>', data.field, function (res) {
              if (0 != res.code) {                                
                  layer.msg(res.msg, {icon: 1});
                  
              } else {
                  layer.msg(res.msg, {icon: 2});
              }
            }, 'json');
            admin.closeDialog('[lay-filter="submit-psw"]');
            return false;
        });

    });
</script>