diff --git a/.github/tests/test_ci_contracts.py b/.github/tests/test_ci_contracts.py index cd3544384..577be211c 100644 --- a/.github/tests/test_ci_contracts.py +++ b/.github/tests/test_ci_contracts.py @@ -75,6 +75,19 @@ def test_frontend_ci_commands_exist_in_every_project(framework: str, target: str assert required <= package['scripts'].keys() +@pytest.mark.parametrize('framework', ['vue2', 'vue3']) +def test_web_svg_assets_match_across_frameworks(framework: str) -> None: + """三端独立打包的 SVG 应有相同的相对路径和文件内容。""" + frontend = ROOT / 'ruoyi-fastapi-frontend' + reference = frontend / 'react/web/src/assets' + assets = frontend / framework / 'web/src/assets' + expected = {path.relative_to(reference) for path in reference.rglob('*.svg')} + assert expected + assert {path.relative_to(assets) for path in assets.rglob('*.svg')} == expected + for path in sorted(expected): + assert (assets / path).read_bytes() == (reference / path).read_bytes(), f'{framework}: {path}' + + @pytest.mark.parametrize('component', ['build', 'nginx', 'backend']) def test_compose_rejects_mixed_framework_deployment(configuration: dict[str, Any], component: str) -> None: """前端、nginx 或后端混用框架时拒绝部署配置。""" diff --git a/ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/frontend_vue2.py b/ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/frontend_vue2.py index a334ae5fc..d14ed70e1 100644 --- a/ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/frontend_vue2.py +++ b/ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/frontend_vue2.py @@ -39,14 +39,14 @@ def build_crud_view(plugin_id: str) -> str: class_name = PluginScaffoldNaming.to_class_name(plugin_id) return f"""