You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
986 B
PHP
40 lines
986 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\H5;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use App\Lib\Rs;
|
|
use App\Services\PatientAuthService;
|
|
|
|
class AuthController extends Controller
|
|
{
|
|
private PatientAuthService $patientAuthService;
|
|
|
|
public function __construct(PatientAuthService $patientAuthService)
|
|
{
|
|
$this->patientAuthService = $patientAuthService;
|
|
}
|
|
|
|
/**
|
|
* 患者登录
|
|
* POST /api/h5/login
|
|
*/
|
|
public function login(Request $request)
|
|
{
|
|
$idCardNo = $request->input('patient_id_card_no');
|
|
$name = $request->input('patient_name');
|
|
|
|
if (empty($idCardNo) || empty($name)) {
|
|
return Rs::error('请提供身份证号和姓名');
|
|
}
|
|
|
|
$result = $this->patientAuthService->login($idCardNo, $name);
|
|
|
|
if ($result['success']) {
|
|
return Rs::success($result['data'], $result['message']);
|
|
}
|
|
return Rs::error($result['message']);
|
|
}
|
|
}
|