mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-04 19:49:16 +00:00
⚙️change demo settings
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ class SystemController extends Controller
|
||||
}
|
||||
|
||||
// 演示环境禁止修改特定配置项
|
||||
if (config('app.demo')) {
|
||||
if (config('app.env') === 'demo') {
|
||||
$denyConfig = [
|
||||
'website_url',
|
||||
'is_captcha',
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ return [
|
||||
*/
|
||||
|
||||
'debug' => (bool) env('APP_DEBUG', false),
|
||||
'demo' => (bool) env('APP_DEMO', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user