xun 7 years ago
parent
commit
109691e57c
4 changed files with 6 additions and 52 deletions
  1. 1 1
      gitignore/config.php
  2. 3 3
      gitignore/database.php
  3. 1 48
      gitignore/rules.php
  4. 1 0
      public/index.php

+ 1 - 1
gitignore/config.php

@@ -97,7 +97,7 @@ return [
     // 路由使用完整匹配
     'route_complete_match'   => false,
     // 路由配置文件(支持配置多个)
-    'route_config_file'      => ['route'],
+    'route_config_file'      => ['route','rules'],
     // 是否强制使用路由
     'url_route_must'         => false,
     // 域名部署

+ 3 - 3
gitignore/database.php

@@ -13,13 +13,13 @@ return [
     // 数据库类型
     'type'            => 'mysql',
     // 服务器地址
-    'hostname'        => '115.159.143.72',
+    'hostname'        => 'localhost',
     // 数据库名
     'database'        => 'wiki_api',
     // 用户名
-    'username'        => 'wiki_api',
+    'username'        => 'root',
     // 密码
-    'password'        => 'wiki_api',
+    'password'        => 'root',
     // 端口
     'hostport'        => '',
     // 连接dsn

+ 1 - 48
gitignore/rules.php

@@ -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');

+ 1 - 0
public/index.php

@@ -12,6 +12,7 @@
 // [ 应用入口文件 ]
 // 定义配置文件目录和应用目录同级
 // 定义应用目录
+echo 123;exit;
 define('APP_PATH', __DIR__ . '/../application/');
 // 加载框架引导文件
 require __DIR__ . '/../thinkphp/start.php';