Changeset 2586935
- Timestamp:
- 08/23/2021 08:46:38 AM (5 years ago)
- Location:
- vaptcha-sms/trunk
- Files:
-
- 2 edited
-
VaptchaSmsPlugin.php (modified) (4 diffs)
-
js/sms.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vaptcha-sms/trunk/VaptchaSmsPlugin.php
r2557559 r2586935 560 560 public function load_sms_js() 561 561 { 562 wp_register_script('vaptcha_sms_js', plugins_url('js/sms.js', __FILE__), array('jquery'), ' 1.1', true);562 wp_register_script('vaptcha_sms_js', plugins_url('js/sms.js', __FILE__), array('jquery'), '3.3.2', true); 563 563 wp_enqueue_script('vaptcha_sms_js'); 564 564 565 wp_register_script('vaptcha_v3_js', 'https://v-na.vaptcha.com/v3.js', array('jquery'), ' 1.1', true);565 wp_register_script('vaptcha_v3_js', 'https://v-na.vaptcha.com/v3.js', array('jquery'), '3.3.2', true); 566 566 wp_enqueue_script('vaptcha_v3_js'); 567 567 } … … 685 685 wp_send_json_error(array('code' => 444, 'msg' => '人机验证未通过')); 686 686 } 687 $url = 'https://auth.vaptcha.com/api/v1/device?id=' . $phone . '&token=' . $token . '&renewal=1';687 $url = $server.'/device?id=' . $phone . '&token=' . $token . '&renewal=1'; 688 688 $response = wp_remote_get($url); 689 689 … … 702 702 $vcode = sanitize_text_field($_POST['code']); 703 703 $token = sanitize_text_field($_POST['token']); 704 $server = sanitize_text_field($_POST['server']); 704 705 // $server = sanitize_text_field($_POST['server']); 705 706 //通过手机号查找用户 … … 726 727 $data = array( 727 728 'id' => $phone, 728 'token' => $token 729 'token' => $token, 730 'regedit' => 0 729 731 ); 730 $url = 'https://auth.vaptcha.com/api/v1/device';732 $url = $server.'/device'; 731 733 $args = array( 732 734 'method' => 'PUT', 733 'body' => $data,735 'body' => json_encode($data), 734 736 'timeout' => '5', 735 737 'redirection' => '5', -
vaptcha-sms/trunk/js/sms.js
r2557559 r2586935 92 92 }) 93 93 94 var smsToken = '';94 var smsTokenServer = ''; 95 95 //发送验证码 96 96 function sendSmsCode(token, key) { … … 110 110 success: function (res) { 111 111 if (res.data === 200) { 112 smsToken = token.token112 smsTokenServer = token 113 113 key === 'register' ? sendCountdown() : loginSendCountdown() 114 114 } else { … … 239 239 action: 'add_device', 240 240 phone: $('#user_phone').val(), 241 token: token, 241 token: token.token, 242 server:token.server, 242 243 smsid: smsid, 243 244 code: $('#sms_code').val() … … 346 347 $('#sms_login_button').click(function () { 347 348 operaticon = 'smsLogin'; 348 addDevice(smsToken )349 addDevice(smsTokenServer) 349 350 // obj.validate() 350 351 })
Note: See TracChangeset
for help on using the changeset viewer.