|
@@ -18,6 +18,7 @@
|
|
|
{{-- <script type="text/javascript" src="{{ theme_asset('gt/gt.handle.js') }}"></script>--}}
|
|
|
<script type="text/javascript" src="{{ theme_asset('jquery/jquery.min.js') }}"></script>
|
|
|
{{--<script type="text/javascript" src="{{ theme_asset('app/js/pad/qsToast.js') }}"></script>--}}
|
|
|
+<script src="https://captcha.253.com/TCaptcha.js"></script>
|
|
|
<script>
|
|
|
function qsToast(data) {
|
|
|
alert(data.context);
|
|
@@ -338,6 +339,52 @@
|
|
|
};
|
|
|
// gt_init(handler);
|
|
|
|
|
|
+ var mobile_captcha_flag = false;
|
|
|
+ var mobile_captcha_callback = function(res){
|
|
|
+
|
|
|
+ if(res.hasOwnProperty('errorMessage')){
|
|
|
+ alert(res.errorMessage)
|
|
|
+ }
|
|
|
+ console.log(res)
|
|
|
+ if(res.ret == 0){
|
|
|
+ mobile_captcha_flag = true;
|
|
|
+ console.log('行为验证通过');
|
|
|
+ $("#ticket1").val(res.ticket);
|
|
|
+ $("#bizState1").val(res.bizState);
|
|
|
+ $("#randstr1").val(res.randstr);
|
|
|
+ submit_data={
|
|
|
+ "mobile":$("input[name='mobile']").val(),
|
|
|
+ "type":"register",
|
|
|
+ "ticket": res.ticket,
|
|
|
+ "bizState": res.bizState,
|
|
|
+ "randstr": res.randstr
|
|
|
+ };
|
|
|
+ $.post('{{route('sms.send')}}',submit_data,function(data,status,xhr){
|
|
|
+ if(status == "success"){
|
|
|
+ $("#message_mobile").addClass("successinfo");
|
|
|
+ $("#message_mobile").text("发送成功,请注意查收");
|
|
|
+ settime();
|
|
|
+ }else{
|
|
|
+ if (data.status==422) {//验证错误
|
|
|
+ $.each(data.responseJSON.errors,function (key,val) {
|
|
|
+ $("#"+key).addClass("errinfo");
|
|
|
+ $("#"+key).text(val[0]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else if(data.status==400) {//业务错误
|
|
|
+ $("#message_mobile").addClass("errinfo");
|
|
|
+ $("#message_mobile").text(data.responseJSON.message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ console.log('用户主动关闭验证码')
|
|
|
+ }
|
|
|
+ console.log('callback:', res);
|
|
|
+ }
|
|
|
+
|
|
|
+ var mobile_captcha = new TencentCaptcha('196587903', mobile_captcha_callback, {});
|
|
|
$('#getVerfyCode').on('click', function () {
|
|
|
var mobileValue = $.trim($('input[name=mobile]').val());
|
|
|
if (mobileValue == '') {
|
|
@@ -345,7 +392,8 @@
|
|
|
qsToast({type:2,context: '请输入手机号'});
|
|
|
return false;
|
|
|
}
|
|
|
- toSetSms({});
|
|
|
+ mobile_captcha.show();
|
|
|
+ //toSetSms({});
|
|
|
|
|
|
});
|
|
|
|