Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit 0db5716

Browse files
committed
fix: cannot enable db
1 parent 61a5397 commit 0db5716

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/controller/Install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ public function install(Request $request)
143143
}
144144

145145
Setting::updateConfig([
146+
'db' => $USING_DB == 'true' ? true : false,
146147
'program_version' => Index::$version,
147148
'admin_password' => $ADMIN_PASSWORD,
148-
'db' => $USING_DB == 'true',
149149
], true);
150150

151151
return json([

app/controller/admin/Setting.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Setting extends BaseController
1515
'admin_password' => ['管理员密码', 'text', '后台管理密码,若为空,则无法进入后台管理,否则输入正确密码才能进入后台管理'],
1616
'password' => ['首页密码', 'text', '首页解析使用的密码,留空则无密码'],
1717

18-
// 'db' => ['是否启用数据库', 'radio', '若启用,则会将解析记录保存到数据库中,否则将不会被保存,如不启用数据库,也无法使用后台管理、限制次数和流量等功能。'],
18+
'db' => ['是否启用数据库', 'readonly', '若启用,则会将解析记录保存到数据库中,否则将不会被保存,如不启用数据库,也无法使用后台管理、限制次数和流量等功能。'],
1919
'link_expired_time' => ['链接有效期', 'number', '链接有效期,单位为小时'],
2020
'times' => ['解析次数', 'number', '解析次数,单IP每日限制解析次数'],
2121
'flow' => ['解析流量', 'number', '解析流量,单IP每日限制解析流量,单位为GB'],
@@ -88,6 +88,8 @@ public static function updateConfig($data, $force = false)
8888
}
8989
if (self::$setting[$key][1] == 'readonly') {
9090
if (!$force) continue;
91+
if ($value === 'true') $value = true;
92+
if ($value === 'false') $value = false;
9193
}
9294
$config[$key] = $value;
9395
}

0 commit comments

Comments
 (0)