|
@@ -6,52 +6,5 @@
|
|
|
* Time: 16:14
|
|
|
*/
|
|
|
use think\Route;
|
|
|
-use think\Request;
|
|
|
-use think\Cookie;
|
|
|
-use think\Config;
|
|
|
-use app\common\model\DomainConfig;
|
|
|
-$host = Request::instance()->host();
|
|
|
-$domain_model = new DomainConfig();
|
|
|
-$domain_data = $domain_model->get_host_module($host);
|
|
|
|
|
|
-//$path = 'logs';
|
|
|
-//$msg = $domain_data;
|
|
|
-//if (! is_dir($path)) {
|
|
|
-// mkdir($path);
|
|
|
-//}
|
|
|
-//$filename = $path . '/' . date('YmdHi') . '.log';
|
|
|
-//$content = date("Y-m-d H:i:s")."\r\n".json_encode($msg,JSON_UNESCAPED_UNICODE)."\r\n \r\n \r\n ";
|
|
|
-//file_put_contents($filename, $content, FILE_APPEND);
|
|
|
-
|
|
|
-
|
|
|
-if($host !== null){
|
|
|
- if(empty($domain_data)){
|
|
|
- if(Request::instance()->isMobile()){
|
|
|
- header('Location: '.Config::get('url.mobile'));
|
|
|
- exit;
|
|
|
- }else{
|
|
|
- header('Location: '.Config::get('url.home'));
|
|
|
- exit;
|
|
|
- }
|
|
|
- }elseif ($domain_data['user_id'] > 0){
|
|
|
- $con = Request::instance()->controller();
|
|
|
- $fun = Request::instance()->action();
|
|
|
- Route::domain($host,$domain_data['module']);
|
|
|
- Route::rule('','shop/index');
|
|
|
- Route::rule('index/index','shop/index');
|
|
|
- Cookie::set('shop_id',$domain_data['user_id']);
|
|
|
- }else{
|
|
|
- Route::domain($host,$domain_data['module']);
|
|
|
- }
|
|
|
- if($domain_data['module'] != 'shop'){
|
|
|
- Route::rule('goods/:id','detail/index');//商品链接
|
|
|
- }
|
|
|
-
|
|
|
-//Route::rule('user','user/index');
|
|
|
- Route::rule('share/:code','share/index');//分享链接
|
|
|
- Route::rule('sweep/:r','Spc/sweep');//扫码二维码
|
|
|
-// Route::rule('c/:c','Spc/sweep');//扫码二维码
|
|
|
-// Route::rule('d/:d','Spc/sweep');//扫码二维码
|
|
|
- Route::rule('query/:data','Spc/query');//扫码结果页
|
|
|
- Route::rule('archive/:token','Spc/archive');//追溯档案展示
|
|
|
-}
|
|
|
+Route::domain('wiki.api.tossboy.cn','index');
|