python运维工具_自动化运维工具

IT运维管理平台

IT

Management Center

{##}

{##}

{#

{# style="color: #FFFFFF !important; position:absolute; z-index:100;width: 100px"value=""#}

{# type="text"placeholder="请输入验证码">#}

{#

{# style="position: absolute;top:1px;right: 0;margin-right: -125px">#}

{##}

正在为您火速加载中....

登录

functionchangeImg(ths) {

ths.src=ths.src+ "?";

}

{# $('#mybtn').click(function() {#}

{# $('#username').next().remove();#}

{# $('#password').next().remove();#}

{# $('#code').siblings('.error_div1').remove();#}

{# $('#username').parent().parent().find(".error_div2").remove();#}

{#varflag= true;#}

{#varuser_name=$('#username').val();#}

{#varuser_pwd=$('#password').val();#}

{#varcheck_code=$('#code').val();#}

{#if(flag) {#}

{# $.ajaxSetup({#}

{# data: {csrfmiddlewaretoken:'{{ csrf_token }}'}#}

{# });#}

{# $.ajax({#}

{# url:'/login/',#}

{# type:'POST',#}

{# data: {"username": user_name,"password": user_pwd,"code": check_code},#}

{# dataType:"JSON",#}

{# success:function(data) {#}

{#if(data.status) {#}

{# location.href= '/login_first/'#}

{# }#}

{#else#}

{# {#}

{# console.log(data);#}

{# $.each(data.error,function(k, v) {#}

{#if(k== 'username') {#}

{#var$msg= "

" +v[0]+ '
';#}

{# $('#' +k).after($msg)#}

{# }else if(k== 'password') {#}

{#var$msg= "

" +v[0]+ '
';#}

{# $('#' +k).after($msg)#}

{# }else if(k== 'code') {#}

{#var$msg= "

" +v[0]+ '
';#}

{# $('#' +k).after($msg)#}

{# }#}

{#else{#}

{#var$msg= "

" +v+ '
';#}

{# $('#username').parent().before($msg);#}

{# }#}

{##}

{# });#}

{# }#}

{# }#}

{# })#}

{# }#}

{##}

{# });#}varhandlerPopup= function(captchaObj) {

captchaObj.onReady(function() {//1.极验加载/准备时回调函数

$("#loading-tip").hide();

$('#login_zone').show();

});

captchaObj.onSuccess(function() {//2.极验加载成功的回调

$('#login_zone').hide();varvalidate=captchaObj.getValidate();

$.ajax({//3.发送用户输入到后台

url:"{% url 'login'%}",

type:"post",

dataType:"json",

data: {

username: $('#username').val(),

password: $('#password').val(),

csrfmiddlewaretoken:'{{ csrf_token }}',

geetest_challenge: validate.geetest_challenge,

geetest_validate: validate.geetest_validate,

geetest_seccode: validate.geetest_seccode

},

success:function(data) {if(data.status) {//4.后端验证成功跳转

location.href= '/login_first/'}else{

$('#login_zone').show();

captchaObj.reset();//4.后端验证失败,从新加载极致验证插件;

$('#popup-captcha').hide();

$('#username').next().remove();

$('#password').next().remove();

$('#code').siblings('.error_div1').remove();

$('#username').parent().parent().find(".error_div2").remove();

$.each(data.error,function(k, v) {if(k== 'username') {var$msg= "

" +v[0]+ '
';

$('#' +k).after($msg)

}else if(k== 'password') {var$msg= "

" +v[0]+ '
';

$('#' +k).after($msg)

}else if(k== 'code') {var$msg= "

" +v[0]+ '
';

$('#' +k).after($msg)

}else{var$msg= "

" +v+ '
';

$('#username').parent().before($msg);

}

});

}

}

});

});

$("#mybtn").click(function() {

captchaObj.appendTo("#popup-captcha");

$('#popup-captcha').show()

});

};

$.ajax({//0.加载极验插件

url:"/pc-geetest/register?t=" +(newDate()).getTime(),//加随机数防止缓存

type:"get",

dataType:"json",

success:function(data) {//使用initGeetest接口

//参数1:配置参数

//参数2:回调,回调的第一个参数验证码对象,之后可以使用它做appendTo之类的事件

initGeetest({

gt: data.gt,

challenge: data.challenge,

product:"popup",//产品形式,包括:float,embed,popup。注意只对PC版验证码有效

offline:!data.success//表示用户后台检测极验服务器是否宕机,一般不需要关注

//更多配置参数请参见:http://www.geetest.com/install/sections/idx-client-sdk.html#config

}, handlerPopup);

}

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值