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.
40 lines
1.1 KiB
PHTML
40 lines
1.1 KiB
PHTML
5 years ago
|
<?php
|
||
|
|
||
5 years ago
|
namespace Sdk\Controller;
|
||
5 years ago
|
|
||
|
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 = [
|
||
5 years ago
|
'ResultCode' => 2002,
|
||
5 years ago
|
'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);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|