46 lines
940 B
PHP
Executable File
46 lines
940 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Module\Base;
|
|
use Redirect;
|
|
|
|
|
|
/**
|
|
* 页面
|
|
* Class IndexController
|
|
* @package App\Http\Controllers
|
|
*/
|
|
class IndexController extends InvokeController
|
|
{
|
|
public function __invoke($method, $action = '', $child = '')
|
|
{
|
|
$app = $method ?: 'main';
|
|
if ($action) {
|
|
$app .= "__" . $action;
|
|
}
|
|
if (!method_exists($this, $app)) {
|
|
$app = method_exists($this, $method) ? $method : 'main';
|
|
}
|
|
return $this->$app($child);
|
|
}
|
|
|
|
/**
|
|
* 首页
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
*/
|
|
public function main()
|
|
{
|
|
return view('main', ['version' => Base::getVersion()]);
|
|
}
|
|
|
|
/**
|
|
* 接口文档
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
*/
|
|
public function api()
|
|
{
|
|
return Redirect::to(Base::fillUrl('docs/index.html'), 301);
|
|
}
|
|
}
|