Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
remove: setting config
Browse files Browse the repository at this point in the history
  • Loading branch information
yuantuo666 committed Sep 27, 2023
1 parent 6fdf82b commit df41825
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Thumbs.db
/.project
public/update.json
bdwp.db
config/baiduwp.php
5 changes: 5 additions & 0 deletions app/controller/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ public function install(Request $request)
]);
}
}

Setting::updateConfig([
'program_version' => Index::$version,
], true);

return json([
'error' => 0,
'msg' => 'success',
Expand Down
18 changes: 17 additions & 1 deletion app/controller/admin/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,23 @@ public function update(Request $request)
}
public static function updateConfig($data, $force = false)
{
$config = config('baiduwp');
$default = [
'site_name' => 'PanDownload',
'program_version' => \app\controller\Index::$version,
'password' => '',
'admin_password' => env('ADMIN_PASSWORD'),
'db' => env('DB', false),
'link_expired_time' => 8,
'times' => 20,
'flow' => 10,
'check_speed_limit' => true,
'random_account' => false,
'cookie' => '',
'svip_cookie' => '',
'footer' => '',
];

$config = config('baiduwp', $default);
foreach ($data as $key => $value) {
if (array_key_exists($key, self::$setting)) {
if (self::$setting[$key][1] == 'number') {
Expand Down
21 changes: 0 additions & 21 deletions config/baiduwp.php

This file was deleted.

0 comments on commit df41825

Please sign in to comment.