api/app/config/router.php

42 lines
795 B
PHP
Raw Normal View History

2023-04-07 19:05:18 +08:00
<?php
$router = $di->getRouter();
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
)
);
}
}
else{
$router->add(
"/tiffany/api/:controller/:action/:params",
array(
"controller"=>1,
"action"=>2,
"params"=>3
)
);
}
$router->handle(
$_SERVER["REQUEST_URI"]
);
?>