diff --git a/app/config/router.php b/app/config/router.php index 6140e7f..fa3afb5 100644 --- a/app/config/router.php +++ b/app/config/router.php @@ -11,55 +11,63 @@ if(!empty($_SERVER['REQUEST_URI'])&& (preg_match("@\/d\/@", strtolower($_SERVER[ "params"=>3 ) ); - // $router->add( - // "/smsoauth2_qa/api/oauth2/code", - // array( - // "controller" => 'oauth2' , - // "action" => 'code', - // ) - // ); + $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/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/send", + array( + "controller" => 'sms' , + "action" => 'send', + ) + ); - // $router->add( - // "/smsoauth2_qa/api/sms/authcode", - // array( - // "controller" => 'sms' , - // "action" => 'authcode', - // ) - // ); + $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/sms/query_reports", + array( + "controller" => 'sms' , + "action" => 'query_reports', + ) + ); - // $router->add( - // "/smsoauth2_qa/api/urls/shorturl", - // array( - // "controller" => 'urls' , - // "action" => 'shorturl', - // ) - // ); -} -else{ + $router->add( + "/smsoauth2_qa/api/urls/shorturl", + array( + "controller" => 'urls' , + "action" => 'shorturl', + ) + ); +}else if($_SERVER['HTTP_HOST'] == '127.0.0.1'){ + $router->add( + "/tiffany/api/:controller/:action/:params", + array( + "controller"=>1, + "action"=>2, + "params"=>3 + ) + ); +}else{ $router->add( "/tiffany/api/:controller/:action/:params", array( @@ -68,7 +76,6 @@ else{ "params"=>3 ) ); - echo 2222222;die; $router->add( "/smsoauth2/api/oauth2/code", array( @@ -76,46 +83,45 @@ else{ "action" => 'code', ) ); + $router->add( + "/smsoauth2/api/oauth2/accesstoken", + array( + "controller" => 'oauth2' , + "action" => 'accesstoken', + ) + ); - $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/send", - array( - "controller" => 'sms' , - "action" => 'send', - ) - ); + $router->add( + "/smsoauth2/api/sms/authcode", + array( + "controller" => 'sms' , + "action" => 'authcode', + ) + ); - $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/sms/query_reports", - array( - "controller" => 'sms' , - "action" => 'query_reports', - ) - ); - - $router->add( - "/smsoauth2/api/urls/shorturl", - array( - "controller" => 'urls' , - "action" => 'shorturl', - ) - ); + $router->add( + "/smsoauth2/api/urls/shorturl", + array( + "controller" => 'urls' , + "action" => 'shorturl', + ) + ); } $router->handle(