From 3e083ff4539ed791c59e758ee2b3734db4cac897 Mon Sep 17 00:00:00 2001 From: WispX <1591788658@qq.com> Date: Mon, 16 Mar 2020 14:57:41 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=20token=20=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/common.php b/application/common.php index aed676b1..836ba479 100644 --- a/application/common.php +++ b/application/common.php @@ -118,7 +118,11 @@ function str_rand($length = 16, $char = '0123456789abcdefghijklmnopqrstuvwxyzABC */ function make_token() { - return md5('LSKY PRO' . uniqid() . time()); + $token = md5('LSKY PRO' . uniqid() . time()); + if (\app\common\model\Users::where('token', $token)->count()) { + return make_token(); + } + return $token; } /**