1
This commit is contained in:
parent
16f68e65b5
commit
cb782ed4e2
@ -266,8 +266,8 @@ class UserController extends AbstractController
|
||||
|
||||
$Ca = new Ca();
|
||||
$data = array();
|
||||
$data['user_id'] = "123456";
|
||||
$data['card_num'] = "372929199610075412";
|
||||
$data['user_id'] = "111295";
|
||||
$data['card_num'] = "410323199603261236";
|
||||
|
||||
$result = $Ca->getCloudCert($data);
|
||||
dump($result);
|
||||
|
||||
@ -8,6 +8,7 @@ use App\Model\DoctorExpertise;
|
||||
use App\Model\DoctorIdenFail;
|
||||
use App\Model\Hospital;
|
||||
use App\Model\HospitalDepartmentCustom;
|
||||
use App\Model\User;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserDoctorInfo;
|
||||
use App\Utils\Mask;
|
||||
@ -173,8 +174,6 @@ class DoctorAuthService extends BaseService
|
||||
// 修改医生实名认证状态
|
||||
$data = array();
|
||||
$data['idcard_status'] = 1;
|
||||
$data['age'] = $age;
|
||||
$data['sex'] = $sex;
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
@ -184,6 +183,17 @@ class DoctorAuthService extends BaseService
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data['age'] = $age;
|
||||
$data['sex'] = $sex;
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$res = User::editUser($params, $data);
|
||||
if (!$res) {
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
|
||||
@ -33,12 +33,13 @@ class Ca
|
||||
'entityId' => $data['user_id'], // 用户唯一标识,由业务系统定义
|
||||
'entityType' => "Personal",// 用户类型,可选值[Personal/Organizational]
|
||||
'pin' => $data['user_id'], // 证书PIN码
|
||||
// 'pin' => "123", // 证书PIN码
|
||||
'cardNumber' => $data['card_num'], // 证件号码(个人身份证;企业统一社会信用代码)
|
||||
]
|
||||
];
|
||||
|
||||
try {
|
||||
$response = $this->httpRequest(config("ca.api_url") . '/cloud-certificate-service' . '/api/cloudCert/open/V2/cert/offlineAuthCertEnroll', $option);
|
||||
$response = $this->httpRequest(config("ca.api_url") . '/cloud-certificate-service' . '/api/cloudCert/open/v2/cert/offlineAuthCertEnroll', $option);
|
||||
if (empty($response)){
|
||||
// 返回值为空
|
||||
throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR));
|
||||
@ -57,6 +58,8 @@ class Ca
|
||||
*/
|
||||
protected function getSign(array $data): string
|
||||
{
|
||||
ksort($data['form_params']);
|
||||
|
||||
$data = implode('&',$data['form_params']);
|
||||
return hash_hmac("sha1",$data,config("ca.secret"));
|
||||
}
|
||||
@ -79,18 +82,15 @@ class Ca
|
||||
];
|
||||
|
||||
$arg = array_merge($arg,$option);
|
||||
|
||||
dump($path);die;
|
||||
dump($arg);die;
|
||||
dump($arg);
|
||||
dump($path);
|
||||
$response = $this->client->post($path, $arg);
|
||||
dump(1);
|
||||
if ($response->getStatusCode() != '200'){
|
||||
// 请求失败
|
||||
throw new BusinessException($response->getBody()->getContents());
|
||||
}
|
||||
dump(2);
|
||||
$body = json_decode($response->getBody(),true);
|
||||
dump($body);die;
|
||||
dump($body);
|
||||
if (empty($body)){
|
||||
// 返回值为空
|
||||
throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user