api/app/config/router.php

131 lines
2.2 KiB
PHP
Raw Normal View History

2023-04-07 19:05:18 +08:00
<?php
$router = $di->getRouter();
2023-05-30 14:22:34 +08:00
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
)
);
2023-05-30 14:47:07 +08:00
print_r($router);die;
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2_qa/api/oauth2/code",
array(
"controller" => 'oauth2' ,
"action" => 'code',
)
);
2023-04-07 19:05:18 +08:00
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2_qa/api/oauth2/accesstoken",
array(
"controller" => 'oauth2' ,
"action" => 'accesstoken',
)
);
2023-05-29 16:25:14 +08:00
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2_qa/api/sms/send",
array(
"controller" => 'sms' ,
"action" => 'send',
)
);
2023-05-29 16:25:14 +08:00
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2_qa/api/sms/authcode",
array(
"controller" => 'sms' ,
"action" => 'authcode',
)
);
2023-05-29 16:25:14 +08:00
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2_qa/api/sms/query_reports",
array(
"controller" => 'sms' ,
"action" => 'query_reports',
)
);
2023-05-29 16:25:14 +08:00
2023-05-30 14:38:25 +08:00
$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{
2023-04-07 19:05:18 +08:00
$router->add(
"/tiffany/api/:controller/:action/:params",
array(
"controller"=>1,
"action"=>2,
"params"=>3
)
);
2023-05-29 16:25:14 +08:00
$router->add(
"/smsoauth2/api/oauth2/code",
array(
"controller" => 'oauth2' ,
"action" => 'code',
)
);
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2/api/oauth2/accesstoken",
array(
"controller" => 'oauth2' ,
"action" => 'accesstoken',
)
);
2023-05-29 16:25:14 +08:00
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2/api/sms/send",
array(
"controller" => 'sms' ,
"action" => 'send',
)
);
2023-05-29 16:25:14 +08:00
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2/api/sms/authcode",
array(
"controller" => 'sms' ,
"action" => 'authcode',
)
);
2023-05-29 16:25:14 +08:00
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2/api/sms/query_reports",
array(
"controller" => 'sms' ,
"action" => 'query_reports',
)
);
2023-05-29 16:25:14 +08:00
2023-05-30 14:38:25 +08:00
$router->add(
"/smsoauth2/api/urls/shorturl",
array(
"controller" => 'urls' ,
"action" => 'shorturl',
)
);
2023-04-07 19:05:18 +08:00
}
$router->handle(
$_SERVER["REQUEST_URI"]
);
?>