|
@@ -145,10 +145,11 @@ class AuthService
|
|
|
{
|
|
|
$data = Cache::pull($token);
|
|
|
if ($data['utype'] == 1) {
|
|
|
- $this->companyRepository->resetPassword($data['type'], $data[$data['type']], $password);
|
|
|
+ $user = $this->companyRepository->resetPassword($data['type'], $data[$data['type']], $password);
|
|
|
} elseif ($data['utype'] == 2) {
|
|
|
- $this->memberRepository->resetPassword($data['type'], $data[$data['type']], $password);
|
|
|
+ $user = $this->memberRepository->resetPassword($data['type'], $data[$data['type']], $password);
|
|
|
}
|
|
|
+ $this->memberLogRepository->createLog($user, 2045, []);
|
|
|
return $data['utype'];
|
|
|
}
|
|
|
|
|
@@ -289,6 +290,26 @@ class AuthService
|
|
|
return $user;
|
|
|
}
|
|
|
|
|
|
+ public function checkPwdLog($user)
|
|
|
+ {
|
|
|
+ $pwdLog = $this->memberLogRepository->getMemberLog(
|
|
|
+ $user->id,
|
|
|
+ $user->utype,
|
|
|
+ 2045
|
|
|
+ );
|
|
|
+ if(count($pwdLog) >= 1){
|
|
|
+ $log = array_shift($pwdLog);
|
|
|
+ $time = strtotime($log->created_at);
|
|
|
+ }else{
|
|
|
+ $time = 0;
|
|
|
+ }
|
|
|
+ if((time()-$time)>7776000){
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function login($user, $isAutoLogin = 0)
|
|
|
{
|
|
|
$isAutoLogin = $isAutoLogin ? true : false;
|