From 923549bb5eb3770c56ee4c50ef9ff2546eb72952 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 11:51:42 +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=E4=B8=BA10?= =?UTF-8?q?=E5=88=86=E9=92=9F=E6=96=B9=E4=BE=BF=E6=B5=8B=E8=AF=95(?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=AE=8C=E5=90=8E=E6=94=B9=E4=B8=BA24?= =?UTF-8?q?=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 ab61b88a2..93a39854c 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) > 86400) { + if (abs($time - $oldTime) > 600) { return Base::retError("链接已失效,请重新登录/注册"); } UserEmailVerification::where('code', $data['code']) diff --git a/app/Models/UserEmailVerification.php b/app/Models/UserEmailVerification.php index fdb71063a..3f421b3de 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(1440))->first(); + $res = self::where('userid', $user->userid)->where('created_at', '>', Carbon::now()->subMinutes(10))->first(); if ($res) return; //删除 self::where('userid', $user->userid)->delete();