初始化代码
This commit is contained in:
22
application/api/controller/BaseCom.php
Normal file
22
application/api/controller/BaseCom.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\App;
|
||||
use think\Controller;
|
||||
|
||||
|
||||
class BaseCom extends Controller
|
||||
{
|
||||
|
||||
protected function initialize()
|
||||
{
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
$timestamp = request()->header('timestamp', 0);
|
||||
$app_sign = request()->header('app-sign');
|
||||
$result = validate_sign($app_sign, $timestamp); //验证签名是否合法
|
||||
if($result['code'] != 200) {
|
||||
// return ajaxReturn($result['code'], $result['msg'], $result['data']);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user