~~~
/*这里:http://im.gamebridge.cn/index.php/api18sof1cop2care/Inde1check2token/index/softid/1/token/aw3/toke02/15211403840.65084300
通过~验证:SoftId号, toke01(相当于password),和toke02,判断是否合法请求(合法应用);
并且顺便判断toke02是否超时,超时的话…就提示超时;
需要重新取
http://im.gamebridge.cn/index.php/api18sof1cop2care/index/index/softid/1/token/aw3/expire/2018-01-01
去重新取 toke02!
*/
//http://im.gamebridge.cn/index.php/api18sof1cop2care/Inde1check2token/index/softid/1/token/aw3/toke02/15211403840.65084300
namespace app\api18sof1cop2care\controller;
use think\Db;
use think\Request;
class Inde1check2token//class Index
{
/**
* @var \think\Request Request实例
*/
protected $request;
/**
* 构造方法
* @param Request $request Request对象
* @access public
*/
public function __construct(Request $request)
{
$this->request = $request;
}
public function index()
{
$softid001= Db::name('a1soft1copy2care') -> where('soft01id',$this->request->param('softid') )
->where('toke01', $this->request->param('token'))//->where( time() ,'request->param('expire02unixtimestam'))
->where('toke02', $this->request->param('toke02') )
->find();
//dump($softid001);
if (empty($softid001) ) {echo 'false1'; return 'false';}//给定的参数:软件id和 token参数,如果找不到(或者不对),那么就出错(返回)
$now01time= strtotime(date('Y-d-m H:i:s')) ;
list($toke00time, $toke002)= explode( "." , $this->request->param('toke02') );
if ( ( $now01time- 3600) > $toke00time ) {echo 'toke02 out time!超时!'; return 'false';}
return 'true'.$toke00time;//sec1usec;;//true;
//return $this->request->param('n');
}//public function index()
}//class Index
~~~