⚙️change demo settings

This commit is contained in:
BrettonYe
2023-07-08 16:18:17 +08:00
parent 4a4afa7ae6
commit c6d0f92094
5 changed files with 4 additions and 5 deletions

View File

@@ -22,7 +22,7 @@ class PanelUpdate extends Command
$this->line(' 更新数据库...');
Artisan::call('migrate --force');
if (config('app.demo') && $this->confirm('检测到您在DEMO模式, 是否重置数据库?')) {
if (config('app.env') === 'demo' && $this->confirm('检测到您在DEMO模式, 是否重置数据库?')) {
Artisan::call('migrate:fresh --seed --force');
}

View File

@@ -152,7 +152,7 @@ class SystemController extends Controller
}
// 演示环境禁止修改特定配置项
if (config('app.demo')) {
if (config('app.env') === 'demo') {
$denyConfig = [
'website_url',
'is_captcha',

View File

@@ -241,7 +241,7 @@ class UserController extends Controller
// 非演示环境才可以修改管理员密码
$password = $request->input('password');
if (! empty($password) && ! (config('app.demo') && $user->id === 1)) {
if (! empty($password) && (config('app.env') !== 'demo' || $user->id !== 1)) {
$data['password'] = $password;
}

View File

@@ -158,7 +158,7 @@ class UserController extends Controller
}
// 演示环境禁止改管理员密码
if ($user->id === 1 && config('app.demo')) {
if ($user->id === 1 && config('app.env') === 'demo') {
return Redirect::back()->withErrors(trans('auth.password.reset.error.demo'));
}

View File

@@ -43,7 +43,6 @@ return [
*/
'debug' => (bool) env('APP_DEBUG', false),
'demo' => (bool) env('APP_DEMO', false),
/*
|--------------------------------------------------------------------------