From 52c85ea4337fc06e1027689b0514057d15c2bb91 Mon Sep 17 00:00:00 2001 From: "cn.yimian.xyz" Date: Sun, 16 Aug 2020 11:05:34 +0800 Subject: [PATCH] add token table --- api/checkAccount.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/checkAccount.php b/api/checkAccount.php index 0424b20..1711c88 100644 --- a/api/checkAccount.php +++ b/api/checkAccount.php @@ -14,7 +14,7 @@ if(!isset($hash)) die(); if($redis->exists('account/'.$hash)){ - + $cnn = db__connect(); $arr = json_decode($redis->get('account/'.$hash), true); if(!$arr['isExist']){ @@ -33,6 +33,12 @@ if($redis->exists('account/'.$hash)){ $token = hash('sha256', $hash.time()); $redis->set('auth/token/'.$token, $hash); + db__pushData($cnn, "token", array( + "token"=>$token, + "hash"=>$hash, + "created_at"=>date("Y-m-d H:i:s", time()), + "state"=>'1' + )); echo json_encode(array("code"=> 200, "token"=>$token, "message" => "Verified successfully!"));