截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. // 手机h5页面路由
  14. Route::rule('mobile/:any', function () {
  15. $isOpen = \app\common\server\ConfigServer::get('h5', 'is_open', 1);
  16. if(!$isOpen) {
  17. return '';
  18. }
  19. Config::set(['app_trace' => false]);
  20. return view(app()->getRootPath() . 'public/mobile/index.html');
  21. })->pattern(['any' => '\w+']);
  22. // PC商城端
  23. Route::rule('pc/:any', function () {
  24. $isOpen = \app\common\server\ConfigServer::get('pc', 'is_open', 1);
  25. if(!$isOpen) {
  26. return '';
  27. }
  28. Config::set(['app_trace' => false]);
  29. return view(app()->getRootPath() . 'public/pc/index.html');
  30. })->pattern(['any' => '\w+']);
  31. // 商家移动端
  32. Route::rule('business/:any', function () {
  33. Config::set(['app_trace' => false]);
  34. return view(app()->getRootPath() . 'public/business/index.html');
  35. })->pattern(['any' => '\w+']);
  36. // 客服
  37. Route::rule('kefu/:any', function () {
  38. Config::set(['app_trace' => false]);
  39. return view(app()->getRootPath() . 'public/kefu/index.html');
  40. })->pattern(['any' => '\w+']);
  41. //定时任务
  42. Route::rule('crontab', function () {
  43. \think\facade\Console::call('crontab');
  44. });