refactor: 全面代码重构与项目结构整理

安全性:
- 所有SQL查询改用参数化查询(db_query),防止SQL注入
- TUSHARE_API_TOKEN集中到config.php常量,移除硬编码和多份拷贝
- getBasic.inc.php中$_REQUEST输出到JS时添加htmlspecialchars转义

代码组织:
- 21个页面文件移至charts/子目录,根目录仅保留入口文件
- ajax.inc.php拆分:esfTradeDaily/esfListDaily迁至getEstate.inc.php
- getBasic.inc.php拆分:HTML组件函数迁至新建的widgets.inc.php
- 前端依赖去重:移除lib/echarts.min.js、libai/3.4.16.js、research/js/3.4.16.js

规范化:
- AJAX响应格式统一为jsonResponse()标准封装
- 前端全局变量统一为window.chartConfig对象模式
- 修复PHP 8.4 Deprecated警告(getEstateData、getStockHistoryDataByTS参数顺序)
- html/head.php中jQuery/CSS路径改为绝对路径,修复charts/子目录加载问题

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-05-26 08:20:33 +08:00
co-authored by Claude Code
parent 07da6a2ad4
commit 7e57cae242
49 changed files with 848 additions and 733 deletions
+7 -6
View File
@@ -1,3 +1,4 @@
var cfg = window.chartConfig;
var dom = document.getElementById("container");
var myChart = echarts.init(dom,'dark');
var app = {};
@@ -5,8 +6,8 @@ option = null;
option = {
title: {
//text: legend[0]+' V.S '+legend[2],
text: headtxt,
//text: cfg.legend[0]+' V.S '+cfg.legend[2],
text: cfg.title,
//subtext: subtxt,
textAlign:'center',
left:'50%'
@@ -15,7 +16,7 @@ option = {
trigger: 'axis'
},
legend: {
data:legend,
data:cfg.legend,
right:'20'
},
grid: {
@@ -36,7 +37,7 @@ option = {
},
yAxis: [{
type: 'value',
name:legend[0], //图列
name:cfg.legend[0], //图列
show:true,
scale:true,
//min:190000,
@@ -61,11 +62,11 @@ option = {
}],
series: [
{
name:legend[0],
name:cfg.legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
data:data1,
data:cfg.data,
itemStyle:{normal:{label:{show:true}}}, //显示数字
}
]