Ver código fonte

增加密码过期机制

sandm 3 anos atrás
pai
commit
2ac0cfcd6f
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      app/Services/Auth/AuthService.php

+ 4 - 2
app/Services/Auth/AuthService.php

@@ -300,12 +300,14 @@ class AuthService
             $user->utype,
             2045
         );
-        if(count($pwdLog) >= 1){
-            $log = reset($pwdLog);
+        $data = $pwdLog->toArray()['data'];
+        if(count($data) >= 1){
+            $log = array_shift($data);
             $time = strtotime($log['created_at']);
         }else{
             $time = 0;
         }
+
         if((time()-$time)>7776000){
             return false;
         }else{