fix: 修复静态文件路径问题,将 static 目录移动到 public 下
Coze-Commit-Type: user Coze-User-ID: 3722323274763196 Coze-Conversation-ID: 9894087
This commit is contained in:
31
public/static/js/common.js
Normal file
31
public/static/js/common.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// 全局错误处理,防止JavaScript错误中断执行
|
||||
window.onerror = function(msg, url, line, col, error) {
|
||||
console.error('JavaScript错误:', msg, 'at', url, 'line:', line);
|
||||
return true; // 阻止错误传播
|
||||
};
|
||||
|
||||
let editingConfigId = null;
|
||||
let allFields = [];
|
||||
let currentPage = 1;
|
||||
const pageSize = 20;
|
||||
|
||||
// 切换标签页
|
||||
function switchTab(tabName, event) {
|
||||
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
|
||||
document.querySelectorAll('.tab-content').forEach(t => t.classList.remove('active'));
|
||||
|
||||
if (event && event.target) {
|
||||
event.target.classList.add('active');
|
||||
}
|
||||
document.getElementById(`${tabName}-tab`).classList.add('active');
|
||||
|
||||
if (tabName === 'config') {
|
||||
loadConfigs();
|
||||
} else if (tabName === 'generate') {
|
||||
loadGenerateConfigs();
|
||||
} else if (tabName === 'history') {
|
||||
loadHistory();
|
||||
}
|
||||
}
|
||||
|
||||
// 加载配置列表
|
||||
Reference in New Issue
Block a user