作者 郭文星

123

@@ -160,6 +160,7 @@ class Index extends Api @@ -160,6 +160,7 @@ class Index extends Api
160 $res =HttpHelper::postheader($url,$data,"",$token); 160 $res =HttpHelper::postheader($url,$data,"",$token);
161 $res=json_decode($res,true); 161 $res=json_decode($res,true);
162 return $this->success($res['message'],$res['data']); 162 return $this->success($res['message'],$res['data']);
  163 +
163 } 164 }
164 //-获得设备数据详情 165 //-获得设备数据详情
165 public function getAllSupplyStatistics(){ 166 public function getAllSupplyStatistics(){
@@ -30,8 +30,8 @@ class User extends Api @@ -30,8 +30,8 @@ class User extends Api
30 30
31 //获取token 31 //获取token
32 public function tokenLogin(){ 32 public function tokenLogin(){
33 - $appKey = config("site.appKey");  
34 - $appSecret = config("site.appSecret"); 33 + $appKey ="waterPro_54989312";
  34 + $appSecret ="bef381707451606b34c1f9b4b18bd5d7";
35 $url="/api/access_token"; 35 $url="/api/access_token";
36 $postdata=[ 36 $postdata=[
37 "appKey"=>$appKey, 37 "appKey"=>$appKey,
@@ -42,7 +42,7 @@ class User extends Api @@ -42,7 +42,7 @@ class User extends Api
42 if($jsondata['code']==200){ 42 if($jsondata['code']==200){
43 return $jsondata['data']; 43 return $jsondata['data'];
44 }else{ 44 }else{
45 - return $this->error("请求失败"); 45 + return $this->error("请求失败".$jsondata['msg'],$jsondata['data']);
46 } 46 }
47 } 47 }
48 48