Commit c68775ff authored by hangjun83's avatar hangjun83

优化

parent 163abfad
......@@ -71,9 +71,10 @@ class Authenticate
$params = $request->all();
// 内部平台调用
if(isset($params['platform']) && !empty($params['platform'])){
switch($params['platform']){
$platformToken = app(ThirdPlatformService::class)->checkPlatformToken($params['platform']);
/*switch($params['platform']){
case 'zkh' : $platformToken = app(ZhenKhService::class)->apiService->getPlatformInfo('platform_token');break;
}
}*/
if(empty($platformToken) || $decodeToken['hash'] !== $platformToken){
throw new UnauthorizedHttpException('JWTAuth','无效的平台token');
}
......
......@@ -18,12 +18,7 @@ class ThirdPlatformService extends PlatformAbstractService
public function checkPlatformToken($platformName)
{
$this->setPlatformName($platformName);
$platform = $this->thirdApiPlatformRepository->getPlatformInfoByPlatformName($this->platformName);
if(!$platform){
return null;
}
$platform['platform_params'] = json_decode($platform['platform_params'], true);
$this->platformInfo = $platform;
$platform = $this->getPlatformInfo('platform_token');
return $platform;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment