wanggangtao 5 年 前
コミット
5b92813352
共有3 個のファイルを変更した19 個の追加7 個の削除を含む
  1. 15 4
      api/lib/api.class.php
  2. 3 2
      api/v1.0/api.php
  3. 1 1
      api/v1.0/stock_list.php

+ 15 - 4
api/lib/api.class.php

@@ -16,12 +16,23 @@ class API {
     const SUCCESS_MSG= "success";
 
 
-    const EMPTY = 201;
-    const EMPTY_MSG= "股票代码不存在/错误";
+    const STOCK = 301;
+    const STOCK_MSG= "股票代码不存在/错误";
 
-    const STOCK = 202;
-    const STOCK_MSG= "股票数据为空";
+    const SECTOR = 302;
+    const SECTOR_MSG= "交易板块不存在/错误";
 
+    const SIGN = 302;
+    const SIGN_MSG= "非法签名";
+
+
+
+
+    const EMPTY = 401;
+    const EMPTY_MSG= "股票数据为空";
+
+    const SERVER = 501;
+    const SERVER_MSG= "服务器错误";
 
     //API编号,数字
     public $code;

+ 3 - 2
api/v1.0/api.php

@@ -9,8 +9,9 @@ if(isset($_REQUEST["source"]))
 }
 $timestamp     = safeCheck($_REQUEST['timestamp'],0);//来源
 $sign_raw = md5($method.$timestamp);
-if($sign_raw != $sign) $api->ApiError('002', '校验不通过!');
-//var_dump($method);
+if($sign_raw != $sign){
+    echo action_msg(API::SIGN, API::SIGN_MSG);
+}
 require_once($method.".php");
 
 ?>

File diff suppressed because it is too large
+ 1 - 1
api/v1.0/stock_list.php