frank %!s(int64=3) %!d(string=hai) anos
pai
achega
b19ae260f5

+ 0 - 4
frontendApi/modules/v1/components/UserAuth.php

@@ -139,10 +139,6 @@ class UserAuth extends User {
             $accessTokenResult = $this->updateToken($userToken, $appType = 'pc', $typeToken = 'access', $userId);
             $refreshTokenResult = $this->updateToken($userToken, $appType = 'pc', $typeToken = 'refresh', $userId);
             if ($accessTokenResult && $refreshTokenResult) {
-
-                // 把用户的登录时间存在操作时间里
-                Yii::$app->tokenRedis->hset('user:timeOut', $userId, time());
-
                 return $this->getToken();
             } else {
                 return null;

+ 2 - 1
frontendApi/modules/v1/controllers/BaseController.php

@@ -48,7 +48,8 @@ class BaseController extends \yii\rest\ActiveController {
         $this->forbiddenQuicklyUser();
 
         // 增加的判断用户登录后未操作后的超时
-        if (Yii::$app->getUser()->getUserInfo()){
+        $isQuickly = User::isQuicklyLogin();
+        if ($isQuickly != 1 && Yii::$app->getUser()->getUserInfo()){
             $userId = Yii::$app->getUser()->getUserInfo()['id'];
             $redisKey = 'user:timeOut';