Commit bda5d515 authored by hj's avatar hj

更新提交

parent 172bc6ae
......@@ -113,4 +113,19 @@ abstract class Controller extends BaseController
$urls = explode('/',app()->request->url);
return array_values(array_filter($urls));
}
protected function checkCustomerType($customerCode,$type)
{
$customer = app(CustomerService::class)->getPlatformCustomer(['cus_number' => $customerCode, 'cus_type' => $type]);
if($customer){
if($customer['cus_type'] != $type){
switch($type){
case 'bh' : $this->returnErrorExecptionResponse(new AuthenticationException('不是百化用户,无法访问该类型接口'));break;
case 'rhawn' : $this->returnErrorExecptionResponse(new AuthenticationException('不是罗恩用户,无法访问该类型接口'));break;
case 'chemsite' : $this->returnErrorExecptionResponse(new AuthenticationException('不是chemsite用户,无法访问该类型接口'));break;
default : $this->returnErrorExecptionResponse(new AuthenticationException('用户类型未知'));
}
}
}
}
}
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