- 端口修复
This commit is contained in:
@@ -19,7 +19,7 @@ pub fn run() {
|
||||
// 等待 HTTP 服务器就绪后再打开窗口
|
||||
for i in 0..50 {
|
||||
if let Ok(mut s) = std::net::TcpStream::connect_timeout(
|
||||
&"127.0.0.1:8000".parse().unwrap(),
|
||||
&"127.0.0.1:10801".parse().unwrap(),
|
||||
Duration::from_millis(500),
|
||||
) {
|
||||
// 发送一个简单的 HTTP 请求测试
|
||||
|
||||
@@ -121,13 +121,13 @@ pub async fn start() {
|
||||
let state = AppState::new();
|
||||
let app = create_router(state);
|
||||
|
||||
println!("🚀 大屏媒体轮播系统启动于 http://0.0.0.0:8000");
|
||||
println!(" - 管理后台: http://localhost:8000/admin");
|
||||
println!(" - 大屏展示: http://localhost:8000/screen");
|
||||
println!("🚀 大屏媒体轮播系统启动于 http://0.0.0.0:10801");
|
||||
println!(" - 管理后台: http://localhost:10801/admin");
|
||||
println!(" - 大屏展示: http://localhost:10801/screen");
|
||||
|
||||
let listener = tokio::net::TcpListener::bind("0.0.0.0:8000")
|
||||
let listener = tokio::net::TcpListener::bind("0.0.0.0:10801")
|
||||
.await
|
||||
.expect("无法绑定 0.0.0.0:8000,请检查端口是否被占用");
|
||||
.expect("无法绑定 0.0.0.0:10801,请检查端口是否被占用");
|
||||
axum::serve(listener, app)
|
||||
.await
|
||||
.expect("服务器启动失败");
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"version": "0.1.0",
|
||||
"identifier": "com.pine.dpm",
|
||||
"build": {
|
||||
"beforeDevCommand": "TAURI_DEV_HOST=0.0.0.0 yarn dev",
|
||||
"beforeDevCommand": "yarn dev",
|
||||
"devUrl": "http://localhost:1420",
|
||||
"beforeBuildCommand": "yarn build",
|
||||
"frontendDist": "../dist"
|
||||
|
||||
Reference in New Issue
Block a user