Merge branch 'dev'

This commit is contained in:
tokumeikoi 2022-12-15 11:04:40 +08:00
commit 0dfbadf715
8 changed files with 14 additions and 11 deletions

View File

@ -3,6 +3,7 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Models\Plan; use App\Models\Plan;
use App\Models\StatServer;
use App\Models\StatUser; use App\Models\StatUser;
use App\Utils\Helper; use App\Utils\Helper;
use Illuminate\Console\Command; use Illuminate\Console\Command;
@ -43,7 +44,7 @@ class ResetLog extends Command
*/ */
public function handle() public function handle()
{ {
StatUser::where('record_at', '<', strtotime('-2 month', time())) StatUser::where('record_at', '<', strtotime('-2 month', time()))->delete();
->delete(); StatServer::where('record_at', '<', strtotime('-2 month', time()))->delete();
} }
} }

View File

@ -48,7 +48,9 @@ class V2boardInstall extends Command
$this->info(" \ V / / __/| |_) | (_) | (_| | | | (_| | "); $this->info(" \ V / / __/| |_) | (_) | (_| | | | (_| | ");
$this->info(" \_/ |_____|____/ \___/ \__,_|_| \__,_| "); $this->info(" \_/ |_____|____/ \___/ \__,_|_| \__,_| ");
if (\File::exists(base_path() . '/.env')) { if (\File::exists(base_path() . '/.env')) {
abort(500, 'V2board 已安装,如需重新安装请删除目录下.env文件'); $defaultSecurePath = hash('crc32b', config('app.key'));
$this->info("访问 http(s)://你的站点/{$defaultSecurePath} 进入管理面板,你可以用户中心修改你的密码。");
abort(500, '如需重新安装请删除目录下.env文件');
} }
if (!copy(base_path() . '/.env.example', base_path() . '/.env')) { if (!copy(base_path() . '/.env.example', base_path() . '/.env')) {
@ -98,7 +100,7 @@ class V2boardInstall extends Command
$this->info("管理员邮箱:{$email}"); $this->info("管理员邮箱:{$email}");
$this->info("管理员密码:{$password}"); $this->info("管理员密码:{$password}");
$defaultSecurePath = crc32(config('app.key')); $defaultSecurePath = hash('crc32b', config('app.key'));
$this->info("访问 http(s)://你的站点/{$defaultSecurePath} 进入管理面板,你可以用户中心修改你的密码。"); $this->info("访问 http(s)://你的站点/{$defaultSecurePath} 进入管理面板,你可以用户中心修改你的密码。");
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error($e->getMessage()); $this->error($e->getMessage());

View File

@ -108,7 +108,7 @@ class ConfigController extends Controller
'register_limit_by_ip_enable' => (int)config('v2board.register_limit_by_ip_enable', 0), 'register_limit_by_ip_enable' => (int)config('v2board.register_limit_by_ip_enable', 0),
'register_limit_count' => config('v2board.register_limit_count', 3), 'register_limit_count' => config('v2board.register_limit_count', 3),
'register_limit_expire' => config('v2board.register_limit_expire', 60), 'register_limit_expire' => config('v2board.register_limit_expire', 60),
'secure_path' => config('v2board.secure_path', config('v2board.frontend_admin_path', crc32(config('app.key')))) 'secure_path' => config('v2board.secure_path', config('v2board.frontend_admin_path', hash('crc32b', config('app.key'))))
], ],
'subscribe' => [ 'subscribe' => [
'plan_change_enable' => (int)config('v2board.plan_change_enable', 1), 'plan_change_enable' => (int)config('v2board.plan_change_enable', 1),
@ -177,7 +177,7 @@ class ConfigController extends Controller
continue; continue;
} }
if (array_key_exists($k, $data)) { if (array_key_exists($k, $data)) {
$config[$k] = $data[$k]; $config[$k] = trim($data[$k]);
} }
} }
$data = var_export($config, 1); $data = var_export($config, 1);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@ Route::get('/', function (Request $request) {
}); });
//TODO:: 兼容 //TODO:: 兼容
Route::get('/' . config('v2board.secure_path', config('v2board.frontend_admin_path', crc32(config('app.key')))), function () { Route::get('/' . config('v2board.secure_path', config('v2board.frontend_admin_path', hash('crc32b', config('app.key')))), function () {
return view('admin', [ return view('admin', [
'title' => config('v2board.app_name', 'V2Board'), 'title' => config('v2board.app_name', 'V2Board'),
'theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'), 'theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'),