14 lines
340 B
Bash
14 lines
340 B
Bash
|
|
#!/bin/bash
|
||
|
|
# 查找并终止占用 5173 端口的进程
|
||
|
|
PORT=5173
|
||
|
|
PID=$(netstat -ano | grep ":$PORT" | grep LISTENING | awk '{print $NF}')
|
||
|
|
if [ ! -z "$PID" ]; then
|
||
|
|
echo "终止占用端口 $PORT 的进程 (PID: $PID)"
|
||
|
|
taskkill //F //PID $PID
|
||
|
|
fi
|
||
|
|
|
||
|
|
# 启动前端
|
||
|
|
echo "启动前端服务..."
|
||
|
|
cd reading-platform-frontend
|
||
|
|
npm run dev
|