Browse Source

update: default secure path

tokumeikoi 2 years ago
parent
commit
b9f3838e3b

+ 2 - 2
app/Console/Commands/V2boardInstall.php

@@ -48,7 +48,7 @@ class V2boardInstall extends Command
             $this->info("  \ V /  / __/| |_) | (_) | (_| | | | (_| | ");
             $this->info("   \_/  |_____|____/ \___/ \__,_|_|  \__,_| ");
             if (\File::exists(base_path() . '/.env')) {
-                $defaultSecurePath = crc32(config('app.key'));
+                $defaultSecurePath = hash('crc32b', config('app.key'));
                 $this->info("访问 http(s)://你的站点/{$defaultSecurePath} 进入管理面板,你可以用户中心修改你的密码。");
                 abort(500, '如需重新安装请删除目录下.env文件');
             }
@@ -100,7 +100,7 @@ class V2boardInstall extends Command
             $this->info("管理员邮箱:{$email}");
             $this->info("管理员密码:{$password}");
 
-            $defaultSecurePath = crc32(config('app.key'));
+            $defaultSecurePath = hash('crc32b', config('app.key'));
             $this->info("访问 http(s)://你的站点/{$defaultSecurePath} 进入管理面板,你可以用户中心修改你的密码。");
         } catch (\Exception $e) {
             $this->error($e->getMessage());

+ 1 - 1
app/Http/Controllers/Admin/ConfigController.php

@@ -108,7 +108,7 @@ class ConfigController extends Controller
                 'register_limit_by_ip_enable' => (int)config('v2board.register_limit_by_ip_enable', 0),
                 'register_limit_count' => config('v2board.register_limit_count', 3),
                 'register_limit_expire' => config('v2board.register_limit_expire', 60),
-                'secure_path' => config('v2board.secure_path', config('v2board.frontend_admin_path', crc32(config('app.key'))))
+                'secure_path' => config('v2board.secure_path', config('v2board.frontend_admin_path', hash('crc32b', config('app.key'))))
             ],
             'subscribe' => [
                 'plan_change_enable' => (int)config('v2board.plan_change_enable', 1),

+ 1 - 1
routes/web.php

@@ -39,7 +39,7 @@ Route::get('/', function (Request $request) {
 });
 
 //TODO:: 兼容
-Route::get('/' . config('v2board.secure_path', config('v2board.frontend_admin_path', crc32(config('app.key')))), function () {
+Route::get('/' . config('v2board.secure_path', config('v2board.frontend_admin_path', hash('crc32b', config('app.key')))), function () {
     return view('admin', [
         'title' => config('v2board.app_name', 'V2Board'),
         'theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'),