app.php 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. use think\facade\Console;
  12. use think\facade\Route;
  13. // 管理后台
  14. Route::rule('admin/:any', function () {
  15. return view(app()->getRootPath() . 'public/admin/index.html');
  16. })->pattern(['any' => '\w+']);
  17. // 手机端
  18. Route::rule('mobile/:any', function () {
  19. return view(app()->getRootPath() . 'public/mobile/index.html');
  20. })->pattern(['any' => '\w+']);
  21. // PC端
  22. Route::rule('pc/:any', function () {
  23. return view(app()->getRootPath() . 'public/pc/index.html');
  24. })->pattern(['any' => '\w+']);
  25. //定时任务
  26. Route::rule('crontab', function () {
  27. Console::call('crontab');
  28. });