Skip to content

Commit

Permalink
默认隐藏验证码
Browse files Browse the repository at this point in the history
  • Loading branch information
star7th committed Sep 16, 2017
1 parent 55c7c60 commit 4ddfa4b
Show file tree
Hide file tree
Showing 10 changed files with 686 additions and 13 deletions.
39 changes: 36 additions & 3 deletions Application/Home/View/Item/pwd.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<link rel="stylesheet" href="__PUBLIC__/css/login.css" />
<div class="container">

<form class="form-signin" method="post">
<form class="form-signin myform" method="post" action="server/index.php?s=/api/item/pwd">
<h3 class="form-signin-heading">{$Think.Lang.input_visit_password}</h3>
<input type="hidden" id="item_id" name="item_id" value="{$item_id}">
<input type="password" class="input-block-level" name="password" placeholder="{$Think.Lang.password}">
Expand All @@ -21,14 +21,47 @@ <h3 class="form-signin-heading">{$Think.Lang.input_visit_password}</h3>
</div> <!-- /container -->


<include file="Common/footer" />

<include file="Common/footer" />
<script src="__PUBLIC__/js/jquery.form.min.js"></script>
<script type="text/javascript">
$(function(){
$("#input_v_code").hide();
$("#v_code_img").hide();
$("#v_code_img").attr("src" , DocConfig.pubile+'/verifyCode.php');

$("#v_code_img").click(function(){
var v_code_img = $("#v_code_img").attr("src");
$("#v_code_img").attr('src' ,v_code_img+'?'+Date.parse(new Date()) );
});

//上传表单参数
var ajax_option = {
dataType:"json",
beforeSubmit:function(){

},
success:function(res){
if (res.error_code === 0) {
if (res.refer_url) {
var url = res.refer_url;
}else{
var url = '?s=/'+$("#item_id").val();
}
window.location.href = url;
}else{
$.alert(res.error_message);

if (res.error_code === 10206 || res.error_code === 10308 ) {
$("#v_code_img").click();
$("#v_code_img").show();
$("#input_v_code").show();
};

}
}
};

$('.myform').ajaxForm(ajax_option);
});
</script>

39 changes: 34 additions & 5 deletions Application/Home/View/User/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

<div class="container">

<form class="form-signin" method="post">
<form class="form-signin myform" method="post" action="server/index.php?s=/api/user/login">
<h3 class="form-signin-heading">{$Think.Lang.login}</h3>
<input type="text" class="input-block-level" name="username" placeholder="{$Think.Lang.username}">
<input type="password" class="input-block-level" name="password" placeholder="{$Think.Lang.password}">
<if condition="$CloseVerify != 1">
<input type="text" class="input-block-level" autocomplete="off" name="v_code" placeholder="{$Think.Lang.verification_code}">
<input type="text" class="input-block-level" id="input_v_code" autocomplete="off" name="v_code" placeholder="{$Think.Lang.verification_code}">
<div class="control-group">
<div class="controls">
<img src="#" id="v_code_img">
Expand All @@ -22,14 +22,43 @@ <h3 class="form-signin-heading">{$Think.Lang.login}</h3>
</div> <!-- /container -->


<include file="Common/footer" />

<include file="Common/footer" />
<script src="__PUBLIC__/js/jquery.form.min.js"></script>
<script type="text/javascript">
$(function(){
$("#input_v_code").hide();
$("#v_code_img").hide();
$("#v_code_img").attr("src" , DocConfig.pubile+'/verifyCode.php');

$("#v_code_img").click(function(){
var v_code_img = $("#v_code_img").attr("src");
$("#v_code_img").attr('src' ,v_code_img+'?'+Date.parse(new Date()) );
});

//上传表单参数
var ajax_option = {
dataType:"json",
beforeSubmit:function(){

},
success:function(res){
if (res.error_code === 0) {
window.location.href = "?s=/home/item/index";
}else{
$.alert(res.error_message);

if (res.error_code === 10206 || res.error_code === 10210 ) {
$("#v_code_img").click();
$("#v_code_img").show();
$("#input_v_code").show();
};

}
}
};

$('.myform').ajaxForm(ajax_option);


});
</script>
</script>
25 changes: 22 additions & 3 deletions Application/Home/View/User/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<div class="container">

<form class="form-signin" method="post">
<form class="form-signin myform" method="post" action="server/index.php?s=api/user/register">
<h3 class="form-signin-heading">{$Think.Lang.register_new_account}</h3>
<input type="text" class="input-block-level" name="username" placeholder="{$Think.Lang.username_description}">
<input type="password" class="input-block-level" name="password" placeholder="{$Think.Lang.password}">
Expand All @@ -23,15 +23,34 @@ <h3 class="form-signin-heading">{$Think.Lang.register_new_account}</h3>
</div> <!-- /container -->


<include file="Common/footer" />

<include file="Common/footer" />
<script src="__PUBLIC__/js/jquery.form.min.js"></script>
<script type="text/javascript">
$(function(){
$("#v_code_img").attr("src" , DocConfig.pubile+'/verifyCode.php');
$("#v_code_img").click(function(){
var v_code_img = $("#v_code_img").attr("src");
$("#v_code_img").attr('src' ,v_code_img+'?'+Date.parse(new Date()) );
});

//上传表单参数
var ajax_option = {
dataType:"json",
beforeSubmit:function(){

},
success:function(res){
if (res.error_code === 0) {
window.location.href = "?s=/home/item/index";
}else{
$.alert(res.error_message);
$("#v_code_img").click();
}
}
};

$('.myform').ajaxForm(ajax_option);

});

</script>
Loading

0 comments on commit 4ddfa4b

Please sign in to comment.