| xqd
@@ -245,12 +245,19 @@ class AuthController extends Controller
|
|
|
public function forgetPassword(Request $request)
|
|
|
{
|
|
|
$account = $request->input('account', '');
|
|
|
+ $captcha = $request->input('captcha', '');
|
|
|
+ $captcha_key = $request->input('captcha_key','');
|
|
|
$validator = Validator::make($request->all(), [
|
|
|
'account' => 'required',
|
|
|
+ 'captcha' => 'required',
|
|
|
+ 'captcha_key' => 'required',
|
|
|
]);
|
|
|
if ($validator->fails()) {
|
|
|
return $this->error($validator->errors()->first());
|
|
|
}
|
|
|
+ if(!captcha_api_check($captcha,$captcha_key)){
|
|
|
+ return $this->error("图形验证码错误!");
|
|
|
+ }
|
|
|
// 查询用户是否存在
|
|
|
$user = User::query()
|
|
|
->where('account','=',$account)
|
| xqd
@@ -277,12 +284,19 @@ class AuthController extends Controller
|
|
|
public function findId(Request $request)
|
|
|
{
|
|
|
$email = $request->input('email', '');
|
|
|
+ $captcha = $request->input('captcha', '');
|
|
|
+ $captcha_key = $request->input('captcha_key','');
|
|
|
$validator = Validator::make($request->all(), [
|
|
|
+ 'captcha' => 'required',
|
|
|
+ 'captcha_key' => 'required',
|
|
|
'email' => 'required',
|
|
|
]);
|
|
|
if ($validator->fails()) {
|
|
|
return $this->error($validator->errors()->first());
|
|
|
}
|
|
|
+ if(!captcha_api_check($captcha,$captcha_key)){
|
|
|
+ return $this->error("图形验证码错误!");
|
|
|
+ }
|
|
|
// 查询用户是否存在
|
|
|
$user = User::query()
|
|
|
->where('email','=',$email)
|