This commit is contained in:
wangmingqing 2023-05-29 16:25:14 +08:00
parent 3ae1f38e60
commit 21e9d13241
3 changed files with 106 additions and 5 deletions

View File

@ -71,9 +71,14 @@ else{
define("WE_SURL_API_TIFFANY_TOKEN", "TH3UOn1Z4p7aJFS5q8eE6Kmt9xWQsocw");
//数据库连接
// define("MYSQL_CONNECT_HOST", "rds0yslqyg1iuze8txux545.mysql.rds.aliyuncs.com");
// define("MYSQL_CONNECT_USERNAME", "tiffany");
// define("MYSQL_CONNECT_PASSWORD", "50iRVc5EZURndwf5");
// define("MYSQL_CONNECT_DBNAME", "sms");
define("MYSQL_CONNECT_HOST", "rds0yslqyg1iuze8txux545.mysql.rds.aliyuncs.com");
define("MYSQL_CONNECT_USERNAME", "tiffany");
define("MYSQL_CONNECT_PASSWORD", "50iRVc5EZURndwf5");
define("MYSQL_CONNECT_USERNAME", "sms");
define("MYSQL_CONNECT_PASSWORD", "F1js6Dk3ehi");
define("MYSQL_CONNECT_DBNAME", "sms");
//REDIS DB

View File

@ -22,6 +22,54 @@ if(!empty($_SERVER['HTTP_HOST']) && (preg_match("@weapp\.wemediacn@", strtolower
"params"=>3
)
);
$router->add(
"/smsoauth2_qa/api/oauth2/code",
array(
"controller" => 'oauth2' ,
"action" => 'code',
)
);
$router->add(
"/smsoauth2_qa/api/oauth2/accesstoken",
array(
"controller" => 'oauth2' ,
"action" => 'accesstoken',
)
);
$router->add(
"/smsoauth2_qa/api/sms/send",
array(
"controller" => 'sms' ,
"action" => 'send',
)
);
$router->add(
"/smsoauth2_qa/api/sms/authcode",
array(
"controller" => 'sms' ,
"action" => 'authcode',
)
);
$router->add(
"/smsoauth2_qa/api/sms/query_reports",
array(
"controller" => 'sms' ,
"action" => 'query_reports',
)
);
$router->add(
"/smsoauth2_qa/api/urls/shorturl",
array(
"controller" => 'urls' ,
"action" => 'shorturl',
)
);
}
}
@ -34,6 +82,54 @@ else{
"params"=>3
)
);
$router->add(
"/smsoauth2/api/oauth2/code",
array(
"controller" => 'oauth2' ,
"action" => 'code',
)
);
$router->add(
"/smsoauth2/api/oauth2/accesstoken",
array(
"controller" => 'oauth2' ,
"action" => 'accesstoken',
)
);
$router->add(
"/smsoauth2/api/sms/send",
array(
"controller" => 'sms' ,
"action" => 'send',
)
);
$router->add(
"/smsoauth2/api/sms/authcode",
array(
"controller" => 'sms' ,
"action" => 'authcode',
)
);
$router->add(
"/smsoauth2/api/sms/query_reports",
array(
"controller" => 'sms' ,
"action" => 'query_reports',
)
);
$router->add(
"/smsoauth2/api/urls/shorturl",
array(
"controller" => 'urls' ,
"action" => 'shorturl',
)
);
}
$router->handle(

View File

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