我有一个- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return YES;
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
shouldReceiveTouch:(UITouch *)touch {
return YES;
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
shouldReceivePress:(UIPress *)press {
return YES;
}
方法,我必须向sendOtp()
方法发送otp
用于更改密码的方法
我想将changePassword()
从$otp
返回到sendOtp()
changePassword()
方法
sendOtp
public function sendOtp($user_phone_number)
{
$otp = mt_rand(100000, 999999);
//sms login
$data = [
'data' => [
'otp' => $otp
]
];
return Response::json(
$data_with_status = array_merge($this->respondSuccess('otp sent'), $data)
);
}
方法
changePassword()
谢谢
答案 0 :(得分:1)
您可以通过以下代码收到otp
:
public function changePasswordOtp($user_phone_number)
{
$user = User::where('phone_number', '=', $user_phone_number)->count();
if($user > 0) {
$result_otp = $this->sendOtp($user_phone_number);
$result_otp = json_decode($result_otp ,true);
$otp = $result_otp['data']['otp']; //return response with sent otp
}
else {
return Response::json(
$this->respondFailure('User not found')
);
}
}
答案 1 :(得分:0)
像这样更改sendOtp
:
public function sendOtp($user_phone_number)
{
$otp = mt_rand(100000, 999999);
//sms login
$data = [
'data' => [
'otp' => $otp
]
];
$responseMessage= $this->respondSuccess();
$responseArray = array_merge(responseMessage, data);
return Response::json($responseArray);
);
}