Index.php
<?php
namespace app\index\controller;
use app\index\controller\Base;
use \think\Request;
class Index extends Base{
public function index(){
if (Request::instance()->isMobile()) {
return $this->redirect(url('mobile/index'));
} else {
return $this->fetch('',[
]);
}
}
}
?>
Mobile.php
<?php
namespace app\index\controller;
use app\index\controller\Base;
use \think\Request;
class Mobile extends Base{
public function index(){
if (Request::instance()->isMobile()) {);
return $this->fetch('',[
]);
} else {
return $this->redirect(url('index/index'));
}
}
}
?>