From 6b01a13288167075c57969f39c358f99b62e0291 Mon Sep 17 00:00:00 2001 From: Karson Date: Tue, 1 Jul 2025 22:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Install.php | 6 +++--- application/admin/command/Install/fastadmin.sql | 2 +- application/common/library/token/driver/Mysql.php | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/application/admin/command/Install.php b/application/admin/command/Install.php index 0f1f8072..ba649ddd 100644 --- a/application/admin/command/Install.php +++ b/application/admin/command/Install.php @@ -130,7 +130,7 @@ class Install extends Command $adminUsername = $this->request->post('adminUsername', 'admin'); $adminPassword = $this->request->post('adminPassword', ''); $adminPasswordConfirmation = $this->request->post('adminPasswordConfirmation', ''); - $adminEmail = $this->request->post('adminEmail', 'admin@admin.com'); + $adminEmail = $this->request->post('adminEmail', 'admin@example.com'); $siteName = $this->request->post('siteName', __('My Website')); if ($adminPassword !== $adminPasswordConfirmation) { @@ -251,8 +251,8 @@ class Install extends Command $avatar = '/assets/img/avatar.png'; // 变更默认管理员密码 - $adminPassword = $adminPassword ? $adminPassword : Random::alnum(8); - $adminEmail = $adminEmail ? $adminEmail : "admin@admin.com"; + $adminPassword = $adminPassword ?: Random::alnum(8); + $adminEmail = $adminEmail ?: "admin@example.com"; $newSalt = substr(md5(uniqid(true)), 0, 6); $newPassword = md5(md5($adminPassword) . $newSalt); $data = ['username' => $adminUsername, 'email' => $adminEmail, 'avatar' => $avatar, 'password' => $newPassword, 'salt' => $newSalt]; diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql index 0b16d3f0..0bf21aff 100755 --- a/application/admin/command/Install/fastadmin.sql +++ b/application/admin/command/Install/fastadmin.sql @@ -473,7 +473,7 @@ CREATE TABLE `fa_user` ( -- Records of fa_user -- ---------------------------- BEGIN; -INSERT INTO `fa_user` VALUES (1, 1, 'admin', 'admin', '', '', 'admin@163.com', '13000000000', '', 0, 0, '2017-04-08', '', 0, 0, 1, 1, 1491635035, 1491635035, '127.0.0.1', 0, 1491635035,'127.0.0.1', 1491635035, 0, 1491635035, '', 'normal',''); +INSERT INTO `fa_user` VALUES (1, 1, 'admin', 'admin', '', '', 'admin@example.com', '13000000000', '', 0, 0, '2017-04-08', '', 0, 0, 1, 1, 1491635035, 1491635035, '127.0.0.1', 0, 1491635035,'127.0.0.1', 1491635035, 0, 1491635035, '', 'normal',''); COMMIT; -- ---------------------------- diff --git a/application/common/library/token/driver/Mysql.php b/application/common/library/token/driver/Mysql.php index 379a1683..fc27e5f7 100644 --- a/application/common/library/token/driver/Mysql.php +++ b/application/common/library/token/driver/Mysql.php @@ -16,7 +16,6 @@ class Mysql extends Driver */ protected $options = [ 'table' => 'user_token', - 'expire' => 2592000, 'connection' => [], ];