Git-Host / php-fetion

Automatically exported from code.google.com/p/php-fetion
0 stars 0 forks source link

_getCsrfToken 方法的bug #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
一次登录,发送给多个好友时,只能第一个好友发送成功:

  $fetion = new PHPFetion($phone, $pwd);
  foreach ($receivers as $to){
    $re=$fetion->send($to, $msg); 
  }

原因是因为 _getCsrfToken 方法中的if ($this->_csrfToten === 
null)控制,当第1个号码发送后,$_csrfToten已经不为null,导致��
�第2个号码发消息时,直接引用了第1个号码产生的token,导致
发送失败

修改思路:
1、去掉if ($this->_csrfToten === null)的限制,每次都是重新获取
2、或者将$this->_csrfToten 
改为数组,保存每一个$uid对应的token值

Original issue reported on code.google.com by lingyey...@gmail.com on 28 Sep 2014 at 8:58