mirror of
https://github.com/zyx0814/dzzoffice.git
synced 2025-04-04 22:33:37 +08:00
177 lines
7.9 KiB
HTML
177 lines
7.9 KiB
HTML
<div class="row mb-3" id="verify-type">
|
||
<label class="col-sm-2" for="chktype" required>验证方式</label>
|
||
<div class="col-sm-10">
|
||
<select name="chktype" id="chktype" class="form-select">
|
||
<!--{if $chkarr['emailstatus'] && $chkarr['email']}-->
|
||
<option value="email">$hideemail 验证</option>
|
||
<!--{/if}-->
|
||
<!--{if $chkarr['phonestatus'] && $chkarr['phone']}-->
|
||
<option value="phone">$hidephone 验证</option>
|
||
<!--{/if}-->
|
||
<!--{if !$chkarr['phonestatus'] && !$chkarr['emailstatus']}-->
|
||
<option value="pass">密码验证</option>
|
||
<!--{/if}-->
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div id="emailchk_show" class="showchktype" style="display:none;">
|
||
<dl>
|
||
<input type="button" class="btn btn-primary return_chk" value="发送验证邮件" onclick="chkemail_verify()">
|
||
</dl>
|
||
</div>
|
||
<div id="passchk_show" class="showchktype" style="display:none;">
|
||
<div class="row mb-3">
|
||
<label class="col-sm-2" for="chkpassword" required>密码</label>
|
||
<div class="col-sm-10">
|
||
<input type="password" name="chkpassword" class="form-control" autocomplete="off" id="chkpassword" placeholder="请输入密码">
|
||
<span id="chk_chkpassword" class="form-text"><span id="suc_chkpassword"></span> <kbd class="help-msg"></kbd> </span>
|
||
</div>
|
||
</div>
|
||
<div class="row mb-3" id="codeverify"{if $sessionerrornum > 2} style="display:block;"{else}style="display:none;"{/if}>
|
||
<!--{block sectpl}-->
|
||
<sec>
|
||
<sec>
|
||
<sec>
|
||
<!--{/block}-->
|
||
<div class="row mb-3">
|
||
<label class="col-sm-2">验证码</label>
|
||
<div class="col-sm-10">
|
||
<!--{template lyear:seccheck}-->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<dl class="mb-3 d-grid">
|
||
<input type="button" class="btn btn-primary return_chk" value="确定" onclick="pass_chk()">
|
||
</dl>
|
||
</div>
|
||
<div id="phonechk_show" class="showchktype" style="display:none;">
|
||
<div class="row mb-3">
|
||
<label class="col-sm-2" for="pcode" required>短信验证码</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" name="pcode" class="form-control" autocomplete="off" id="pcode" placeholder="请输入验证码">
|
||
<span id="chk_pcode" class="form-text"><span id="suc_pcode"></span> <kbd class="help-msg"></kbd> </span>
|
||
</div>
|
||
<dl>
|
||
<input type="button" class="btn btn-primary" value="获取验证码" onclick="get_pcode()"/>
|
||
</dl>
|
||
</div>
|
||
<dl class="mb-3 d-grid">
|
||
<input type="button" class="btn btn-primary return_chk" value="确定" onclick="pcode_chk()">
|
||
</dl>
|
||
</div>
|
||
<div class="conTent" id="email_sendmsg" style="display:none;">
|
||
<div class="success">
|
||
<span class="mdi mdi-check-bold"></span>
|
||
<span class="msgobj">验证邮件已发送</span>
|
||
</div>
|
||
<div class="theme">
|
||
<p><span class="msgobj">验证邮件</span>已发送至您的邮箱 <span class="phone"><a href="" id="return_email" target="_blank">1861111@163.com</a></span>,点击邮件中的链接完成操作。</p>
|
||
<p>验证邮件24小时内有效,请尽快验证。</p>
|
||
<p>邮件可能会进入推广邮件或垃圾邮件中,请注意查收。</p>
|
||
</div>
|
||
<div class="email">
|
||
<button type="button" class="btn btn-outline-primary" id="reffer_email">立即进入邮箱</button>
|
||
<span><span id="sendstart">已发送</span><span id="sendstatus" style="display:none;"><b class="time" id="down_time">3</b>秒后<span id="false_resend">重新发送</span><span id="resend_true" style="display:none"><input type="button" class="btn btn-outline-primary" value="重新发送" onclick="chkemail_verify()" ></span></span></span>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
var verifyresult = false;
|
||
jQuery('#chktype').change(function(){
|
||
var val = jQuery(this).val();
|
||
jQuery('.showchktype').hide();
|
||
jQuery("#"+val+"chk_show").show();
|
||
});
|
||
jQuery('#chktype').change();
|
||
function pass_chk(){
|
||
var val = jQuery('#chkpassword').val();
|
||
var chkcode = (jQuery("#codeverify").is(":visible"))?1:0;
|
||
var form = jQuery('#chkpassword').parents('form').get(0);
|
||
var seccode = form.seccodeverify.value ? form.seccodeverify.value:'';
|
||
var sech = form.sechash.value ? form.sechash.value:'';
|
||
var url = 'user.php?mod=profile&op=safeverify&do=chkpass&returnType=json';
|
||
jQuery.post(url,{chkpassword:val,chkcodeverify:chkcode,seccodeverify:seccode,sechash:sech},function(json){
|
||
if(json['success']){
|
||
jQuery('#chk_chkpassword .help-msg').html('');
|
||
verifyresult = true;
|
||
if(verifyresult){
|
||
safeverifystep(1);
|
||
}
|
||
}else if(json['error']){
|
||
if(json['codeerror']){
|
||
showmessage(json['error'],'danger',1000,1)
|
||
}else{
|
||
jQuery('#chk_chkpassword .help-msg').html(json['error']);
|
||
if(json['errornum'] > 2 && jQuery("#codeverify").is(":hidden")){
|
||
jQuery('#codeverify').show();
|
||
}
|
||
}
|
||
}
|
||
},'json');
|
||
return false;
|
||
}
|
||
function getEmailPath(email){
|
||
var hash={
|
||
'qq.com': 'http://mail.qq.com',
|
||
'gmail.com': 'http://mail.google.com',
|
||
'sina.com': 'http://mail.sina.com.cn',
|
||
'163.com': 'http://mail.163.com',
|
||
'126.com': 'http://mail.126.com',
|
||
'yeah.net': 'http://www.yeah.net/',
|
||
'sohu.com': 'http://mail.sohu.com/',
|
||
'tom.com': 'http://mail.tom.com/',
|
||
'sogou.com': 'http://mail.sogou.com/',
|
||
'139.com': 'http://mail.10086.cn/',
|
||
'hotmail.com': 'http://www.hotmail.com',
|
||
'live.com': 'http://login.live.com/',
|
||
'live.cn': 'http://login.live.cn/',
|
||
'live.com.cn': 'http://login.live.com.cn',
|
||
'189.com': 'http://webmail16.189.cn/webmail/',
|
||
'yahoo.com.cn': 'http://mail.cn.yahoo.com/',
|
||
'yahoo.cn': 'http://mail.cn.yahoo.com/',
|
||
'eyou.com': 'http://www.eyou.com/',
|
||
'21cn.com': 'http://mail.21cn.com/',
|
||
'188.com': 'http://www.188.com/',
|
||
'foxmail.coom': 'http://www.foxmail.com'
|
||
};
|
||
var url =email.split('@')[1];
|
||
var emailpath = hash[url];
|
||
return emailpath;
|
||
}
|
||
function chkemail_verify(){
|
||
jQuery('#sendstatus').hide();
|
||
jQuery('#down_time').html(3);
|
||
jQuery('#resend_true').hide();
|
||
jQuery('#sendstart').html('发送中,请稍后...');
|
||
var url = 'user.php?mod=profile&op=safeverify&do=chkemail&returnType=json';
|
||
jQuery.post(url,{email_verify:1},function(json){
|
||
if(json['success']){
|
||
jQuery('#emailchk_show').hide();
|
||
jQuery('#verify-type').hide();
|
||
jQuery('#sendstart').html('已发送');
|
||
jQuery('#sendstatus').show();
|
||
jQuery('#false_resend').show();
|
||
// jQuery('#emailform').hide();
|
||
jQuery('#email_sendmsg').show();
|
||
var path = getEmailPath(json['success']['email']);
|
||
jQuery('#return_email').html(json['success']['email']).attr('href',path);
|
||
jQuery('#reffer_email').click(function(){
|
||
window.location.href = path;
|
||
});
|
||
var sum = 3;
|
||
var timer = setInterval(function(){
|
||
if(sum <= 0) {
|
||
sum = 0;
|
||
jQuery('#false_resend').hide();
|
||
jQuery('#resend_true').show();
|
||
clearTimeout(timer);
|
||
}
|
||
jQuery('#down_time').html(sum);
|
||
sum--;
|
||
},1000);
|
||
}else if(json['error']){
|
||
showmessage(json['error'],'danger','3000',1);
|
||
}
|
||
},'json')
|
||
|
||
}
|
||
</script> |