From e147b03565e7d0f264029676f96ef9c25acc84d5 Mon Sep 17 00:00:00 2001 From: wangmingqing Date: Tue, 30 May 2023 14:22:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/router.php | 119 +++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 66 deletions(-) diff --git a/app/config/router.php b/app/config/router.php index dd35c15..9296b51 100644 --- a/app/config/router.php +++ b/app/config/router.php @@ -1,77 +1,64 @@ getRouter(); +if(!empty($_SERVER['REQUEST_URI'])&& (preg_match("@\/d\/@", strtolower($_SERVER['REQUEST_URI'])) || preg_match("@\/smsoauth2_qa\/@", strtolower($_SERVER['REQUEST_URI']))) ) +{ + $router->add( + "/d/tiffany/api/:controller/:action/:params", + array( + "controller"=>1, + "action"=>2, + "params"=>3 + ) + ); + echo 1231232131231;die; + $router->add( + "/smsoauth2_qa/api/oauth2/code", + array( + "controller" => 'oauth2' , + "action" => 'code', + ) + ); -if(!empty($_SERVER['HTTP_HOST']) && (preg_match("@weapp\.wemediacn@", strtolower($_SERVER['HTTP_HOST'])))){ - if(!empty($_SERVER['REQUEST_URI']) && preg_match("@\/([a-z0-9]{1,20})\/stretch@", strtolower($_SERVER['REQUEST_URI']), $matches)){ - $custom_dir = $matches[1]; - $router->add( - "/{$custom_dir}/tiffany/api/:controller/:action/:params", - array( - "controller"=>1, - "action"=>2, - "params"=>3 - ) - ); - }else{ - $router->add( - "/d/tiffany/api/:controller/:action/:params", - array( - "controller"=>1, - "action"=>2, - "params"=>3 - ) - ); - echo 1231232131231;die; - $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', - ) - ); - } - + $router->add( + "/smsoauth2_qa/api/urls/shorturl", + array( + "controller" => 'urls' , + "action" => 'shorturl', + ) + ); } else{ $router->add(