mirror of
https://github.com/lsky-org/lsky-pro.git
synced 2025-01-08 11:57:52 +08:00
改进升级方式
This commit is contained in:
parent
c46207c278
commit
62809f5300
@ -115,13 +115,9 @@ class UpgradeService
|
|||||||
$version = $this->getVersions()->first()['name'];
|
$version = $this->getVersions()->first()['name'];
|
||||||
Config::query()->where('name', ConfigKey::AppVersion)->update(['value' => $version]);
|
Config::query()->where('name', ConfigKey::AppVersion)->update(['value' => $version]);
|
||||||
// 执行数据库迁移
|
// 执行数据库迁移
|
||||||
Artisan::call('migrate');
|
Artisan::call('migrate', ['--seed' => true]);
|
||||||
// 清除配置缓存
|
|
||||||
Cache::forget('configs');
|
|
||||||
// 清除缓存
|
// 清除缓存
|
||||||
Artisan::call('route:clear');
|
Artisan::call('optimize:clear');
|
||||||
Artisan::call('cache:clear');
|
|
||||||
Artisan::call('view:clear');
|
|
||||||
Artisan::call('package:discover');
|
Artisan::call('package:discover');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
Utils::e($e, '升级失败');
|
Utils::e($e, '升级失败');
|
||||||
|
@ -18,7 +18,7 @@ use App\Enums\Watermark\Mode;
|
|||||||
return [
|
return [
|
||||||
'app' => [
|
'app' => [
|
||||||
ConfigKey::AppName => 'Lsky Pro',
|
ConfigKey::AppName => 'Lsky Pro',
|
||||||
ConfigKey::AppVersion => 'V 2.0.5',
|
ConfigKey::AppVersion => 'V 2.1',
|
||||||
ConfigKey::SiteKeywords => 'Lsky Pro,lsky,兰空图床',
|
ConfigKey::SiteKeywords => 'Lsky Pro,lsky,兰空图床',
|
||||||
ConfigKey::SiteDescription => 'Lsky Pro, Your photo album on the cloud.',
|
ConfigKey::SiteDescription => 'Lsky Pro, Your photo album on the cloud.',
|
||||||
ConfigKey::SiteNotice => '',
|
ConfigKey::SiteNotice => '',
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\Config;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
class DatabaseSeeder extends Seeder
|
class DatabaseSeeder extends Seeder
|
||||||
@ -13,6 +14,10 @@ class DatabaseSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run()
|
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