From 51fbf2917de8d07c8a4d007dee9fbed49cdcd1e1 Mon Sep 17 00:00:00 2001 From: LoveesYe <109154433+LoveesYe@users.noreply.github.com> Date: Thu, 14 Jul 2022 20:57:38 +0200 Subject: [PATCH] Delete index.php --- web/index.php | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 web/index.php diff --git a/web/index.php b/web/index.php deleted file mode 100644 index b9076f3..0000000 --- a/web/index.php +++ /dev/null @@ -1,49 +0,0 @@ -time(), 'rnd'=>$param['rnd']]; - echo generate_output($data); -} -elseif(strpos($url, '/auth') !== false && $method=='POST'){ - $param = parse_input(); - //$data = ['nodes'=>10000, 'machine_code'=>$param['machine_code'], 'end_at'=>time()+3600*24*365]; - $data = ['nodes'=>99999, 'machine_code'=>$param['machine_code'], 'end_at'=>time()+3600*24*365*10]; - echo generate_output($data); -} -elseif(strpos($url, '/common/datetime') !== false && $method=='GET'){ - return date('Y-m-d H:i:s'); -} -elseif(strpos($url, '/master/upgrades') !== false){ - $version_data = file_get_contents('version.json'); - if(!$version_data) exit(json_encode(['code'=>-1, 'data'=>[], 'ip'=>$_SERVER['REMOTE_ADDR'], 'msg'=>'版本信息文件不存在'])); - $version_info = json_decode($version_data, true); - if(!$version_info) exit(json_encode(['code'=>-1, 'data'=>[], 'ip'=>$_SERVER['REMOTE_ADDR'], 'msg'=>'解析版本信息文件失败'])); - $data = ['code'=>0, 'count'=>1, 'data'=>[$version_info], 'ip'=>$_SERVER['REMOTE_ADDR']]; - echo json_encode($data); -} - - -function parse_input(){ - $post = file_get_contents('php://input'); - $param = json_decode(text_decrypt($post), true); - return $param; -} -function generate_output($data){ - $cipher = text_encrypt(json_encode($data)); - $data = ['code'=>0, 'data'=>$cipher, 'msg'=>'']; - return json_encode($data); -} -function text_encrypt($data){ - return openssl_encrypt($data, 'aes-128-cbc', AES_KEY, 0, AES_KEY); -} -function text_decrypt($data){ - return openssl_decrypt($data, 'aes-128-cbc', AES_KEY, 0, AES_KEY); -}