Commit d5802c05 authored by hangjun83's avatar hangjun83

优化

parent 4c243b78
...@@ -71,13 +71,19 @@ class Authenticate ...@@ -71,13 +71,19 @@ class Authenticate
$params = $request->all(); $params = $request->all();
// 内部平台调用 // 内部平台调用
if(isset($params['platform']) && !empty($params['platform'])){ if(isset($params['platform']) && !empty($params['platform'])){
$platformToken = app(ThirdPlatformService::class)->checkPlatformToken($params['platform']); $thirdPlatformService = app(ThirdPlatformService::class);
$platformToken = $thirdPlatformService->checkPlatformToken($params['platform']);
/*switch($params['platform']){ /*switch($params['platform']){
case 'zkh' : $platformToken = app(ZhenKhService::class)->apiService->getPlatformInfo('platform_token');break; case 'zkh' : $platformToken = app(ZhenKhService::class)->apiService->getPlatformInfo('platform_token');break;
}*/ }*/
if(empty($platformToken) || $decodeToken['hash'] !== $platformToken){ if(empty($platformToken) || $decodeToken['hash'] !== $platformToken){
throw new UnauthorizedHttpException('JWTAuth','无效的平台token'); throw new UnauthorizedHttpException('JWTAuth','无效的平台token');
} }
//验证平台来源
$result = $thirdPlatformService->checkUrlFrom($request->root());
if(!$result){
throw new UnauthorizedHttpException('JWTAuth','非法请求域名');
}
} }
else{ else{
if($decodeToken['expire'] < time()) if($decodeToken['expire'] < time())
......
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