parent
33f699756a
commit
75c768d716
5 changed files with 1840 additions and 0 deletions
@ -0,0 +1,30 @@ |
||||
<?php |
||||
include '../../functions.php'; |
||||
|
||||
|
||||
$code=$_REQUEST['code']; |
||||
$tel=$_REQUEST['tel']; |
||||
|
||||
//database connect |
||||
$conn=db__connect(); |
||||
|
||||
//no such code |
||||
if(db__rowNum($conn,"sms","val",$code)==0) {echo json_encode(array(code=>-2));die();}; |
||||
|
||||
|
||||
//get row info form table blog with id |
||||
$result=db__getData($conn,"sms","val",$code); |
||||
|
||||
|
||||
$time=$result[0]['time']; |
||||
|
||||
//success |
||||
if($time>(time()-130)&&$time<time()&&$tel==$result[0]['tel']){echo json_encode(array(code=>0));} |
||||
|
||||
//code out of time |
||||
elseif($tel==$result[0]['tel']){echo json_encode(array(code=>-1));} |
||||
|
||||
//code is of other people |
||||
else{json_encode(array(code=>-3));} |
||||
|
||||
die(); |
File diff suppressed because one or more lines are too long
@ -0,0 +1,302 @@ |
||||
|
||||
var g_warnTel=0; |
||||
var g_can_click=1; |
||||
var g_can_send=1; |
||||
var g_success=0; |
||||
var g_finalTel; |
||||
var g_wrongCount=0; |
||||
|
||||
var _phone=0; |
||||
var _code=0; |
||||
|
||||
|
||||
|
||||
|
||||
$(".log-btn").addClass("off"); |
||||
|
||||
|
||||
$('#veri-code').keyup(function(event) { |
||||
$('.tel-warn').addClass('hide'); |
||||
checkBtn(); |
||||
}); |
||||
|
||||
function checkBtn() |
||||
{ |
||||
|
||||
var phone = $.trim($('#tel').val()); |
||||
var code2 = $.trim($('#veri-code').val()); |
||||
|
||||
|
||||
if(!g_can_send) |
||||
{ |
||||
|
||||
if (checkPhone((phone))&&code2.length==6) { |
||||
|
||||
_phone=phone; |
||||
_code=code2; |
||||
|
||||
if(g_wrongCount<2) check_verCode(phone,code2,2); |
||||
else { |
||||
easyVer(); |
||||
|
||||
$(".wrap").css({
|
||||
"opacity":"0", |
||||
"transition-duration": "1s", |
||||
"transition-delay": "0s" |
||||
}); |
||||
|
||||
if(device.mobile()){document.body.style.zoom="1.2";} |
||||
|
||||
show_easyVer(); |
||||
} |
||||
} else { |
||||
$(".log-btn").addClass("off"); |
||||
}
|
||||
} |
||||
else if(!g_count&&code2.length>3) $('.error').removeClass('hide').text('请先发送验证码同学 Ծ‸ Ծ'); |
||||
} |
||||
|
||||
|
||||
function checkPhoneCode(pCode){ |
||||
if (pCode == '') { |
||||
$('.error').removeClass('hide').text('Where is your 验证码╭(°A°`)╮'); |
||||
return false; |
||||
} else if(pCode.length!=6){ |
||||
$('.error').removeClass('hide').text('这真的是你的验证码吗同学 Ծ‸ Ծ'); |
||||
} |
||||
else { |
||||
$('.error').addClass('hide'); |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
// 登录点击事件
|
||||
$(".log-btn").on("click",function sendBtn(){ |
||||
|
||||
if(g_can_click==1||g_success) |
||||
{ |
||||
var phone = $.trim($('#tel').val()); |
||||
var pcode = $.trim($('#veri-code').val()); |
||||
|
||||
if(!checkPhone(phone) || !checkPhoneCode(pcode)) return false; |
||||
|
||||
if($('input[name="agree"]').val()=='0')
|
||||
{ |
||||
alert('啊咧~ 暂不支持非永久登录┐(´-`)┌'); |
||||
return false; |
||||
} |
||||
|
||||
$.ajax({ |
||||
url: '/etc/clever-login/record_usr.php', |
||||
type: 'post', |
||||
dataType: 'json', |
||||
async: true, |
||||
data: {"tel":g_finalTel,"fp":fp}, |
||||
success:function(data){ |
||||
if (data.code == '0') { |
||||
//正常登录
|
||||
return true; |
||||
} |
||||
else if(data.code=='1'){ |
||||
//转注册界面
|
||||
} |
||||
else{ |
||||
$('.tel-warn').removeClass('hide').text('登录失败'); |
||||
$(".lang-btn").addClass("off"); |
||||
} |
||||
}, |
||||
error:function(){ |
||||
alert('嘀~ 与服务器失联啦 ( ´◔‸◔`)'); |
||||
} |
||||
}); |
||||
|
||||
return false; |
||||
|
||||
} |
||||
|
||||
}); |
||||
|
||||
// 登录的回车事件
|
||||
$(window).keydown(function(event) { |
||||
if (event.keyCode == 13) { |
||||
$('.log-btn').trigger('click'); |
||||
} |
||||
}); |
||||
|
||||
var g_count=0; |
||||
var _phone; |
||||
|
||||
function checkPhone(phone){ |
||||
var status = true; |
||||
_phone=phone; |
||||
if (phone == '') { |
||||
alert('同志,你的手机号呢 (ㅎ‸ㅎ)'); |
||||
return false; |
||||
} |
||||
var param = /^1[34578]\d{9}$/; |
||||
if (!param.test(phone)) { |
||||
alert('咳咳~手机号,你是认真的吗 ⚆_⚆'); |
||||
$('.tel-err').removeClass('hide'); |
||||
$('.tel-err').text('我就这个表情눈_눈'); |
||||
return false; |
||||
} |
||||
|
||||
$('.tel-warn').addClass('hide'); |
||||
return status; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
$(".form-data").delegate(".send","click",function () { |
||||
|
||||
if(!g_success) |
||||
{ |
||||
|
||||
var phone = $.trim($('#tel').val()); |
||||
callBackFunctionName="check_verCode"; |
||||
$('.error').addClass('hide'); |
||||
if (checkPhone(phone))
|
||||
send_verCode(2); |
||||
|
||||
|
||||
} |
||||
}); |
||||
|
||||
|
||||
|
||||
function send_verCode() |
||||
{ |
||||
|
||||
|
||||
$.ajax({ |
||||
url: '/msg.php', |
||||
type: "POST", |
||||
data: {
|
||||
"tel": _phone, |
||||
"tpl": 1, |
||||
"msg1": "", |
||||
"msg2": "验证码", |
||||
"msg3": 15 |
||||
}, |
||||
|
||||
traditional: true, |
||||
dataType: 'json', |
||||
success:function(data){ |
||||
g_can_send=0; |
||||
show_countDown(); |
||||
}, |
||||
error:function(){ |
||||
alert('哎呀~ 短信发送失败了(°Д°)'); |
||||
$('.error').removeClass('hide').text('呀~发送失败啦'); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
function show_countDown() |
||||
{ |
||||
var oTime = $(".form-data .time"), |
||||
oSend = $(".form-data .send"), |
||||
num = parseInt(oTime.text()), |
||||
oEm = $(".form-data .time em"); |
||||
oSend.hide(); |
||||
oTime.removeClass("hide"); |
||||
var timer = setInterval(function () { |
||||
var num2 = num-=1; |
||||
oEm.text(num2); |
||||
if(num2==0&&!g_success){ |
||||
clearInterval(timer); |
||||
oSend.text("重新发送验证码"); |
||||
oSend.show(); |
||||
oEm.text("120"); |
||||
oTime.addClass("hide"); |
||||
g_can_send=1; |
||||
} |
||||
},1000); |
||||
} |
||||
|
||||
|
||||
|
||||
function check_verCode(phone,code,from) |
||||
{ |
||||
|
||||
if(from!=2)
|
||||
{ |
||||
$(".wrap").css({
|
||||
"opacity":"1", |
||||
"transition-duration": "1s", |
||||
"transition-delay": "2s" |
||||
}); |
||||
if(device.mobile()){setTimeout( "document.body.style.zoom=\"0.8\";",2000);} |
||||
g_wrongCount=-3; |
||||
} |
||||
$(".log-btn").addClass("off"); |
||||
g_can_click=0; |
||||
|
||||
$.ajax({ |
||||
url: '/etc/clever-login/check_verCode.php', |
||||
type: "POST", |
||||
data: {
|
||||
"tel": _phone, |
||||
"code":_code |
||||
}, |
||||
|
||||
traditional: true, |
||||
dataType: 'json', |
||||
success:function(data){ |
||||
|
||||
g_wrongCount++; |
||||
if(data.code==0) { |
||||
$(".form-data .time").addClass('hide'); |
||||
$(".form-data .send").show(); |
||||
$(".send").attr('href','#').text('验证成功').css({"color":"green"}); |
||||
g_finalTel=phone; |
||||
g_success=1; |
||||
g_can_send=0; |
||||
$(".log-btn").on('click').removeClass("off"); |
||||
$('.error').addClass('hide'); |
||||
$("#tel").attr('disabled',true); |
||||
$("#veri-code").attr('disabled',true); |
||||
g_wrongCount--; |
||||
} |
||||
else if(data.code==-1) $('.error').removeClass('hide').text('验证码过期啦!!'); |
||||
else if(data.code==-2) $('.error').removeClass('hide').text('验证码不太对哦 Ծ‸ Ծ'); |
||||
else if(data.code==-3) $('.error').removeClass('hide').text('验证码是偷来的吧 Ծ‸ Ծ'); |
||||
else $('.error').removeClass('hide').text('未知错误 Ծ‸ Ծ'); |
||||
|
||||
|
||||
g_can_click=1; |
||||
}, |
||||
error:function(){ |
||||
$('.error').removeClass('hide').text('嘀~ 网络好卡'); |
||||
$(".log-btn").on('click').removeClass("off"); |
||||
g_can_click=1; |
||||
} |
||||
}); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(".icon-ok-sign").click(function(){ |
||||
verify = $(this).hasClass('boxcol') ? 0 : 1; |
||||
$(this).toggleClass('boxcol'); |
||||
ob = $('input[name=agree]'); |
||||
ob.val(ob.val()==0?1:0); |
||||
ob.val(ob.val() !== verify ? verify : ob.val()); |
||||
|
||||
ob.val() == 0 ? $('#errormsg').removeClass('hide').addClass('show') : $('#errormsg').removeClass('show').addClass('hide'); |
||||
}); |
||||
//输入框输入时模拟placeholder效果
|
||||
var oInput = $(".form-data input"); |
||||
oInput.focus(function () { |
||||
$(this).siblings("label").hide(); |
||||
}); |
||||
oInput.blur(function () { |
||||
if($(this).val()==""){ |
||||
$(this).siblings("label").show(); |
||||
} |
||||
}); |
@ -0,0 +1,31 @@ |
||||
/* |
||||
* ---------------------------------------------------------------------------- |
||||
* "THE BEER-WARE LICENSE" (Revision 42): |
||||
* <Martin@Revoltera.com> wrote this file. As long as you retain this notice, |
||||
* you can do whatever you want with this stuff. If we meet some day, and you |
||||
* think this stuff is worth it, you can buy me a beer in return. |
||||
* ---------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
(function($){$.fn.polygonizr=function(options){var defaults={restNodeMovements:1,duration:3,nodeMovementDistance:100,numberOfNodes:25,nodeDotSize:2.5,nodeEase:"easeOut",nodeFancyEntrance:!1,randomizePolygonMeshNetworkFormation:!0,specifyPolygonMeshNetworkFormation:function(i){var forEachNode={x:this.canvasWidth-((this.canvasWidth/2)+(this.canvasHeight/2)*Math.cos(i*(2*Math.PI/this.numberOfNodes)))*Math.random(),y:this.canvasHeight-(this.canvasHeight*(i/this.numberOfNodes))};return forEachNode},nodeRelations:3,animationFps:30,nodeDotColor:"240, 255, 250",nodeLineColor:"240, 255, 250",nodeFillColor:"240, 255, 250",nodeFillAlpha:0.5,nodeLineAlpha:0.5,nodeDotAlpha:1.0,nodeFillSapce:!0,nodeGlowing:!1,canvasWidth:$(this).width(),canvasHeight:$(this).height(),canvasPosition:"absolute"};var settings=$.extend({},defaults,options);return this.each(function(){var m_this=$(this);var canvasElement=document.createElement('canvas');canvasElement.width=settings.canvasWidth;canvasElement.height=settings.canvasHeight;canvasElement.style.position=settings.canvasPosition;m_this.append(canvasElement);var ctx=canvasElement.getContext('2d');var nodes=[];setupClusterNodes();startNodeAnimations();function setupClusterNodes(){for(var i=0;i<settings.numberOfNodes;i++){var currentNode={x:0,y:0};if(settings.randomizePolygonMeshNetworkFormation){currentNode.x=Math.random()*settings.canvasWidth;currentNode.y=Math.random()*settings.canvasHeight}else{currentNode=settings.specifyPolygonMeshNetworkFormation(i)} |
||||
nodes.push({currentX:currentNode.x,originX:currentNode.x,startX:currentNode.x,targetX:currentNode.x,currentY:currentNode.y,originY:currentNode.y,startY:currentNode.x,targetY:currentNode.y})} |
||||
for(var i=0;i<nodes.length;i++){var closest=[];var node=nodes[i];for(var j=0;j<nodes.length;j++){var tempNode=nodes[j];if(node!=tempNode){for(var k=0;k<settings.nodeRelations;k++){if(closest[k]==undefined){closest[k]=tempNode;break}if(getDistance(node,tempNode)<getDistance(node,closest[k])){closest[k]=tempNode;break}}}} |
||||
node.Closest=closest;setAlphaLevel(nodes[i])}} |
||||
function startNodeAnimations(){var animator=new Animator(settings.nodeEase,settings.animationFps,settings.duration,settings.restNodeMovements,settings.nodeFancyEntrance,draw);animator.start()} |
||||
const Constants={Animation:{EASING_LINEAR:"linear",EASING_EASEIN:"easeIn",EASING_EASEOUT:"easeOut",EASING_EASEINOUT:"easeInOut",EASING_ACCELERATE:"accelerateDecelerate",EASING_DESCENDING:"descendingEntrance"}};function Animator(easing,fps,duration,delay,fancyEntrance,callback){function step(timestamp){if(!m_startTime)m_startTime=timestamp;if(!m_lastFrameUpdate)m_lastFrameUpdate=timestamp;var currentFrame=Math.floor((timestamp-m_startTime)/(1000/fps));if(m_frameCount<currentFrame){m_frameCount=currentFrame;var currentDuration=timestamp-m_lastFrameUpdate;if(currentDuration<=m_duration){if(m_newTargetPossition){setNewTargetPossition();m_newTargetPossition=!1} |
||||
if(m_entranceSingleton&&fancyEntrance){setNewNodePossition(Constants.Animation.EASING_DESCENDING,currentDuration,m_duration)}else{setNewNodePossition(easing,currentDuration,m_duration)} |
||||
if(callback&&typeof(callback)==="function"){callback()}}else if(currentDuration>=(m_duration+m_delay)){m_lastFrameUpdate=timestamp;m_newTargetPossition=!0;m_entranceSingleton=!1}} |
||||
m_requestId=m_requestAnimationFrame(step)} |
||||
this.isRunning=!1;this.start=function(){if(!this.isRunning){this.isRunning=!0;m_duration=duration*1000;m_delay=delay*1000;m_requestId=m_requestAnimationFrame(step)}};this.pause=function(){if(this.isRunning){m_cancleAnimationFrame(m_requestId);this.isRunning=!1;m_startTime=null;m_frameCount=-1}};var m_requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;var m_cancleAnimationFrame=window.cancelAnimationFrame||window.mozCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame;var m_startTime=null;var m_frameCount=-1 |
||||
var m_requestId=null;var m_lastFrameUpdate=null;var m_newTargetPossition=!0;var m_entranceSingleton=!0;var m_duration;var m_delay} |
||||
function getEasing(easing,currentTime,startPossition,targetPossition,endTime){switch(easing){case Constants.Animation.EASING_LINEAR:return(targetPossition-startPossition)*(currentTime/endTime)+startPossition;break;case Constants.Animation.EASING_EASEIN:currentTime/=endTime;return(targetPossition-startPossition)*Math.pow(currentTime,2)+startPossition;case Constants.Animation.EASING_EASEOUT:currentTime/=endTime;return-(targetPossition-startPossition)*currentTime*(currentTime-2)+startPossition;case Constants.Animation.EASING_EASEINOUT:currentTime/=(endTime/2);if(currentTime<1)return(targetPossition-startPossition)/2*Math.pow(currentTime,2)+startPossition;return-(targetPossition-startPossition)/2*((currentTime-1)*((currentTime-1)-2)-1)+startPossition;break;case Constants.Animation.EASING_ACCELERATE:currentTime/=(endTime/2);if(currentTime<1)return(targetPossition-startPossition)/2*Math.pow(currentTime,3)+startPossition;return(targetPossition-startPossition)/2*(Math.pow(currentTime-2,3)+2)+startPossition;break;case Constants.Animation.EASING_DESCENDING:currentTime/=(endTime/2);if(currentTime<1)return(targetPossition-startPossition)/Math.pow(currentTime,3)+startPossition;return(targetPossition-startPossition)/(Math.pow(currentTime-2,3)+2)+startPossition;break;default:return getEasing(Constants.Animation.EASING_LINEAR,currentTime,startPossition,targetPossition,endTime)}} |
||||
function setNewNodePossition(easing,currentTime,endTime){for(var i in nodes){nodes[i].currentX=getEasing(easing,currentTime,nodes[i].startX,nodes[i].targetX,endTime);nodes[i].currentY=getEasing(easing,currentTime,nodes[i].startY,nodes[i].targetY,endTime)}} |
||||
function setNewTargetPossition(){for(var i in nodes){nodes[i].targetX=nodes[i].originX+(Math.random()<0.5?-Math.random():Math.random())*settings.nodeMovementDistance;nodes[i].targetY=nodes[i].originY+(Math.random()<0.5?-Math.random():Math.random())*settings.nodeMovementDistance;nodes[i].startX=nodes[i].currentX;nodes[i].startY=nodes[i].currentY}} |
||||
function setAlphaLevel(node){var screenDistance=Math.sqrt(Math.pow(settings.canvasWidth,2)+Math.pow(settings.canvasHeight,2));var nodeDistance=getDistance(node,node.Closest[0]);for(var i in node.Closest){nodeDistance+=getDistance(node.Closest[i],node.Closest[(i+1)%node.Closest.length])} |
||||
var generalAlpha=1-(nodeDistance/screenDistance);node.lineAlpha=generalAlpha*settings.nodeLineAlpha;node.dotAlpha=generalAlpha*settings.nodeDotAlpha;if(generalAlpha>0.85){node.fillAlpha=generalAlpha*settings.nodeFillAlpha;node.lineAlpha=settings.nodeLineAlpha;node.dotAlpha=settings.nodeDotAlpha}else if(generalAlpha<0.8&&generalAlpha>0.7){node.fillAlpha=0.5*generalAlpha*settings.nodeFillAlpha;node.lineAlpha=settings.nodeLineAlpha;node.dotAlpha=settings.nodeDotAlpha}else if(generalAlpha<0.7&&generalAlpha>0.4){node.fillAlpha=0.2*generalAlpha*settings.nodeFillAlpha}else{node.fillAlpha=0}} |
||||
function draw(){ctx.clearRect(0,0,settings.canvasWidth,settings.canvasHeight);for(var i in nodes){drawLines(nodes[i]);drawCircle(nodes[i])}} |
||||
function drawLines(node){if(!node.lineAlpha>0&&!node.fillAlpha>0)return;for(var i in node.Closest){if(node.lineAlpha>0){ctx.beginPath();ctx.moveTo(node.currentX,node.currentY);ctx.lineTo(node.Closest[i].currentX,node.Closest[i].currentY);ctx.strokeStyle='rgba('+settings.nodeLineColor+','+node.lineAlpha+')';ctx.stroke()} |
||||
if(settings.nodeFillSapce&&node.fillAlpha>0){ctx.beginPath();ctx.moveTo(node.currentX,node.currentY);ctx.lineTo(node.Closest[i].currentX,node.Closest[i].currentY);ctx.lineTo(node.Closest[(i+1)%node.Closest.length].currentX,node.Closest[(i+1)%node.Closest.length].currentY);ctx.fillStyle='rgba('+settings.nodeFillColor+','+node.fillAlpha+')';ctx.fill()}}} |
||||
function drawCircle(node){if(!node.dotAlpha>0)return;ctx.beginPath();ctx.arc(node.currentX,node.currentY,settings.nodeDotSize,0,Math.PI*2,!1);ctx.fillStyle='rgba('+settings.nodeDotColor+', '+node.dotAlpha+')';if(settings.nodeGlowing){ctx.shadowBlur=10;ctx.shadowColor='rgba('+settings.nodeDotColor+', '+node.dotAlpha+')'} |
||||
ctx.fill()} |
||||
function getDistance(firstNode,secondNode){return Math.sqrt(Math.pow(firstNode.currentX-secondNode.currentX,2)+Math.pow(firstNode.currentY-secondNode.currentY,2))}})}}(jQuery)) |
@ -0,0 +1,3 @@ |
||||
<?php |
||||
|
||||
echo json_encode(array(code=>0)); |
Loading…
Reference in new issue