Files
echart/continuation.md
T
simonandClaude Code 7e57cae242 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>
2026-05-26 08:20:33 +08:00

35 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Continuation
## 当前状态
全部重构任务完成,项目已稳定部署:
### 代码质量改造(9 项全部完成)
- **高优**: SQL 注入防护(参数化查询)、API Token 集中化、config.php 解密
- **中优**: ajax.inc.php 拆分、getBasic.inc.php 渲染函数分离、前端依赖去重
- **低优**: AJAX 响应格式统一、前端全局变量规范化、PHP 8.4 Deprecated 警告修复
### 项目结构整理
- 根目录仅保留 `index.php``index-2.php``phpinfo.php`
- 21 个页面文件移至 `charts/` 子目录,所有内部引用已更新
- 新增 `inc/widgets.inc.php`HTML 组件函数)
- `lib/echarts.min.js``libai/3.4.16.js``research/js/3.4.16.js` 已去重移除
### 环境配置
- PHP 8.4.21 安装于 `d:/software/php8.4/`
- Cursor settings 已更新(VS Code 路径、PHP 路径、终端 PATH
- Git 用户已设为 `Simon2046 / failsafe@163.com`
- `~/.bashrc``sync-echart` 部署函数
- 4 个受损文件(charts/*.php)的行末 `"` 字符已清理
## 后续步骤
1. 访问 `echart.doorcome.cn` 验证各页面功能正常
2. 重点验证改动较大的页面:realestate.php、estate 系列、stockTradeRecord.php
3. 如有需要,运行 `sync-echart` 部署最新改动
## 待解决问题
- `trade_rec()``$extra_where` 参数仍接收原始 SQL 片段(内部参数,非用户输入)
- 无自动化测试,所有验证依赖手动操作