This commit is contained in:
pomjay
2025-06-25 09:35:09 +08:00
parent 81a95f47a0
commit 7e3eba92e2
16 changed files with 154 additions and 44 deletions

View File

@ -29,7 +29,7 @@ abstract class BaseController extends Controller
function error($msg = 'error', $data = []): \Illuminate\Http\JsonResponse
{
ReplyService::error($msg, $data);
return ReplyService::error($msg, $data);
}
}

View File

@ -49,6 +49,7 @@ class CustomerUserController extends CustomerBaseController
{
$oAuthService = new AuthService();
$token = $oAuthService->getTokenFromReq();
var_dump($token);
$aUser = $oAuthService->getCurrentUser();
$data = [
'token' => $token,
@ -102,8 +103,8 @@ class CustomerUserController extends CustomerBaseController
$oAuthService = new AuthService();
$oImService = new ImService();
$token = $oAuthService->createTokenToUser($oUser->id, $device);
$imToken = $oImService->authUserToken($oUser->id, $device);
$imToken = "test";
//$imToken = $oImService->authUserToken($oUser->id, $device);
$data = [
'token' => $token,
'im_token' => $imToken,
@ -157,7 +158,7 @@ class CustomerUserController extends CustomerBaseController
$password = $request->input('password');
$device = $request->input('device');
$sVrCode = $request->input('vr_code');
var_dump($sVrCode);
//check vrcode
$oVrCodeService = new VrCodeService();
@ -186,7 +187,8 @@ class CustomerUserController extends CustomerBaseController
//向im注册
$oImService = new ImService();
if (!$oImService->userUserRegister($oUser->id)) throw new AppException('im register error');
//暂时不注册
// if (!$oImService->userUserRegister($oUser->id)) throw new AppException('im register error');
$oAuthService = new AuthService();
$token = $oAuthService->createTokenToUser($oUser->id, $device);

View File

@ -40,7 +40,7 @@ class SmsController extends CustomerBaseController
$validator = Validator::make($aReqData, [
'phone_area' => 'required|alpha_dash:ascii|max:5',
'phone' => 'required|numeric|max:15',
'phone' => 'required|digits_between:6,15',
]);
if ($validator->fails()) {
return $this->error($validator->errors()->first());