You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 lines
661 B

# 拉取线索四组字典的 item 编码列表
$base = "http://127.0.0.1:8081"
$token = (Get-Content "d:\code\crm-backend-matt\tmp\dt-token.txt" -Raw).Trim()
$h = @{ Authorization = "Bearer $token" }
$out = @()
foreach ($g in @("lead_source","brand","product","scene")) {
$r = Invoke-RestMethod -Method Get -Uri "$base/api/dict/item/enabled-list?groupCode=$g" -Headers $h -TimeoutSec 30
$out += "===== $g ($($r.data.Count) 项) ====="
$r.data | ForEach-Object { $out += (" {0}`t{1}" -f $_.code, $_.name) }
$out += ""
}
$out | Out-File -Encoding utf8 "d:\code\crm-backend-matt\tmp\dict-list-out.txt"
$out | ForEach-Object { Write-Output $_ }