Mingxiangyu
|
f6d52b90f0
|
修复:使用动态主机地址支持局域网内后端服务访问
Updated iframe source URLs to use the window's hostname instead of localhost.本次提交解决了局域网内其他设备无法正常访问后端服务的问题。此前前端代码中硬编码了localhost作为后端服务的主机地址,导致其他设备访问时,localhost会指向设备自身而非实际运行服务的主机,从而无法连接后端。
主要修改内容:
将前端中硬编码的localhost替换为window.location.hostname,动态获取当前页面的主机 IP(即运行服务的电脑局域网 IP)。
涉及修改的关键位置:
preloadIframes函数:预加载 iframe 时,使用动态主机地址生成后端服务 URL(如http://${window.location.hostname}:8501)。
performSearch函数:发送搜索请求时,同样使用动态主机地址构建请求 URL,确保后端接口调用正确指向服务主机。
注意事项:
为确保局域网访问正常,后端服务(运行在 8501、8502、8503 等端口)需配置为绑定到0.0.0.0(而非默认的localhost),以允许来自局域网的连接。例如,Python 服务可通过app.run(host='0.0.0.0', port=8501)启动。
效果:
修改后,局域网内其他设备通过服务主机的局域网 IP(如192.168.1.100)访问前端页面时,可自动正确连接到后端服务,实现跨设备正常使用。
|
2025-10-30 12:09:42 +08:00 |
|
666ghj
|
85b3769718
|
Front-end title modification.
|
2025-10-07 21:52:38 +08:00 |
|
666ghj
|
ba48e77c38
|
Remove forum host asynchronous strategy and simplify the process.
|
2025-09-16 20:47:02 +08:00 |
|
戒酒的李白
|
860cdb2f25
|
Fix simple word spelling errors.
|
2025-09-10 17:12:43 +08:00 |
|
戒酒的李白
|
e5e32ff6dc
|
The entire system has been largely completed.
|
2025-08-26 22:04:53 +08:00 |
|
戒酒的李白
|
11e8c85be6
|
Front-end style optimization.
|
2025-08-26 19:41:16 +08:00 |
|
戒酒的李白
|
3ca87c0502
|
Fix Bug.
|
2025-08-26 18:40:03 +08:00 |
|
戒酒的李白
|
f0788b64f3
|
The final report agent has been largely completed.
|
2025-08-26 17:34:36 +08:00 |
|
戒酒的李白
|
197e68f7ba
|
Optimize prompts.
|
2025-08-25 23:05:16 +08:00 |
|
戒酒的李白
|
34c7179af1
|
Forum function completed.
|
2025-08-25 21:08:42 +08:00 |
|
戒酒的李白
|
311e5d1390
|
Bug fix.
|
2025-08-25 17:08:19 +08:00 |
|
戒酒的李白
|
8c19173fe8
|
The front end of the forum has been basically implemented.
|
2025-08-25 16:57:56 +08:00 |
|
戒酒的李白
|
5b51ba8505
|
The interface of the forum has been initially set up.
|
2025-08-25 15:42:56 +08:00 |
|
戒酒的李白
|
6244d11685
|
The single-multi-agent framework has been initially completed.
|
2025-08-24 17:36:53 +08:00 |
|
戒酒的李白
|
4d90f56b42
|
Introduce the function of initially restoring the real-time output of console information.
|
2025-08-24 17:13:00 +08:00 |
|
戒酒的李白
|
4de9a33c1a
|
Fix BUG.
|
2025-08-24 16:53:54 +08:00 |
|
戒酒的李白
|
5d49063b26
|
Communication encoding bug fixed, all converted to UTF-8.
|
2025-08-24 15:41:58 +08:00 |
|
戒酒的李白
|
29dbc76044
|
The console on the right side of the web interface displays a height limit.
|
2025-08-24 15:30:56 +08:00 |
|
戒酒的李白
|
5b3f5a7b87
|
Web interface optimization.
|
2025-08-24 14:56:53 +08:00 |
|
戒酒的李白
|
611f0691a0
|
At the same time, activate the search function to achieve.
|
2025-08-24 14:26:16 +08:00 |
|
戒酒的李白
|
281c5834f6
|
Web app bug fix.
|
2025-08-24 14:20:56 +08:00 |
|
戒酒的李白
|
92537703f3
|
Initial setup of web app.
|
2025-08-24 02:05:56 +08:00 |
|