ta:{ loginname:function(){ return $("#mobile").val(); } } } }, code2:{ required: true, }, sms_code:{ required: true }, }, messages: { mobile: { required: '用户名不能为空', isMobile: '手机号不合法', remote:'账号不存在' }, code2:{ required: '验证码不能为空', }, sms_code:{ required: '短信动态码不能为空' }, }, errorPlacement: function (error, element) { var content = $('.login-error').html(); if (content == '') { $('.login-error').show(); $('.login-error').html(error); } }, showErrors: function (errorMap, errorList) { if (errorList.length < 1) { $('.login-error').hide(); $('.login-error').html(''); } else { $('.login-error').show(); this.defaultShowErrors(); } }, submitHandler:function(form){ var login_form=$("#sms_fast_login"); var url = SITEURL+'member/login/ajax_check_sms_code'; var phone = $("#mobile").val(); var sms_code = $("#sms_code").val(); var frmcode = login_form.find("input[name=logincode]").val(); var code = null; if(login_form.find("input[name=code2]").length>0){ code = login_form.find("input[name=code2]").val(); } var return_url = login_form.find("input[name=fromurl]").val(); $.ajax({ type:"post", async: false, url:url, data:{phone:phone,frmcode:frmcode,sms_code:sms_code,code:code}, dataType:'json', success: function(data){ if(data.status == '1'){//登录成功,跳转到来源网址 ST.Login.login_callback(data); console.log(return_url); setTimeout(function () { window.open(return_url, '_self'); }, 500); //$('body').append(data.js);//同步登录js }else{ $('.login-error').show(); if(data.msg!=undefined){ $(".login-error").html(data.msg); }else{ $(".login-error").html('用户名或者密码错误'); } if (login_form.find('.captcha').length <=0) { var yzm_html='
  • ' + '
  • '; login_form.find("li.phone").after(yzm_html); } login_form.find('.captcha').attr('src', ST.captcha(SITEURL + 'captcha')); } }, error:function(a,b,c){} }); return false; } }); })