作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !687
... ... @@ -10,6 +10,7 @@ use App\Models\User\User;
use App\Models\Visit\SyncSubmitTask;
use App\Services\CosService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redis;
class SelfSiteController extends BaseController
{
... ... @@ -47,13 +48,14 @@ class SelfSiteController extends BaseController
}
//判断token是否有效
// $cache_key = 'self_site_api_' . $pid . '_' . $token;
// $project_info = redis_get($cache_key);
// if ($project_info === null) {
$cache_key = 'self_site_api_' . $pid . '_' . $token;
$project_info = Redis::get($cache_key);
if ($project_info === null) {
$project_model = new Project();
$project_info = $project_model->read(['id' => $pid, 'site_token' => $token]);
// redis_set($cache_key, json_encode($project_info));
// }
Redis::set($cache_key, json_encode($project_info));
Redis::expire($cache_key, 3600);
}
if (!$project_info) {
return $this->error('token无效', 401);
... ...