修正bug

This commit is contained in:
qinzongqing 2023-04-18 16:23:29 +08:00
parent 512aa9f404
commit db40698de1
4 changed files with 22 additions and 5 deletions

View File

@ -266,6 +266,13 @@ class ControllerBase extends Phalcon\Mvc\Controller{
$rs['errcode'] = 80105; $rs['errcode'] = 80105;
$rs['data'] = null; $rs['data'] = null;
} }
//如果现access_token未过期
else{
//告知用户"ok"
$rs['errmsg'] = "ok";
$rs['errcode'] = 0;
$rs['data'] = null;
}
} }
//如果所传access_token匹配现access_token //如果所传access_token匹配现access_token
else{ else{
@ -276,8 +283,18 @@ class ControllerBase extends Phalcon\Mvc\Controller{
$rs['errcode'] = 80105; $rs['errcode'] = 80105;
$rs['data']['AccessToken'] = $AccessToken; $rs['data']['AccessToken'] = $AccessToken;
} }
//如果现access_token未过期
else{
//告知用户"ok"
$rs['errmsg'] = "ok";
$rs['errcode'] = 0;
$rs['data'] = null;
}
} }
} }
//返回结果
return $rs;
} }
} }
?> ?>

View File

@ -18,13 +18,13 @@ class Oauth2Controller extends ControllerBase{
*/ */
function testAction(){ function testAction(){
//$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/oauth2/code"; //$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/oauth2/code";
$url = "http://127.0.0.1/tiffany/api/oauth2/code?qaz=wsx"; //$url = "http://127.0.0.1/tiffany/api/oauth2/code?qaz=wsx";
//$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/oauth2/accesstoken"; //$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/oauth2/accesstoken";
//$url = "http://127.0.0.1/tiffany/api/oauth2/accesstoken?qaz=wsx"; $url = "http://127.0.0.1/tiffany/api/oauth2/accesstoken?qaz=wsx";
$post_arr = array(); $post_arr = array();
$post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7"; $post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7";
$post_arr['appsecrect'] = "b82015bd-8d4c-4df8-87a8-c25477a8976f"; $post_arr['appsecrect'] = "b82015bd-8d4c-4df8-87a8-c25477a8976f";
$post_arr['code'] = "ae527cf1ad3a4b259d2c0ff5d9e8e4a4"; $post_arr['code'] = "6a85462f61370131826d00e89efe8643";
$post_json = json_encode($post_arr); $post_json = json_encode($post_arr);
$result = $this->__http_post_request($url, $post_json, true); $result = $this->__http_post_request($url, $post_json, true);
print_r($result); die; print_r($result); die;

View File

@ -45,7 +45,7 @@ class SmsController extends ControllerBase{
$post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7"; $post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7";
$post_arr['mobile'] = "13501882318"; $post_arr['mobile'] = "13501882318";
$post_arr['access_token'] = "9d21508a7531430c843cff8063dccb1c"; $post_arr['access_token'] = "9d21508a7531430c843cff8063dccb1c";
$post_arr['access_token'] = "d9f45d5b4aeb44f1a82f08dde7f86b34"; $post_arr['access_token'] = "8dfd706ffcfce2c7067df73f8e122020";
$post_arr['content'] = "[$=yzm=$]、[$=params1=$]、[$=params2=$]、[$=params3=$]、[$=params4=$]、[$=params5=$]"; $post_arr['content'] = "[$=yzm=$]、[$=params1=$]、[$=params2=$]、[$=params3=$]、[$=params4=$]、[$=params5=$]";
$post_arr['format'] = ""; $post_arr['format'] = "";
$post_arr['len'] = -1; $post_arr['len'] = -1;

View File

@ -22,7 +22,7 @@ class UrlsController extends ControllerBase{
$post_arr = array(); $post_arr = array();
$post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7"; $post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7";
$post_arr['access_token'] = "9d21508a7531430c843cff8063dccb1c"; $post_arr['access_token'] = "9d21508a7531430c843cff8063dccb1c";
$post_arr['access_token'] = "d9f45d5b4aeb44f1a82f08dde7f86b34"; $post_arr['access_token'] = "8dfd706ffcfce2c7067df73f8e122020";
$post_arr['url'] = "https://www.baidu.com/"; $post_arr['url'] = "https://www.baidu.com/";
$post_json = json_encode($post_arr); $post_json = json_encode($post_arr);
$result = $this->__http_post_request($url, $post_json, true); $result = $this->__http_post_request($url, $post_json, true);