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
+5 -5
View File
@@ -4,17 +4,17 @@ include_once __DIR__."/getBasic.inc.php"; //类外调用方法
class getFinance
{
private $url = "http://api.waditu.com";
private $token = '1bc28452ba375da19320cda845ae6307578964cb3ae473d0dc702aea';
public $ts_code = '002273.SZ'; //set ts_code default
public $httpjsonStr; //json string send to http_post_json
private $token;
public $ts_code = '002273.SZ';
public $httpjsonStr;
public $finDate;
public $preFinDate;
public $param = array();
private $unitFactor = 100000000; //单位因子,除以后单位亿
private $unitFactor = 100000000;
function __construct()
{
$this->token = TUSHARE_API_TOKEN;
$this->param['token'] = $this->token;
}
/**