2023-04-07 19:05:18 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Tiffany SMS API重构-接口类
|
|
|
|
|
|
* @author QZQ
|
|
|
|
|
|
*/
|
|
|
|
|
|
header("Content-Type:text/html; Charset=utf-8");
|
|
|
|
|
|
|
|
|
|
|
|
class Oauth2Controller extends ControllerBase{
|
|
|
|
|
|
|
|
|
|
|
|
function initialize(){
|
|
|
|
|
|
parent::initialize();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-04-10 12:49:07 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 测试方法
|
|
|
|
|
|
* http://127.0.0.1/tiffany/api/oauth2/test?qaz=wsx
|
|
|
|
|
|
*/
|
|
|
|
|
|
function testAction(){
|
|
|
|
|
|
$url = "http://wxapp.wemediacn.com/smsoauth2_qa/api/oauth2/code";
|
|
|
|
|
|
$post_arr = array();
|
|
|
|
|
|
$post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7";
|
|
|
|
|
|
$post_json = json_encode($post_arr);
|
|
|
|
|
|
$result = $this->__http_post_request($url, $post_json, true);
|
|
|
|
|
|
print_r($result); die;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-04-07 19:05:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 获取code(Get code)
|
|
|
|
|
|
* http://127.0.0.1/tiffany/api/oauth2/code?qaz=wsx
|
|
|
|
|
|
*/
|
|
|
|
|
|
function codeAction(){
|
2023-04-10 12:49:07 +08:00
|
|
|
|
echo "111"; die;
|
2023-04-07 19:05:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 根据code获取access_token(Get access token by code)
|
|
|
|
|
|
* http://127.0.0.1/tiffany/api/oauth2/accesstoken?qaz=wsx
|
|
|
|
|
|
*/
|
|
|
|
|
|
function accesstokenAction(){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
?>
|