|
@@ -27,6 +27,14 @@ class CompanyAuth
|
|
|
$diff = time() - $timestamp;
|
|
|
if ($diff < SysConsts::ONE_MINUTE_SECONDS * 60) {
|
|
|
$config = $service->findCompanyAuthConfig($params['app_id']);
|
|
|
+
|
|
|
+ // 检查channel_id所属appid
|
|
|
+ $channel_ids = $service->findCompanyChannelIds($config->company_id); // 获取该公司下的所有渠道ID
|
|
|
+ $request_channel_id = $request->get('channel_id', '');
|
|
|
+ if ($request_channel_id && !in_array($request_channel_id, $channel_ids)) {
|
|
|
+ return response()->error('CHANNEL_AUTH_INVALID');
|
|
|
+ }
|
|
|
+
|
|
|
if (isset($params['sign']) && strcasecmp(CommonHelper::sign($params, $config->app_secret), $params['sign']) == 0) {
|
|
|
$this->setGlobalConfig($config);
|
|
|
return $next($request);
|