fastadmin框架重定向

由于,我们一打开fastadmin框架就进入到前端页面很麻烦,下面这种方法可以解决这个问题。
首先我们找到这个路径


 找到重定向,

 application》index》controller》index

原本文件是这个样子:

<?php
 
namespace app\index\controller;
 
use app\common\controller\Frontend;
 
class Index extends Frontend
{
 
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';
 
    public function index()
    {
        return $this->view->fetch();
    }
 
}

改为:

<?php
 
namespace app\index\controller;
 
use app\common\controller\Frontend;
 
class Index extends Frontend
{
 
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';
 
    public function index()
    {
        $this->redirect("/wangmo.php");   //关键代码重定向
    }
 
}

wangmo这个是fastadmin框架自动生成的文件名称

猜你喜欢

转载自blog.csdn.net/m0_72196169/article/details/131924818