删除不再使用的文件和配置,优化项目结构以提升可维护性;新增环境变量配置示例,更新 Docker 和部署相关文件以支持灵活的端口设置;重构数据库连接逻辑,增强错误处理和配置管理,确保更好的兼容性和稳定性。
This commit is contained in:
@@ -10,17 +10,7 @@ export function BottomNav() {
|
||||
const [matchEnabled, setMatchEnabled] = useState(false) // 默认隐藏,等配置加载后再显示
|
||||
const [configLoaded, setConfigLoaded] = useState(false) // 配置是否已加载
|
||||
|
||||
// 在文档页面、管理后台、阅读页面和关于页面不显示底部导航
|
||||
if (
|
||||
pathname.startsWith("/documentation") ||
|
||||
pathname.startsWith("/admin") ||
|
||||
pathname.startsWith("/read") ||
|
||||
pathname.startsWith("/about")
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
// 加载功能配置
|
||||
// 加载功能配置(必须在所有条件判断之前)
|
||||
useEffect(() => {
|
||||
const loadConfig = async () => {
|
||||
try {
|
||||
@@ -41,6 +31,16 @@ export function BottomNav() {
|
||||
loadConfig()
|
||||
}, [])
|
||||
|
||||
// 在文档页面、管理后台、阅读页面和关于页面不显示底部导航(必须在所有 hooks 之后)
|
||||
if (
|
||||
pathname.startsWith("/documentation") ||
|
||||
pathname.startsWith("/admin") ||
|
||||
pathname.startsWith("/read") ||
|
||||
pathname.startsWith("/about")
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
const navItems = [
|
||||
{ href: "/", icon: Home, label: "首页" },
|
||||
{ href: "/chapters", icon: List, label: "目录" },
|
||||
|
||||
Reference in New Issue
Block a user