Commit e16169d0 by DaiJiezhang

Refine project configuration and phone dialog

- Update .gitignore rules

- Optimize phone-add-dialog component

- Refine API clients for phone and wechat modules

- Update start/stop batch scripts
parent 65b834c9
......@@ -13,3 +13,14 @@ localhost
wechat-page.png
backend/src/main/resources/application.yml
start-backend.bat
# Local JDK setup, IDE-generated repository notes, and test artifacts.
.qoder/
jdk17/
test-artifacts/
temurin17.msi
temurin17.zip
_fix_phone_image_cell.py
_sync_files.py
_write_phone_image_cell.py
start-backend-jdk17.bat
backend/.mvn/jvm.config
......@@ -7,7 +7,7 @@
<title>学有为资产管理台</title>
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='14' fill='%230f766e'/%3E%3Ctext x='50%25' y='55%25' text-anchor='middle' font-size='26' font-family='Arial' fill='white'%3EXY%3C/text%3E%3C/svg%3E" />
<link rel="stylesheet" href="node_modules/element-plus/dist/index.css" />
<link rel="stylesheet" href="styles-v2.css?v=20260708c" />
<link rel="stylesheet" href="styles-v2.css?v=20260720-fix-list" />
</head>
<body>
......
/**
* 代码作用(白话):把手机号接口能力挂载到页面共用对象,并统一使用本地后端 8888 端口;关联文件:F:/Project/xyw_console/src/modules/shared/wechat-api-client.js、F:/Project/xyw_console/start.bat;关联逻辑(调用链/消息链/数据流):页面模块 -> window.PhoneApiClient -> http://localhost:8888/api/wx-phones -> Spring Boot 后端。
*/
(function attachPhoneApiClient() {
const BASE_URL = 'http://localhost:8080/api/wx-phones';
const BASE_URL = 'http://localhost:8888/api/wx-phones';
/**
* 代码作用(白话):统一处理手机号接口返回,遇到后端报错时直接抛出明确错误,避免列表和弹窗各自重复判断;关联文件:F:/Project/xyw_console/app-v2.js、F:/Project/xyw_console/src/modules/phone/phone-list-runtime.js、F:/Project/xyw_console/src/modules/phone/phone-add-dialog.js;关联逻辑(调用链/消息链/数据流):listPhones()/savePhone()/deletePhone() -> parseJsonResponse() -> app-v2.js/手机号模块错误提示。
......
(function attachWechatApiClient() {
/**
* 代码作用(白话):把企微接口能力挂载到页面共用对象,并统一使用本地后端 8888 端口;关联文件:F:/Project/xyw_console/src/modules/shared/phone-api-client.js、F:/Project/xyw_console/start.bat;关联逻辑(调用链/消息链/数据流):企微页面 -> window.WechatApiClient -> http://localhost:8888/api/wechat-records -> Spring Boot 后端。
*/
(function attachWechatApiClient() {
// 当前企微资料接口对应测试数据库;后续切换到生产数据库(正式业务库)时,需要同步改成生产环境对应的后端配置。
const BASE_URL = 'http://localhost:8080/api/wechat-records';
const BASE_URL = 'http://localhost:8888/api/wechat-records';
/**
* 代码作用(白话):统一解析企微接口返回,保证前端只认 code/message/data 这一套结构;关联文件:F:/Project/xyw_console/app-v2.js、F:/Project/xyw_console/src/modules/wechat/wechat-add-dialog.js、F:/Project/xyw_console/src/modules/wechat/wechat-list-runtime.js;关联逻辑(调用链/消息链/数据流):listWechatRecords()/getWechatRecord()/saveWechatRecord() -> parseJsonResponse() -> 页面列表/弹窗提示。
......
......@@ -3,9 +3,11 @@ chcp 65001 >nul
set FRONTEND_PORT=8000
set FRONTEND_URL=http://localhost:%FRONTEND_PORT%
set BACKEND_URL=http://localhost:8080
REM Backend API requests use port 8888, matching backend/src/main/resources/application.yml.
set BACKEND_URL=http://localhost:8888
set FRONTEND_SCRIPT=%~dp0start-frontend.bat
set BACKEND_SCRIPT=%~dp0start-backend.bat
REM Use the JDK 17 launcher so one-click startup does not call the legacy JDK path.
set BACKEND_SCRIPT=%~dp0start-backend-jdk17.bat
echo ===================================================
echo [Starting Project]
......
......@@ -3,7 +3,8 @@ setlocal EnableExtensions EnableDelayedExpansion
chcp 65001 >nul
set "FRONTEND_PORT=8000"
set "BACKEND_PORT=8080"
REM Keep this port aligned with backend/src/main/resources/application.yml and start-backend-jdk17.bat.
set "BACKEND_PORT=8888"
echo ===================================================
echo [Stopping Project]
......@@ -21,8 +22,8 @@ exit /b
:stopByPort
REM Purpose: collect every listening PID on the target port and stop them one by one.
REM Related files: start-frontend.bat, start-backend.bat.
REM Related flow: stop.bat -> stopByPort -> killProcess -> release port 8000 or 8080.
REM Related files: start-frontend.bat, start-backend-jdk17.bat.
REM Related flow: stop.bat -> stopByPort -> killProcess -> release port 8000 or 8888.
set "TARGET_PORT=%~1"
set "TARGET_NAME=%~2"
set "FOUND_ANY=0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment