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
+11 -10
View File
@@ -1,3 +1,4 @@
var cfg = window.chartConfig;
$(function (){
var dom = document.getElementById("container");
var myChart = echarts.init(dom,'dark');
@@ -5,9 +6,9 @@ $(function (){
var option = null;
option = {
title: {
//text: legend[0]+' V.S '+legend[2],
text: headtxt,
subtext: subtxt,
//text: cfg.legend[0]+' V.S '+cfg.legend[2],
text: cfg.title,
subtext: cfg.subtitle,
textAlign:'center',
left:'50%'
},
@@ -15,7 +16,7 @@ $(function (){
trigger: 'axis'
},
legend: {
data:legend,
data: cfg.legend,
right:'20'
},
grid: {
@@ -36,12 +37,12 @@ $(function (){
},
yAxis: [{
type: 'value',
name:legend[0], //图列
name: cfg.legend[0], //图列
show:true
},
{
type:'value',
name:legend[2]+unit, //图例
name: cfg.legend[2]+cfg.unit, //图例
//scale:true,
boundaryGap:false,
show:true,
@@ -69,19 +70,19 @@ $(function (){
}],
series: [
{
name:legend[0],
name: cfg.legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
data:data1
data: cfg.data
},
{
name:legend[2],
name: cfg.legend[2],
type:'line',
yAxisIndex:1,
symbol:'none', //数据圆点
smooth:false,
data: data2
data: cfg.data2
}
]
};