mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-05 20:48:11 +00:00
Update app.php
This commit is contained in:
parent
e1d082e984
commit
32d591d108
@ -1,10 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: liu21st <liu21st@gmail.com>
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
use think\facade\Route;
|
use think\facade\Route;
|
||||||
|
use think\facade\Request;
|
||||||
|
|
||||||
Route::domain('install.php', ':\app\install\controller');
|
Route::domain('install.php', ':\app\install\controller');
|
||||||
// 访问首页自动跳转到admin
|
// 访问首页自动跳转到admin
|
||||||
Route::rule('/', function () {
|
Route::rule('/', function () {
|
||||||
return redirect('/web');
|
if (Request::isMobile()) {
|
||||||
|
return redirect('/wap');
|
||||||
|
} else {
|
||||||
|
return redirect('/web');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// 管理后台
|
// 管理后台
|
||||||
Route::rule('admin/:any', function () {
|
Route::rule('admin/:any', function () {
|
||||||
@ -14,11 +28,11 @@ Route::rule('admin/:any', function () {
|
|||||||
Route::rule('wap/:any', function () {
|
Route::rule('wap/:any', function () {
|
||||||
return view(app()->getRootPath() . 'public/wap/index.html');
|
return view(app()->getRootPath() . 'public/wap/index.html');
|
||||||
})->pattern(['any' => '\w+']);
|
})->pattern(['any' => '\w+']);
|
||||||
// 手机端
|
// 电脑端
|
||||||
Route::rule('web/:any', function () {
|
Route::rule('web/:any', function () {
|
||||||
return view(app()->getRootPath() . 'public/web/index.html');
|
return view(app()->getRootPath() . 'public/web/index.html');
|
||||||
})->pattern(['any' => '\w+']);
|
})->pattern(['any' => '\w+']);
|
||||||
//用于公众号授权证书
|
//用于公众号授权证书
|
||||||
Route::any('MP_verify_<name>.txt', function ($name) {
|
Route::any('MP_verify_<name>.txt', function ($name) {
|
||||||
echo $name;
|
echo $name;
|
||||||
});
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user