add token table

master
cn.yimian.xyz 4 years ago
parent 9c4f546af7
commit 52c85ea433
  1. 8
      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!"));

Loading…
Cancel
Save