var form = { databaseUrl: '127.0.0.1', databasePort: '3306', databaseTable: '5kcrm_', databasePwd: '', databaseUser: 'root' }; var rules = { databaseUrl: { required: true, regexp: /[^\u4e00-\u9fa5]+$/, label: '数据库主机地址' }, databaseName: { required: true, regexp: /[^\u4e00-\u9fa5]+$/, label: '数据库名' }, databasePort: { required: true, regexp: /^[0-9]*$/, label: '数据库端口号' }, databaseUser: { required: true, regexp: /[^\u4e00-\u9fa5]+$/, label: '数据库用户名' }, databasePwd: { required: false, regexp: null, label: '数据库密码' }, databaseTable: { required: true, regexp: /[^\u4e00-\u9fa5]+$/, label: '数据库表前缀' }, root: { required: true, regexp: /^[1][3-9][0-9]{9}$/, label: '管理员账号' }, pwd: { required: true, regexp: /^(?=.*[a-zA-Z])(?=.*\d).{6,20}$/, label: '管理员密码(6~20位字母加数字组合)' }, wkcode: { required: false, regexp: null, label: '' }, }; var timer = null; var flag = true; _initFormValue(); // 上一步 $('.prev').click(function () { window.location = 'step1.html' }); // 下一步 $('.next').click(function () { // 获取form数据 // 校验form数据 true 校验通过 false 校验失败 var forms = getFormData(); var result = checkForm(); // console.log('result---', result, forms); if (result) { $('#cover').css('display', 'block');//显示遮罩层 setTimeout(()=>{ $.ajax({ cache: true, type: "POST", dataType: 'json', url: "./step4", data: { form: forms }, async: true, timeout: 120000, success: function (result) { const step7 = $.ajax({ url:'./step7', dataType:'json', type: "POST", data: { form: forms }, }) const step8 = $.ajax({ url:'./step8', dataType:'json', type: "POST", data: { form: forms }, }) const step10 = $.ajax({ url:'./step10', dataType:'json', type: "POST", data: { form: forms }, }) const step11 = $.ajax({ url:'./step11', dataType:'json', type: "POST", data: { form: forms }, }) if (result.code == '200') { Promise.all([step7,step8,step10,step11]).then(res=>{ const [step7Res,step8Res,step10Res,step11Res] =res }) localStorage.clear(); window.location = 'step5.html'; } else if (result.code == '400') { alert(result.error); window.location.href = 'step6.html'; } else { alert(result.error); window.location.href = 'step6.html'; } }, error: function (xhr) { window.location.href = 'step6.html'; } }); }) } }); function getRes() { if (timer) { clearTimeout(timer); timer = null; } // $.post("/admin/install/progress",function(result){ // $(".install_progress_a").show(); // $(".install_progress_a").empty(); // $(".form").hide(); // $(".control").hide(); // if(result.data.now < result.data.length ){ // $(".install_progress_a").append(""); // html ="