refactor: 重构文件存储路径并清理冗余代码
- 将项目文件存储从 public/uploads 迁移至项目根目录专用目录 - 更新所有前端页面的路径提示文本与API请求路径 - 移除冗余的列车详情展开收起功能及相关代码 - 重构服务器端文件路径处理逻辑,增强路径访问安全性 - 清理旧注释和未使用的变量与函数
This commit is contained in:
@@ -397,7 +397,7 @@
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-subtitle">对 uploads/list.txt 进行增删改;每条记录格式:站号==音频文件1,音频文件2,... (支持多个站号用 / 分隔)</div>
|
||||
<div class="panel-subtitle">对 /opt/CC-StationBroadcast/list.txt 进行增删改;每条记录格式:站号==音频文件1,音频文件2,... (支持多个站号用 / 分隔)</div>
|
||||
<div class="toolbar">
|
||||
<button class="btn" onclick="openAddModal()">添加</button>
|
||||
<div style="display:flex; gap:10px; flex-wrap:wrap;">
|
||||
@@ -545,7 +545,7 @@
|
||||
}
|
||||
|
||||
async function loadList() {
|
||||
const res = await fetch('/api/files/content?path=uploads/list.txt');
|
||||
const res = await fetch('/api/files/content?path=list.txt');
|
||||
const data = await res.json();
|
||||
listData = [];
|
||||
if (data.success && data.content) {
|
||||
@@ -704,7 +704,7 @@
|
||||
const res = await fetch('/api/files/content', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ path: 'uploads/list.txt', content: content + '\n' })
|
||||
body: JSON.stringify({ path: 'list.txt', content: content + '\n' })
|
||||
});
|
||||
const data = await res.json();
|
||||
if (!data.success) throw new Error(data.message || 'Save failed');
|
||||
|
||||
Reference in New Issue
Block a user