/** * 功能:静态检查用户地址列表的账户名称展示、标识降级与复制入口。 * 版本:v1.0.0 */ import { readFileSync } from 'node:fs'; import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; const appRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..'); function source(path) { return readFileSync(resolve(appRoot, path), 'utf8'); } function expectIncludes(content, marker, message) { if (!content.includes(marker)) throw new Error(`用户地址展示检查失败:${message}`); } const resources = source('src/api/resources.ts'); const listPage = source('src/views/shared/CrudListPage.vue'); const relationName = source('src/views/shared/RelationNameText.vue'); const fieldDisplay = source('src/views/shared/resource-list-field-display.ts'); expectIncludes(resources, "listLabel: '用户账户'", '列表列名未改为用户账户'); expectIncludes(resources, 'listRelationNameOnly: true', '用户地址未启用账户名称展示'); expectIncludes(listPage, '