/* 鐢ㄦ埛鐭俊鐧诲綍 */
function usersmslogin(mobile,smscode){
var url="https://www.dbihelper.cn/linkdb?"+Math.random();;
var where={appid:appid,appkey:appkey,
sqlid:"usermobile;smsfind;usersmslogin",
mobile:mobile,smscode:smscode,smstype:"login",
deviceid:api.deviceId,devicename:api.deviceModel};
jquery.ajax({url:url,method:"post",data:{values:where}},
function(res,err){
if("y"==res.ok){
if(res.usersmsloginlist.length==1){
tishimsg("鐭俊鐧诲綍鎴愬姛锛宻ys.userid閫氳繃sys.sessionid鑷姩鑾峰彇");
}else if(res.usermobilelist.length==0){
tishimsg("鎵嬫満鍙锋湭娉ㄥ唽");
}else if(res.smsfindlist.length==0){
tishimsg("鎵嬫満鍙锋棤鐧诲綍鐭俊");
}else if(res.smsfindlist.length==1){
if("0"==res.smsfindlist[0].smscodeok){ tishimsg("鐭俊楠岃瘉鐮侀敊璇?); }
else if("0"==res.smsfindlist[0].smsflagok){ tishimsg("鐭俊宸插け鏁?); }
}
}else{tishimsg(res.msg);}
});
};
/* 鍙戦€佺煭淇?*/
var smstime=60;
function smssend(mobile,smstype){/* 鍙戦€佺煭淇?*/
if(60==smstime){
/* 鐭俊鍐呭锛氥€怉PIBase銆戞浛appname锛屽彂鐭俊楠岃瘉鐮侊細smscode锛岃鍕挎硠闇诧紝宸ヤ綔浜哄憳涓嶄細鍚戜綘绱㈣銆? */
var url="https://www.dbihelper.cn/sendsms?"+Math.random();;
var where={appid:appid,appkey:appkey,mobile:mobile,smstype:smstype };
jquery.ajax({url:url,method:"post",data:{values:where}},
function(res,err){
if("y"==res.ok){
smssendtime();
tishimsg("鐭俊鍙戦€佹垚鍔?);
}else{tishimsg(res.msg);}
});
}else{ tishimsg("璇?+smstime+"绉掑悗鍙戦€佺煭淇?); }
}
function smssendtime(){/* 鍙戦€佺煭淇¤鏃剁 */
smstime=parseInt(smstime)-1;
if(smstime==0){smstime=60;return;}
setTimeout(function(){smssendtime();},"1000");
}
聽
聽
浜戞暟鎹簱鎺ュ彛SQL鍐呭鎻愪緵涓嬭浇
涓嬭浇鏇村鏂囨。璇疯闂甴ttps://apibase.cn/api.jsp
浜戞暟鎹簱鎺ュ彛鍦板潃锛歨ttps://www.dbihelper.cn/linkdb | 聽 |
create table mysql.user_info( userid varchar(30) not null comment '鐢ㄦ埛涓婚敭' , usname varchar(255) null comment '鐢ㄦ埛鍖垮悕', mobile varchar(255) null comment '鎵嬫満鍙?, loginpwd varchar(255) null comment '鐧诲綍瀵嗙爜', deviceid varchar(255) null comment '璁惧鍙?, devicename varchar(255) null comment '璁惧鍚嶇О', logintime datetime null comment '鐧诲綍鏃堕棿', loginnum int null comment '鐧诲綍娆℃暟', loginip varchar(255) null comment '鐧诲綍IP', primary key(userid) ) charset=gbk comment='鐢ㄦ埛琛? | |
鏌ヨ鐢ㄦ埛鎵嬫満鍙锋帴鍙o紝sqlid锛歶sermobile SQL璇彞锛歴elect mobile from mysql.user_info where mobile='[mobile]' | |
鎻掑叆鐭俊鎺ュ彛(姝e紡鐜涓嶉渶瑕?锛宻qlid锛歴msinsert SQL璇彞锛歩nsert into mysql.sys_sms_log(logid,mobile,smscode,smstype,createtime,usems,flag,ip) values('[sys.id]','[mobile]','[smscode]','[smstype]','[sys.time]','1','y','[sys.ip]') | |
鏌ヨ鐭俊楠岃瘉鐮佹帴鍙o紝sqlid锛歴msfind SQL璇彞锛歴elect smscode='[smscode]' smscodeok,flag='y' smsflagok from mysql.sys_sms_log where mobile='[mobile]' and smstype='[smstype]' | |
鐢ㄦ埛鐭俊鐧诲綍鎺ュ彛锛宻qlid锛歶sersmslogin SQL璇彞锛歴elect userid,mobile,deviceid,devicename,logintime from mysql.user_info where mobile='[mobile]' and 1<=(select count(1) from mysql.sys_sms_log where smstype='[smstype]' and mobile='[mobile]' and smscode='[smscode]' and flag='y'); update mysql.user_info set logintime=now(),loginnum=loginnum+1,loginip='[sys.ip]' where mobile='[mobile]' and 1<=(select count(1) from mysql.sys_sms_log where smstype='[smstype]' and mobile='[mobile]' and smscode='[smscode]' and flag='y'); update mysql.sys_sms_log set flag='n' where smstype='[smstype]' and mobile='[mobile]' and smscode='[smscode]' and flag='y'; | |
鐢ㄦ埛淇℃伅鏌ヨ鎺ュ彛锛宻qlid锛歶serselect SQL璇彞锛歴elect userid,usname,mobile,deviceid,devicename,logintime,loginnum,loginip from mysql.user_info where usname like? '%[usname]%' and mobilelike? '%[mobile]%' order by [orderby] | |
鐢ㄦ埛鐭俊娉ㄥ唽鎺ュ彛锛宻qlid锛歶serselect insert into mysql.user_info(userid,mobile,deviceid,devicename,logintime) select * from ( select '[sys.id]','[mobile]' mobile,'[deviceid]','[devicename]','[sys.time]' ) s聽 where mobile not in (select mobile from mysql.user_info ) and 1=(select count(1) from mysql.sys_sms_log where smstype='[smstype]' and mobile='[mobile]' and smscode='[smscode]' and flag='y'); update mysql.sys_sms_log set flag='n' where smstype='[smstype]' and mobile='[mobile]' and smscode='[smscode]' and flag='y'; | |
鐢ㄦ埛鍒犻櫎鎺ュ彛(姝e紡鐜涓嶉渶瑕?锛宻qlid锛歶serdelete SQL璇彞锛歞elete from mysql.user_info where mobile='[mobile]' |
瀹㈡湇QQ锛?968629178
apibase.cn鎻愪緵
聽
聽
聽