dever 6 years ago
parent
commit
43cd77c327
2 changed files with 28 additions and 11 deletions
  1. 3 4
      buy/src/Buy.php
  2. 25 7
      config/env/localhost/default.php

+ 3 - 4
buy/src/Buy.php

@@ -8,10 +8,6 @@ class Buy extends Base
     public function __construct()
     {
         parent::__construct();
-
-        if (!$this->user) {
-            //return $this->location('home');
-        }
     }
     
     # 列表页
@@ -269,6 +265,9 @@ class Buy extends Base
     # 小刊购买
     public function pay()
     {
+        if (!$this->user) {
+            return $this->location('home');
+        }
         $uid = $this->user['id'];
 
         $buy_id = Dever::input('buy_id');

+ 25 - 7
config/env/localhost/default.php

@@ -67,14 +67,14 @@ $dc['mysql_user'] = array
 # 设置哪些项目需要切换到弹性数据库
 if (isset($dc['mysql_user'])) {
     $dc['mysql_user']['charset'] = 'utf8';
-    $dc['mysql_user']['database'] = 'wonderful_v1';
+    $dc['mysql_user']['database'] = 'wonderful';
     $dc['mysql_user']['type'] = 'pdo';
     $config['database']['code'] = $dc['mysql_user'];
     $config['database']['act'] = $dc['mysql_user'];
     $config['database']['passport'] = $dc['mysql_user'];
     $config['database']['pay'] = $dc['mysql_user'];
     $config['database']['score'] = $dc['mysql_user'];
-    $config['database']['score'] = $dc['mysql_user'];
+    $config['database']['wechat'] = $dc['mysql_user'];
 }
 
 # 缓存配置
@@ -85,13 +85,13 @@ $config['cache'] = array
     # 启用页面缓存 会根据当前的url来生成缓存,相当于页面静态化。
     'html' => 0,
     # 启用数据级别缓存 这个缓存是程序员自定义的:Dever::cache('name', 'value', 3600);
-    'data' => 0,
+    'data' => 7200,
     # 启用load加载器缓存,一般不加载
     'load' => 0,
     # 启用load加载器的远程加载缓存
     'curl' => 0,
     # 启用路由缓存
-    'route' => 0,
+    'route' => 72000,
 
     # 缓存精细控制,根据uri来控制,0则无需缓存
     'routeKey' => array
@@ -101,12 +101,16 @@ $config['cache'] = array
         'passport' => 0,
         'oauth' => 0,
         'cron' => 0,
+        'act' => 0,
         'combine' => 0,
-        'service_home' => 0,
-        'service_my_code' => 0,
-        'service_buy.pay' => 0,
+        'service_' => 0,
         'vip_' => 0,
         'order.' => 0,
+        'buy_home' => 0,
+        'buy_my_code' => 0,
+        'buy_codedetail' => 0,
+        'buy.pay' => 0,
+        'journal_v1.top' => 600,
     ),
 
     # 哪些路由中的参数不参与生成缓存的key
@@ -120,6 +124,13 @@ $config['cache'] = array
             'content.ad',
             'journal.home',
             'journal.getList',
+            'journal_v1.home',
+            'journal_v1.getList',
+            'journal_v1.top',
+            'journal_v1.buy',
+            'journal_v1.read',
+            'buy_list',
+            'buy_pay',
         ),
 
         'uid' => array
@@ -130,6 +141,13 @@ $config['cache'] = array
             'content.ad',
             'journal.home',
             'journal.getList',
+            'journal_v1.home',
+            'journal_v1.getList',
+            'journal_v1.top',
+            'journal_v1.buy',
+            'journal_v1.read',
+            'buy_list',
+            'buy_pay',
         ),
     ),