|
@@ -16,7 +16,7 @@ class Apiexpress extends Start_Controller {
|
|
|
|
|
|
if($arg == 'search')
|
|
|
{
|
|
|
- $this->search($arg_array);
|
|
|
+ $this->search();
|
|
|
}else{
|
|
|
$this->_a();
|
|
|
}
|
|
@@ -29,11 +29,15 @@ class Apiexpress extends Start_Controller {
|
|
|
* @param $arg_array[0] string 请求店铺
|
|
|
* @param $arg_array[1] string 请求单号
|
|
|
*/
|
|
|
- public function search($arg_array){
|
|
|
- $shop = isset($arg_array[0])?$arg_array[0]:"";
|
|
|
- $waybill_no = isset($arg_array[1])?$arg_array[1]:"";
|
|
|
+ public function search(){
|
|
|
+ $data = file_get_contents('PHP://input');
|
|
|
+ $data = json_decode($data, true);
|
|
|
+ $shop = isset($data['shop'])?$data['shop']:"";
|
|
|
+ $waybill_no = isset($data['waybill'])?$data['waybill']:"";
|
|
|
|
|
|
- $time = isset($arg_array[2])?$arg_array[2]:0;
|
|
|
+ $time = isset($data['time'])?$data['time']:0;
|
|
|
+
|
|
|
+ $jiami_str = isset($data['key'])?$data['key']:"";
|
|
|
|
|
|
$now_time = time();
|
|
|
if(strlen( $time."") != 10){
|
|
@@ -47,9 +51,16 @@ class Apiexpress extends Start_Controller {
|
|
|
die($this->logic_tools->ret_json(-1,"请求店铺异常"));
|
|
|
}
|
|
|
$shop_key = $this->logic_tools->getshopname($shop);
|
|
|
+ if(empty($jiami_str)){
|
|
|
+ die($this->logic_tools->ret_json(-1,"秘钥信息不存在"));
|
|
|
+ }
|
|
|
+ $jiemi_str = $this->logic_tools->toolsjiemi($jiami_str,$this->key,$this->iv);
|
|
|
if(empty($shop_key)){
|
|
|
die($this->logic_tools->ret_json(-1,"该店铺的秘钥不存在"));
|
|
|
}
|
|
|
+ if($jiemi_str != $shop_key){
|
|
|
+ die($this->logic_tools->ret_json(-1,"该店铺的秘钥不正确"));
|
|
|
+ }
|
|
|
if(empty($waybill_no)){
|
|
|
die($this->logic_tools->ret_json(-1,"请求单号异常"));
|
|
|
}
|