You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jy-sdk/Application/Sdk/Controller/GetInfoBaseController.class...

40 lines
1.1 KiB
PHTML

2 years ago
<?php
namespace Sdk\Controller;
use Think\Controller;
class GetInfoBaseController extends Controller
{
public function _initialize()
{
$data = I('param.');
if (empty($data['time_stamp']) || time() - 60 * 10 > $data['time_stamp']) {
$result = [
'ResultCode' => 2002,
'ResultMessage' => "链接已过期",
'Data' => 'null',
];
return $this->ajaxReturn($result);
} else {
$sign = $data['sign'];
unset($data['sign']);
ksort($data);
reset($data);
$str = "";
foreach ($data as $k => $v) {
$str = $str . $k . "=" . $v;
}
$str = $str . 'key=' . C('GET_INFO_KEY');
if (md5($str) != $sign) {
$result = [
'ResultCode' => 2001,
'ResultMessage' => "参数错误",
'Data' => 'null',
];
return $this->ajaxReturn($result);
}
}
}
}