允许从环境变量 env 中获得 app_debug 参数。

pull/21/head
F4NNIU 2017-11-14 23:32:33 +08:00
parent 0c5e4cbe2e
commit 031baa9627
3 changed files with 6 additions and 3 deletions

View File

@ -3,6 +3,7 @@
namespace app\admin\controller;
use app\common\controller\Backend;
use think\App;
/**
* 控制台
@ -41,7 +42,8 @@ class Dashboard extends Backend
'sevendau' => '32%',
'paylist' => $paylist,
'createlist' => $createlist,
'uploadmode' => $uploadmode
'uploadmode' => $uploadmode,
'appdebug' => App::$debug
]);
return $this->view->fetch();

View File

@ -377,7 +377,7 @@
</tr>
<tr>
<td width="120px">{:__('Debug mode')}</td>
<td>{$Think.config.app_debug?__('Yes'):__('No')}</td>
<td>{$appdebug?__('Yes'):__('No')}</td>
</tr>
<tr>
<td width="120px">{:__('Software')}</td>

View File

@ -3,6 +3,7 @@
namespace app\common\behavior;
use think\Config;
use think\App;
class Common
{
@ -39,7 +40,7 @@ class Common
{
Config::set('upload.cdnurl', $url);
}
if (Config::get('app_debug'))
if (App::$debug)
{
// 如果是调试模式将version置为当前的时间戳可避免缓存
Config::set('site.version', time());