- Region 表新增热度列,热门省份优先显示 - 区县下拉按地级市分组、已录区县优先、支持全省搜索 - 组选择内置一组至二十组 - 银行卡号独立行+粗体预览,开户行独立行 - 新增农户类型:农户/个体户/合作社/经营集体/公司 - 身份证正反面支持高拍仪/摄像头OCR与手机扫码上传,附件存本地/OSS - 新增农户头像采集组件(摄像头/本地上传),预留人脸识别收购扩展 - 同名村弹窗提醒(防选错乡镇) - 编辑窗体禁止遮罩/Esc误关,整体加宽适配高频操作 - 修复二维码局域网手机无法访问(监听0.0.0.0、局域网IP识别、Vite代理兜底)
42 lines
2.8 KiB
PowerShell
42 lines
2.8 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
$body = '{"username":"admin","password":"123456"}'
|
|
$r = Invoke-RestMethod -Uri 'http://localhost:5246/api/auth/login' -Method Post -ContentType 'application/json' -Body $body
|
|
$token = $r.token
|
|
$h = @{ Authorization = "Bearer $token"; 'Content-Type' = 'application/json' }
|
|
|
|
Write-Output '== 创建农户1(四川锦江区) =='
|
|
$f1 = @{
|
|
name = '测试农户一'; idCard = '511302199001011234'; gender = '男'; phone = '138 1234 5678'
|
|
province = '四川省'; county = '锦江区'; township = '春熙路街道'; village = '水井坊村'; groupName = '3组'
|
|
address = '锦江区某路1号'; bankName = '中国农业银行'; bankAccount = '622848 0408 1234 5678'
|
|
creditScore = 85; status = 'Active'; notes = '四级地区+银行+手机号测试'
|
|
} | ConvertTo-Json
|
|
$c1 = Invoke-RestMethod -Uri 'http://localhost:5246/api/farmers' -Method Post -Headers $h -Body $f1
|
|
$c1 | ConvertTo-Json -Compress
|
|
|
|
Write-Output '== 创建农户2(广西平南县) =='
|
|
$f2 = @{
|
|
name = '测试农户二'; idCard = '452122199001012345'; gender = '女'; phone = '13911110002'
|
|
province = '广西壮族自治区'; county = '平南县'; township = '大安镇'; village = '稻香村'; groupName = '5组'
|
|
address = '平南县大安镇稻香村'; bankName = ''; bankAccount = ''
|
|
creditScore = 80; status = 'Active'; notes = ''
|
|
} | ConvertTo-Json
|
|
$c2 = Invoke-RestMethod -Uri 'http://localhost:5246/api/farmers' -Method Post -Headers $h -Body $f2
|
|
$c2 | ConvertTo-Json -Compress
|
|
|
|
Write-Output '== 村列表(按锦江区/春熙路街道) =='
|
|
(Invoke-RestMethod -Uri 'http://localhost:5246/api/regions/villages?county=%E9%94%A6%E6%B1%9F%E5%8C%BA&township=%E6%98%A5%E7%86%99%E8%B7%AF%E8%A1%97%E9%81%93' -Headers $h) -join ', '
|
|
Write-Output '== 组列表(按锦江区/春熙路街道/水井坊村) =='
|
|
(Invoke-RestMethod -Uri 'http://localhost:5246/api/regions/groups?county=%E9%94%A6%E6%B1%9F%E5%8C%BA&township=%E6%98%A5%E7%86%99%E8%B7%AF%E8%A1%97%E9%81%93&village=%E6%B0%B4%E4%BA%95%E5%9D%8A%E6%9D%91' -Headers $h) -join ', '
|
|
Write-Output '== 乡镇列表(锦江区,含农户补充) =='
|
|
(Invoke-RestMethod -Uri 'http://localhost:5246/api/regions/townships?county=%E9%94%A6%E6%B1%9F%E5%8C%BA' -Headers $h) -join ', '
|
|
|
|
Write-Output '== 列表按县筛选(平南县) =='
|
|
$list = Invoke-RestMethod -Uri 'http://localhost:5246/api/farmers?county=%E5%B9%B3%E5%8D%97%E5%8E%BF&page=1&pageSize=10' -Headers $h
|
|
"total=$($list.total)"
|
|
$list.items | ForEach-Object { "$($_.name) | $($_.province)/$($_.county)/$($_.township)/$($_.village)/$($_.groupName) | $($_.phone) | $($_.bankAccount)" }
|
|
|
|
Write-Output '== /farmers/all 新字段 =='
|
|
$all = Invoke-RestMethod -Uri 'http://localhost:5246/api/farmers/all?limit=5' -Headers $h
|
|
$all | ForEach-Object { "$($_.name) | province=$($_.province) county=$($_.county) township=$($_.township) village=$($_.village) groupName=$($_.groupName)" }
|