Refactor mini program environment configuration and remove deprecated debug features

- Simplified the environment configuration in app.js by removing the debug environment options and related functions.
- Set a default API base URL for production while allowing commented options for local and testing environments.
- Cleaned up settings.js by removing the debug environment label and switching functionality, streamlining the user interface.
- Updated documentation to reflect the removal of debug features and added a summary of synchronization requirements in the planning document.
This commit is contained in:
Alex-larget
2026-03-16 13:30:05 +08:00
parent 0e7b81eaa8
commit e75092eaad
15 changed files with 915 additions and 209 deletions

View File

@@ -0,0 +1,20 @@
$ErrorActionPreference = "Stop"
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
$src = "C:\Users\29195\Mycontent\macos-vm\OneClick-macOS-Simple-KVM"
$dst = "C:\Users\29195\Mycontent\macos-vm\macos-vm-snapshot-$timestamp.zip"
Write-Host "打包目录: $src"
Write-Host "目标文件: $dst"
if (-not (Test-Path $src)) {
Write-Error "源目录不存在:$src"
}
if (Test-Path $dst) {
Remove-Item $dst -Force
}
Compress-Archive -Path $src -DestinationPath $dst -Force
Write-Host '打包完成.'

62
macos-vm/安装mac.bat Normal file
View File

@@ -0,0 +1,62 @@
@echo off
chcp 65001 >nul
title 安装 macOS 虚拟机(龙虾方案)
setlocal
echo ============================================
echo 安装 macOS 虚拟机WSL2 + QEMU + OneClick
echo ============================================
echo.
rem 1. 定位 Python 安装脚本(仓库内已有)
set "ROOT=%~dp0.."
set "PY_SCRIPT=%ROOT%开发文档\服务器管理\scripts\lobster_macos_vm.py"
if not exist "%PY_SCRIPT%" (
echo [错误] 找不到 Python 安装脚本:
echo %PY_SCRIPT%
echo 请确认仓库已完整同步。
pause
exit /b 1
)
rem 2. 检查 Python
where python >nul 2>&1
if errorlevel 1 (
where py >nul 2>&1
if errorlevel 1 (
echo [错误] 未检测到 Python 3请先安装 Python 3 再运行本脚本。
echo 将打开 Python 官网下載頁面,請安裝完後重新運行本腳本。
start "" "https://www.python.org/downloads/windows/"
pause
exit /b 1
)
)
rem 3. 检查 / 引导安装 TightVNC
echo [1] 检查 TightVNC Viewer ...
set "TVN=%ProgramFiles%\TightVNC\tvnviewer.exe"
if not exist "%TVN%" set "TVN=%ProgramFiles(x86)%\TightVNC\tvnviewer.exe"
if exist "%TVN%" (
echo 已检测到 TightVNC: %TVN%
) else (
echo 未检测到 TightVNC將打開官網請手動下載並安裝。
start "" "https://www.tightvnc.com/download.php"
)
echo.
echo [2] 開始調用 Python 腳本,一鍵安裝 macOS 虛擬機 ...
echo 腳本將檢查 WSL/Ubuntu、下載 OneClick、安裝 QEMU、下載 macOS 恢復鏡像等。
echo.
python "%PY_SCRIPT%" || py -3 "%PY_SCRIPT%"
echo.
echo [3] 安裝流程結束(若上方無紅色錯誤信息,即表示完成)。
echo 之後可使用同目錄下的「一键启动-macOS虚拟机.bat」啟動虛擬機。
echo ============================================
echo.
pause

View File

@@ -0,0 +1,57 @@
@echo off
chcp 65001 >nul
title 迁移 macOS 虚拟机 到 E:\Gongsi\Mycontent\macos-vm
echo ============================================
echo 迁移 macOS 虚拟机目录 到 E:\Gongsi\Mycontent\macos-vm
echo ============================================
echo.
setlocal
set "SRC=C:\Users\%USERNAME%\Mycontent\macos-vm"
set "DST=E:\Gongsi\Mycontent\macos-vm"
echo [1] 源目录: %SRC%
echo [1] 目标目录: %DST%
echo.
if not exist "%SRC%" (
echo [错误] 未找到源目录: %SRC%
echo 请确认当前用户下已存在 macos-vm 目录。
pause
exit /b 1
)
rem 尝试关闭正在运行的 QEMU通过 WSL
echo [2] 尝试关闭正在运行的 macOS 虚拟机(如有)...
wsl -d Ubuntu-24.04 -e bash -lc "ps -ef | grep qemu-system-x86_64 | grep -v grep || true" >nul 2>&1
for /f "tokens=2" %%P in ('wsl -d Ubuntu-24.04 -e bash -lc "ps -ef | grep qemu-system-x86_64 | grep -v grep || true" ^| find "qemu-system-x86_64"') do (
echo 检测到 QEMU 进程 PID=%%P正在尝试结束...
wsl -d Ubuntu-24.04 -e bash -lc "sudo kill -TERM %%P; sleep 2; ps -p %%P >/dev/null && sudo kill -KILL %%P || true" >nul 2>&1
)
echo [3] 创建目标目录(如不存在)...
mkdir "%DST%" 2>nul
echo [4] 使用 robocopy 迁移所有文件(可能需要一段时间)...
echo.
robocopy "%SRC%" "%DST%" /MIR
if errorlevel 8 (
echo.
echo [警告] robocopy 返回代码 %errorlevel%>=8可能有错误請檢查上方輸出。
echo 不會自動刪除源目錄,請手動確認。
pause
exit /b 1
)
echo.
echo [5] 迁移完成。
echo 源目录: %SRC%
echo 目标目录: %DST%
echo.
echo 如確認新位置可以正常啟動虛擬機,可手動刪除源目錄以釋放 C 盤空間。
echo ============================================
pause