Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Commit

Permalink
release 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DefinitlyEvil committed Sep 26, 2017
1 parent 4555139 commit 6c3c7b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/application/server/controller/ServerApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use think\controller\Rest;

class ServerApi extends Rest {
const VERSION = "1.0";

public function __construct(){
if(!isset($_GET["key"]) or $_GET["key"] !== config("security.secret_plugin")) {
json(["status" => "error", "message" => "wrong_key"], 200)->send();
Expand All @@ -16,6 +18,6 @@ public function __construct(){
}

protected function json($data = [], $status = "success", $message = "") {
return json(array_merge(["status" => $status, "message" => $message], $data), 200);
return json(array_merge(["status" => $status, "message" => $message, "version" => self::VERSION], $data), 200);
}
}

0 comments on commit 6c3c7b0

Please sign in to comment.