修正退出登录
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Amqp\Producer\PrescriptionDistributePhProducer;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Model\DoctorInquiryTime;
|
||||
use App\Model\DoctorPharmacistCert;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Request\UserRequest;
|
||||
@@ -297,5 +298,56 @@ class UserController extends AbstractController
|
||||
//
|
||||
// $RecentContact = new RecentContact();
|
||||
// $result = $RecentContact->getRecentContactPage();
|
||||
|
||||
|
||||
|
||||
|
||||
$ca = new Ca();
|
||||
|
||||
// 获取云证书
|
||||
$data = array();
|
||||
$data['user_id'] = "491925054435950592";
|
||||
$data['card_num'] = "410323199603261241";
|
||||
$result = $ca->getCloudCert($data);
|
||||
|
||||
$data = array();
|
||||
$data['user_id'] = "491925054435950592";
|
||||
$data['cert_base64'] = $result['certBase64'];
|
||||
$data['cert_chain_p7'] = $result['certP7'];
|
||||
$data['cert_serial_number'] = $result['certSerialnumber'];
|
||||
$data['ca_pin'] = "491925054435950592";
|
||||
$doctor_pharmacist_cert = DoctorPharmacistCert::addDoctorPharmacistCert($data);
|
||||
if (empty($doctor_pharmacist_cert)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 获取用户云证书数据
|
||||
$params = array();
|
||||
$params['user_id'] = "491925054435950592";
|
||||
$doctor_pharmacist_cert = DoctorPharmacistCert::getOne($params);
|
||||
if (empty($doctor_pharmacist_cert)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"用户数据错误");
|
||||
}
|
||||
|
||||
// 获取云证书签名
|
||||
$data = array();
|
||||
$data['created_at'] = date('Y-m-d H:i:s',time());
|
||||
$data['department_custom_name'] = "外科";
|
||||
$data['user_name'] = "测试用户1";
|
||||
$data['sex'] = "男";
|
||||
$data['age'] = 19;
|
||||
$data['allergy_history'] = "无";
|
||||
$data['icd_name'] = "感冒";
|
||||
$data['doctor_advice'] = "多吃药";
|
||||
$data['product'] = [
|
||||
[
|
||||
"product_name" => "感冒药",
|
||||
"product_name" => "感冒药",
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
$result = $ca->getCertSign($data);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -66,4 +66,14 @@ class DoctorPharmacistCert extends Model
|
||||
{
|
||||
return self::where($params)->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param array $data
|
||||
* @return \Hyperf\Database\Model\Model|DoctorPharmacistCert
|
||||
*/
|
||||
public static function addDoctorPharmacistCert(array $data = []): \Hyperf\Database\Model\Model|DoctorPharmacistCert
|
||||
{
|
||||
return self::create($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,11 +254,14 @@ class UserService extends BaseService
|
||||
}
|
||||
|
||||
$token = explode(' ', $bearer_token[0]);
|
||||
if (!isset($token[1])){
|
||||
return fail();
|
||||
}
|
||||
|
||||
$redis = $this->container->get(Redis::class);
|
||||
|
||||
// 旧token加入黑名单 5天有效期,5天内,无法继续进行访问
|
||||
$res = $redis->set('jwt_black_' . $token, time(), 60*60*24*5);
|
||||
$res = $redis->set('jwt_black_' . $token[1], time(), 60*60*24*5);
|
||||
if (!$res) {
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user