20 lines
390 B
PHP
20 lines
390 B
PHP
<?php
|
|
namespace app\common\behavior;
|
|
|
|
use think\Container;
|
|
use think\facade\Config;
|
|
use think\facade\Request;
|
|
use think\facade\Route;
|
|
|
|
class SetModule
|
|
{
|
|
public function run($params)
|
|
{
|
|
$url="http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF'];
|
|
preg_match("#http://(.*?)\.#i",$url,$match);
|
|
if($match[1] != 'api'){
|
|
Route::bind(Config::get('app.default_module'));
|
|
}
|
|
}
|
|
}
|