34 lines
899 B
PHP
Raw Normal View History

2021-01-30 20:59:12 +08:00
<?php
2021-07-26 17:41:59 +08:00
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.gougucms.com
*/
2021-01-30 20:59:12 +08:00
declare (strict_types = 1);
namespace app\home\controller;
use app\home\BaseController;
use think\facade\View;
class Index extends BaseController
{
public function index()
2021-07-26 17:41:59 +08:00
{
add_user_log('view', '首页');
2021-07-28 10:04:47 +08:00
$version = get_system_config('other','version');
$count = \think\facade\Db::name('UserLog')->where(array('type' => 'down'))->count();
return View('',['version'=>$version,'count'=>$count]);
2021-01-30 20:59:12 +08:00
}
2021-07-28 10:04:47 +08:00
public function down()
2021-01-30 20:59:12 +08:00
{
2021-07-28 10:04:47 +08:00
$version = get_system_config('other','version');
add_user_log('down', $version.'版本代码');
header("Location: https://www.gougucms.com/storage/gougucms_".$version."_full.zip");
//确保重定向后,后续代码不会被执行
exit;
2021-01-30 20:59:12 +08:00
}
}