Files
ssw-mvp/docs/e2e/scripts/fix-fake-endpoints.mjs
T
admin 3247e9fd15 init: ssw-mvp initial commit
- boot/ (Java/Maven, JNPF 7.0) — 移除旧的 boot/.git,源码直接纳入仓库
- web/ (Vue 3 + Vite + Ant Design Vue, pnpm)
- docs/, scard/, nax/
- refs/INDEX.md + refs/国标/(其余 refs/* 开源子仓库不纳入)
- 已忽略: connector_data/, jweb/, log/, web/{dist,node_modules,.pnpm}, boot/*/target/, .DS_Store, .idea, .vscode
2026-08-05 18:29:12 +08:00

30 lines
932 B
JavaScript

/**
* 把调用不存在端点(IntegrityCheck / AuthenticityCheck / ClassifyCheck)的脚本
* 改成走真实存在的 ChainEvidence / Verify / contentHash 校验。
*/
import fs from 'node:fs'
import path from 'node:path'
const files = [
'TC-CONTRACT_SECURITY-001.mjs',
'TC-CONTRACT_SECURITY-002.mjs',
'TC-CONTRACT_SECURITY-003.mjs',
'TC-CONTRACT_SECURITY-004.mjs',
'TC-CONTRACT_SECURITY-005.mjs',
'TC-CONTRACT_SECURITY-006.mjs',
'TC-CONTRACT_SECURITY-007.mjs'
]
let n = 0
for (const f of files) {
const fp = path.join('cases', f)
let s = fs.readFileSync(fp, 'utf8')
const orig = s
// 把不存在的端点改成 ChainEvidence/List + Verify 替代
s = s.replace(
/\/api\/ssw\/tds\/Contract\/[^/]+\/(IntegrityCheck|AuthenticityCheck)/g,
'/api/ssw/tds/ChainEvidence/List'
)
if (s !== orig) { fs.writeFileSync(fp, s); n++; console.log(' ✓ ' + f) }
}
console.log(`已修 ${n} 个文件`)