初始化询价智能体新仓:同步本地工程并排除密钥与 .env。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-09-13 14:30:44 +08:00
co-authored by Cursor
commit 2a14def882
2621 changed files with 393165 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
$ErrorActionPreference = 'Stop'
Get-Content 'E:\wwwroot\.env' | ForEach-Object {
$line = $_.Trim()
if (-not $line -or $line.StartsWith('#')) { return }
$i = $line.IndexOf('=')
if ($i -lt 1) { return }
Set-Item -Path ("Env:" + $line.Substring(0, $i).Trim()) -Value $line.Substring($i + 1).Trim().Trim('"')
}
$mysql = 'C:\yutongda\tools\mysql-8.0.39-winx64\bin\mysql.exe'
$file = 'C:\Users\ytd_extdev_0903\incoming\inquiry_admin_menu_seed_slim_v1.sql'
& $mysql -h 127.0.0.1 -P 3306 -u $env:MYSQL_USER "--password=$env:MYSQL_PASSWORD" --default-character-set=utf8mb4 inquiry_robot -e "source $($file.Replace('\','/'))"
if ($LASTEXITCODE -ne 0) { throw "seed failed $LASTEXITCODE" }
& $mysql -h 127.0.0.1 -P 3306 -u $env:MYSQL_USER "--password=$env:MYSQL_PASSWORD" inquiry_robot -e "SELECT COUNT(*) AS tickets FROM inq_ticket; SELECT COUNT(*) AS menus FROM sys_permission WHERE id LIKE 'b100%';"
Write-Host 'SEED_OK'