提取认证页共享自适应骨架
This commit is contained in:
@@ -31,6 +31,7 @@ function Assert-NotContains {
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$entryPath = Join-Path $root 'pages/auth/a01-entry.vue'
|
||||
$shellPath = Join-Path $root 'components/AuthPageShell.vue'
|
||||
$legacyLoginPath = Join-Path $root 'pages/auth/a02-login.vue'
|
||||
$pagesPath = Join-Path $root 'pages.json'
|
||||
$globalStylesPath = Join-Path $root 'styles/global.scss'
|
||||
@@ -54,20 +55,22 @@ if ($pages.pages.Count -ne 52) {
|
||||
}
|
||||
|
||||
$entry = Get-Content -LiteralPath $entryPath -Raw -Encoding utf8
|
||||
$shell = Get-Content -LiteralPath $shellPath -Raw -Encoding utf8
|
||||
$globalStyles = Get-Content -LiteralPath $globalStylesPath -Raw -Encoding utf8
|
||||
|
||||
# A01 owns content in normal document flow. Decorative artwork must not become
|
||||
# a second full-page coordinate system.
|
||||
foreach ($required in @(
|
||||
'class="auth-header"',
|
||||
'class="auth-header__image"',
|
||||
'class="auth-shell__header"',
|
||||
'class="auth-shell__header-image"',
|
||||
'a01-vnext-header-v1.png',
|
||||
'mode="widthFix"',
|
||||
'class="auth-paper"',
|
||||
'class="auth-shell__paper"',
|
||||
'auth-page-paper.jpg'
|
||||
)) {
|
||||
Assert-Contains -Content $entry -Expected $required -Message "A01 adaptive structure is missing: $required"
|
||||
Assert-Contains -Content $shell -Expected $required -Message "A01 adaptive shell is missing: $required"
|
||||
}
|
||||
Assert-Contains -Content $entry -Expected '<AuthPageShell' -Message 'A01 must consume the shared adaptive shell.'
|
||||
foreach ($forbidden in @(
|
||||
'class="page-canvas"',
|
||||
'class="page-backdrop"',
|
||||
@@ -77,11 +80,12 @@ foreach ($forbidden in @(
|
||||
'1665rpx'
|
||||
)) {
|
||||
Assert-NotContains -Content $entry -Unexpected $forbidden -Message "A01 still uses rejected page coordinates: $forbidden"
|
||||
Assert-NotContains -Content $shell -Unexpected $forbidden -Message "The adaptive shell uses rejected page coordinates: $forbidden"
|
||||
}
|
||||
|
||||
$pageRule = [regex]::Match($entry, '(?ms)^\.auth-page\s*\{(?<Body>.*?)^\}')
|
||||
$headerRule = [regex]::Match($entry, '(?ms)^\.auth-header\s*\{(?<Body>.*?)^\}')
|
||||
$paperRule = [regex]::Match($entry, '(?ms)^\.auth-paper\s*\{(?<Body>.*?)^\}')
|
||||
$pageRule = [regex]::Match($shell, '(?ms)^\.auth-shell\s*\{(?<Body>.*?)^\}')
|
||||
$headerRule = [regex]::Match($shell, '(?ms)^\.auth-shell__header\s*\{(?<Body>.*?)^\}')
|
||||
$paperRule = [regex]::Match($shell, '(?ms)^\.auth-shell__paper\s*\{(?<Body>.*?)^\}')
|
||||
$contentRule = [regex]::Match($entry, '(?ms)^\.login-content\s*\{(?<Body>.*?)^\}')
|
||||
foreach ($rule in @($pageRule, $headerRule, $paperRule, $contentRule)) {
|
||||
if (-not $rule.Success) { throw 'A01 adaptive layout rule is missing.' }
|
||||
@@ -126,7 +130,7 @@ Assert-Contains -Content $dividerRule.Groups['Body'].Value -Expected 'width: 280
|
||||
Assert-Contains -Content $dividerRule.Groups['Body'].Value -Expected 'height: 46rpx;' -Message 'A01 compact title divider must retain a legible knot and line weight.'
|
||||
Assert-Contains -Content $dividerRule.Groups['Body'].Value -Expected 'filter: brightness(0.68) saturate(1.5) contrast(1.2);' -Message 'A01 title divider must keep sufficient contrast against the paper background.'
|
||||
|
||||
$brandSealRule = [regex]::Match($entry, '(?ms)^\.brand-seal\s*\{(?<Body>.*?)^\}')
|
||||
$brandSealRule = [regex]::Match($shell, '(?ms)^\.auth-shell__seal\s*\{(?<Body>.*?)^\}')
|
||||
if (-not $brandSealRule.Success) {
|
||||
throw 'A01 is missing the brand seal style rule.'
|
||||
}
|
||||
@@ -153,7 +157,7 @@ foreach ($asset in @(
|
||||
'a02-agreement-unchecked.png',
|
||||
'a02-agreement-checked.png'
|
||||
)) {
|
||||
Assert-Contains -Content $entry -Expected $asset -Message "A01 is missing asset reference: $asset"
|
||||
Assert-Contains -Content ($entry + $shell) -Expected $asset -Message "A01 is missing asset reference: $asset"
|
||||
}
|
||||
foreach ($obsoleteVisualAsset in @(
|
||||
'auth-header.png',
|
||||
|
||||
Reference in New Issue
Block a user