mirror of
https://github.com/lsky-org/lsky-pro.git
synced 2025-01-07 03:16:46 +08:00
改进升级方式
This commit is contained in:
parent
c46207c278
commit
62809f5300
@ -115,13 +115,9 @@ class UpgradeService
|
||||
$version = $this->getVersions()->first()['name'];
|
||||
Config::query()->where('name', ConfigKey::AppVersion)->update(['value' => $version]);
|
||||
// 执行数据库迁移
|
||||
Artisan::call('migrate');
|
||||
// 清除配置缓存
|
||||
Cache::forget('configs');
|
||||
Artisan::call('migrate', ['--seed' => true]);
|
||||
// 清除缓存
|
||||
Artisan::call('route:clear');
|
||||
Artisan::call('cache:clear');
|
||||
Artisan::call('view:clear');
|
||||
Artisan::call('optimize:clear');
|
||||
Artisan::call('package:discover');
|
||||
} catch (\Throwable $e) {
|
||||
Utils::e($e, '升级失败');
|
||||
|
@ -18,7 +18,7 @@ use App\Enums\Watermark\Mode;
|
||||
return [
|
||||
'app' => [
|
||||
ConfigKey::AppName => 'Lsky Pro',
|
||||
ConfigKey::AppVersion => 'V 2.0.5',
|
||||
ConfigKey::AppVersion => 'V 2.1',
|
||||
ConfigKey::SiteKeywords => 'Lsky Pro,lsky,兰空图床',
|
||||
ConfigKey::SiteDescription => 'Lsky Pro, Your photo album on the cloud.',
|
||||
ConfigKey::SiteNotice => '',
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Config;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
@ -13,6 +14,10 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
// $this->call([]);
|
||||
// 初始化系统默认配置
|
||||
foreach (config('convention.app') as $key => $value) {
|
||||
$content = is_array($value) ? json_encode($value, JSON_UNESCAPED_UNICODE) : $value;
|
||||
Config::query()->firstOrCreate(['name' => $key], ['value' => $content]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user