diff --git a/app/common/controller/Base.php b/app/common/controller/Base.php deleted file mode 100644 index 95fc8b24..00000000 --- a/app/common/controller/Base.php +++ /dev/null @@ -1,28 +0,0 @@ -[ - 'except'=>[ - 'exit', - ], - ], - ]; - - public function _empty() - { - $this->error('不好意思,您访问的页面不存在~'); - } - -} diff --git a/app/common/controller/BaseError.php b/app/common/controller/BaseError.php index cea4231b..29c291ff 100644 --- a/app/common/controller/BaseError.php +++ b/app/common/controller/BaseError.php @@ -12,15 +12,20 @@ class BaseError extends BaseController * * @return \think\Response */ - public function index() - { - // 跳转页面 - $this->error('不好意思,您访问的页面不存在~'); - } + // public function index() + // { + // // 跳转页面 + // $this->error('不好意思,您访问的页面不存在~'); + // } - public function _empty() + // public function _empty() + // { + // $this->error('不好意思,您访问的页面不存在~'); + // } + + public function __call($method, $args) { - $this->error('不好意思,您访问的页面不存在~'); + return 'error request!'; } } diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 3777e793..d913785e 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -6,6 +6,8 @@ namespace app\index\controller; use app\BaseController; // 引用与此控制器同名的数据模型 use app\system\model\SystemBase as sysbasemod; +// 引用视图功能类 +use think\facade\View; @@ -141,11 +143,11 @@ class Index extends BaseController // 模版赋值 - $this->assign('list',$list); + View::assign('list',$list); // 渲染输出 - return $this->fetch(); + return View::fetch('welcome'); } diff --git a/app/index/route/index.php b/app/index/route/index.php index 0a9b0f58..36242dfd 100644 --- a/app/index/route/index.php +++ b/app/index/route/index.php @@ -12,4 +12,4 @@ use think\facade\Route; Route::rule('/','login/index'); //主页 -// Route::get('welcome','index/welcome'); //欢迎页 +Route::get('welcome','index/welcome'); //欢迎页