热搜词
发表于 2024-6-21 14:27:08 | 显示全部楼层 |阅读模式
Discuz! X3.5( dzx3.5)安装“蒲宁手机注册登陆 7.8.4 (pn_register)”插件后,用户进入设置->密码安全,点“手机验证码”的“发送”按钮时,提示“短信网关异常,请稍候再试。”

短信网关异常.png

解决方法:
打开 /source/plugin/pn_register/smsgw/smsgw_dxb.php 文件,查找如下代码:
  1.   $smsinfo = array(
  2.                         'username' => $_G['cache']['plugin']['pn_register']['username'],
  3.                         'apikey' => $_G['cache']['plugin']['pn_register']['apikey'],
  4.                         'mobile' => urlencode($mobile),
  5.                         'content' => urlencode($content),
  6.                 );

  7.                 $url = $endpoint . $operation . '?u=' . $smsinfo['username'] . '&p=' . $smsinfo['apikey'] . '&m=' . $smsinfo['mobile'] . '&c=' . $smsinfo['content'];

  8.                 $params = array(
  9.                         'url' => $url,
  10.                         'method' => 'GET'
  11.                 );

  12.                 $client = filesock::open($params);
  13.                 $data = $client->request();
  14.                 if(!$data) {
  15.                         $data = $client->filesockbody;
  16.                 }

  17.                 $result = json_decode($data);
复制代码
替换为:
  1.   $smsinfo = array(
  2.                         'username' => $_G['cache']['plugin']['pn_register']['dxb_username'],
  3.                         'apikey' => md5($_G['cache']['plugin']['pn_register']['dxb_apikey']),
  4.                         'mobile' => urlencode($mobile),
  5.                         'content' => urlencode($content),
  6.                 );

  7.                 $url = $endpoint . $operation . '?u=' . $smsinfo['username'] . '&p=' . $smsinfo['apikey'] . '&m=' . $smsinfo['mobile'] . '&c=' . $smsinfo['content'];
  8.                
  9.                 $result =file_get_contents($url) ;
复制代码


全部评论0
回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|管理员之家 ( 苏ICP备2023053177号-2 )

GMT+8, 2024-10-18 14:40 , Processed in 0.166052 second(s), 26 queries .

Powered by Discuz! X3.5

Cpoyright © 2001-2024 Discuz! Team