app.php 982 B

1234567891011121314151617181920212223242526272829
  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\Config;
  12. use think\facade\Route;
  13. // PC商城端
  14. $isOpen = \app\common\server\ConfigServer::get('pc', 'is_open', 1);
  15. if(!$isOpen) {
  16. return '';
  17. }
  18. Config::set(['app_trace' => false]);
  19. return view(app()->getRootPath() . 'public/index.html');
  20. //定时任务
  21. Route::rule('crontab', function () {
  22. \think\facade\Console::call('crontab');
  23. });