From db99a215145b627a3380f42d8d9ec92dce923da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A6=E8=8D=A3=E8=B6=85?= <302645122@qq.com> Date: Wed, 9 Mar 2022 15:04:04 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=9C=89=E6=95=88=E6=9C=9F=E6=94=B9=E5=9B=9E?= =?UTF-8?q?24=E5=B0=8F=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/UsersController.php | 2 +- app/Models/UserEmailVerification.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 93a39854c..ab61b88a2 100755 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -607,7 +607,7 @@ class UsersController extends AbstractController $oldTime = strtotime($res->created_at); $time = time(); //24个小时失效 - if (abs($time - $oldTime) > 600) { + if (abs($time - $oldTime) > 86400) { return Base::retError("链接已失效,请重新登录/注册"); } UserEmailVerification::where('code', $data['code']) diff --git a/app/Models/UserEmailVerification.php b/app/Models/UserEmailVerification.php index 3f421b3de..fdb71063a 100644 --- a/app/Models/UserEmailVerification.php +++ b/app/Models/UserEmailVerification.php @@ -42,7 +42,7 @@ class UserEmailVerification extends AbstractModel */ public static function userEmailSend(User $user) { - $res = self::where('userid', $user->userid)->where('created_at', '>', Carbon::now()->subMinutes(10))->first(); + $res = self::where('userid', $user->userid)->where('created_at', '>', Carbon::now()->subMinutes(1440))->first(); if ($res) return; //删除 self::where('userid', $user->userid)->delete();