完成70%

This commit is contained in:
2026-07-24 07:56:22 +08:00
parent bb6431b319
commit c7f278fe79
92 changed files with 4741 additions and 14440 deletions
+25 -5
View File
@@ -9,7 +9,7 @@ $contracts = [ordered]@{
'pages/profile/m03-security-settings.vue' = @('securityItems', 'openSecurityItem', 'device-state--limited', 'checkSecurity', 'routeKey: "M04"', 'routeKey: "M05"')
'pages/profile/m04-change-password.vue' = @('passwordForm', 'validatePassword', 'togglePassword', 'savePassword', 'password-state--saving')
'pages/profile/m05-change-phone.vue' = @('phoneForm', 'sendCode', 'savePhone', 'phone-state--saving')
'pages/profile/m06-help-center.vue' = @('helpCategories', 'filteredQuestions', 'toggleQuestion', 'contactSupport', 'openPage("M07", {}, "M06")')
'pages/profile/m06-help-center.vue' = @('helpCategories', 'filteredQuestions', 'toggleQuestion', 'contactSupport', 'help-source-note', 'openPage("M07", {}, "M06")')
'pages/profile/m07-feedback.vue' = @('feedbackForm', 'feedbackTypes', 'validateFeedback', 'submitFeedback', 'feedback-state--submitting')
'pages/profile/m08-promotion.vue' = @('inviteState', 'openInviteExplanation', 'share-state--unavailable', 'explanationVisible')
'pages/profile/m09-vip-orders.vue' = @('serviceBenefits', 'orderState', 'order-state--unavailable', 'openServiceNotice')
@@ -22,7 +22,7 @@ foreach ($entry in $contracts.GetEnumerator()) {
foreach ($forbidden in @('uni.showToast', 'uni.showModal', 'uni.showLoading', 'uni.showActionSheet', 'uni.navigateTo', 'uni.navigateBack', 'uni.redirectTo', 'uni.reLaunch', 'getCurrentPages(', '/pages/')) {
if ($source.Contains($forbidden)) { throw "$($entry.Key) contains forbidden token: $forbidden" }
}
if ($entry.Key -ne 'pages/profile/m07-feedback.vue' -and $source.Contains('@/utils/api.js')) {
if ($entry.Key -notin @('pages/profile/m04-change-password.vue', 'pages/profile/m07-feedback.vue', 'pages/profile/m10-about-settings.vue') -and $source.Contains('@/utils/api.js')) {
throw "$($entry.Key) must not consume the API before its independent interface batch"
}
foreach ($required in @('ModulePageBackground', 'PageHeader', 'AppButton') + $entry.Value) {
@@ -39,8 +39,10 @@ $n01 = $sources['pages/notification/n01-message-center.vue']
$n02 = $sources['pages/notification/n02-message-detail.vue']
$m02 = $sources['pages/profile/m02-edit-profile.vue']
$m03 = $sources['pages/profile/m03-security-settings.vue']
$m04 = $sources['pages/profile/m04-change-password.vue']
$m08 = $sources['pages/profile/m08-promotion.vue']
$m10 = $sources['pages/profile/m10-about-settings.vue']
$m10 = $sources['pages/profile/m10-about-settings.vue']
if ($n01 -notmatch '(?s)openPage\(\s*"N02",\s*\{ id: String\(item\.id\) \},\s*"N01",?\s*\)') {
throw 'N01 must open N02 with only its registered lexical notice identity'
@@ -97,7 +99,6 @@ foreach ($formPath in @(
foreach ($previewContract in @(
@{ Path = 'pages/profile/m02-edit-profile.vue'; Retired = @('个人资料已保存') },
@{ Path = 'pages/profile/m04-change-password.vue'; Retired = @('密码已修改', 'passwordForm.current = ""', 'passwordForm.next = ""', 'passwordForm.confirm = ""') },
@{ Path = 'pages/profile/m05-change-phone.vue'; Retired = @('演示验证码已发送', '绑定手机号已更新', 'phoneForm.currentPhone =') }
)) {
$source = $sources[$previewContract.Path]
@@ -109,6 +110,25 @@ foreach ($previewContract in @(
}
}
foreach ($required in @(
'appApi.changePassword',
'calcMD5(passwordForm.current)',
'calcMD5(passwordForm.next)',
'createRequestController',
'passwordRequestController.abort()',
'isRequestCancelled(error)',
'确认修改密码'
)) {
if (-not $m04.Contains($required)) { throw "M04 declared password change contract missing: $required" }
}
foreach ($forbidden in @('校验新密码(不提交)', '本地校验通过,尚未提交服务器')) {
if ($m04.Contains($forbidden)) { throw "M04 must not retain local-only password change copy: $forbidden" }
}
foreach ($required in @('appApi.logout', 'logoutRequestController', 'session.clear();', 'return goRoot("A01");')) {
if (-not $m10.Contains($required)) { throw "M10 declared logout contract missing: $required" }
}
foreach ($dialogPath in @(
'pages/profile/m08-promotion.vue',
'pages/profile/m09-vip-orders.vue',
@@ -152,8 +172,8 @@ foreach ($forbiddenOrderPreview in @('query.state', '演示订单', '¥0.00', 'o
if ($m10 -notmatch 'import \{ session \} from "@/utils/session\.js";') {
throw 'M10 must consume the unique session owner'
}
if ($m10 -notmatch '(?s)const confirmLogout = \(\) => \{\s*session\.clear\(\);\s*logoutVisible\.value = false;\s*return goRoot\("A01"\);\s*\};') {
throw 'M10 logout order must be session.clear -> close dialog -> goRoot(A01)'
if ($m10 -notmatch '(?s)const confirmLogout = async \(\) => \{.*?await appApi\.logout\(\{ requestController: logoutRequestController \}\);.*?finally \{\s*session\.clear\(\);\s*logoutVisible\.value = false;.*?\}\s*return goRoot\("A01"\);\s*\};') {
throw 'M10 logout must attempt the declared remote owner, then clear the local session and enter A01 in every result'
}
if (([regex]::Matches($m10, 'session\.clear\(\)')).Count -ne 1) {
throw 'M10 cancellation or back paths must never clear the session'