From 9381d1ff53b572ca2ba78276f1c2bbdf68b156d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Aug 2026 06:41:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=B0=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user-center-renderers/profile-auth.php | 1 - src/Core/DBMigratorIdentity.php | 1 - src/Identity/ApplicationRepository.php | 1 - src/Identity/ApplicationService.php | 3 --- src/User/AuthApply.php | 22 ++++--------------- .../user-features-contract.test.cjs | 4 ++-- 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/inc/helpers/user-center-renderers/profile-auth.php b/inc/helpers/user-center-renderers/profile-auth.php index 5fb5919e..6ef3dde8 100644 --- a/inc/helpers/user-center-renderers/profile-auth.php +++ b/inc/helpers/user-center-renderers/profile-auth.php @@ -49,7 +49,6 @@ $config = [

-

diff --git a/src/Core/DBMigratorIdentity.php b/src/Core/DBMigratorIdentity.php index bd4906cb..ac390ce4 100644 --- a/src/Core/DBMigratorIdentity.php +++ b/src/Core/DBMigratorIdentity.php @@ -28,7 +28,6 @@ trait DBMigratorIdentity { qr_payload TEXT DEFAULT NULL, status VARCHAR(32) NOT NULL DEFAULT 'created', public_name VARCHAR(64) NOT NULL DEFAULT '', - public_desc VARCHAR(300) NOT NULL DEFAULT '', person_name_masked VARCHAR(64) NOT NULL DEFAULT '', id_number_masked VARCHAR(32) NOT NULL DEFAULT '', id_number_hash CHAR(64) NOT NULL DEFAULT '', diff --git a/src/Identity/ApplicationRepository.php b/src/Identity/ApplicationRepository.php index 83b132cd..ffc37ed8 100644 --- a/src/Identity/ApplicationRepository.php +++ b/src/Identity/ApplicationRepository.php @@ -55,7 +55,6 @@ final class ApplicationRepository { 'provider' => '', 'status' => 'created', 'public_name' => '', - 'public_desc' => '', 'fee_amount' => '0.00', 'fee_status' => 'not_required', 'created_at' => $now, diff --git a/src/Identity/ApplicationService.php b/src/Identity/ApplicationService.php index dfa0baf7..c6a72a98 100644 --- a/src/Identity/ApplicationService.php +++ b/src/Identity/ApplicationService.php @@ -77,7 +77,6 @@ final class ApplicationService { return new \WP_Error('aksrt_identity_active', __('您已有进行中的认证申请', 'aksrt'), ['status' => 409]); } $public_name = $type === 'enterprise' ? $this->truncate($company_name, 64) : __('个人认证', 'aksrt'); - $public_desc = ''; if ($existing) { $application = $existing; @@ -100,7 +99,6 @@ final class ApplicationService { 'provider' => $settings['provider'], 'provider_flow' => (string) $settings['personal_flow'], 'public_name' => $public_name, - 'public_desc' => $public_desc, 'person_name_masked' => SettingsRuntime::mask_name($person_name), 'id_number_masked' => SettingsRuntime::mask_id_number($id_number), 'id_number_hash' => SettingsRuntime::hmac($id_number), @@ -238,7 +236,6 @@ final class ApplicationService { 'stage' => $stage, 'next_action' => $next, 'public_name' => (string) $application['public_name'], - 'public_desc' => (string) $application['public_desc'], 'result_code' => (string) $application['provider_result_code'], 'message' => (string) $application['provider_result_summary'], 'redirect_url' => esc_url_raw((string) ($application['redirect_url'] ?? '')), diff --git a/src/User/AuthApply.php b/src/User/AuthApply.php index 4decd9ea..915db951 100644 --- a/src/User/AuthApply.php +++ b/src/User/AuthApply.php @@ -137,7 +137,6 @@ class AuthApply { private static function info_from_application(array $application): array { return [ 'name' => (string) ($application['public_name'] ?? ''), - 'desc' => (string) ($application['public_desc'] ?? ''), 'type' => (string) ($application['type'] ?? ''), 'time' => (string) (($application['completed_at'] ?? '') ?: ($application['updated_at'] ?? '')), ]; @@ -153,7 +152,6 @@ class AuthApply { 'user_id' => (int) ($application['user_id'] ?? 0), 'name' => (string) ($application['public_name'] ?? ''), 'real_name' => (string) ($application['person_name_masked'] ?? ''), - 'desc' => (string) ($application['public_desc'] ?? ''), 'msg' => (string) ($application['manual_reason'] ?? ''), 'type' => (string) ($application['type'] ?? ''), 'time' => (string) ($application['created_at'] ?? ''), @@ -172,7 +170,6 @@ class AuthApply { 'stage' => $stage, 'next_action' => self::next_action($stage), 'public_name' => (string) ($application['public_name'] ?? ''), - 'public_desc' => (string) ($application['public_desc'] ?? ''), 'result_code' => (string) ($application['provider_result_code'] ?? ''), 'message' => (string) ($application['provider_result_summary'] ?? ''), 'redirect_url' => esc_url_raw((string) ($application['redirect_url'] ?? '')), @@ -263,7 +260,7 @@ class AuthApply { return new \WP_Error('aksrt_verify_note', __('请填写处理原因', 'aksrt')); } $fields = []; - foreach (['type', 'public_name', 'public_desc'] as $key) { + foreach (['type', 'public_name'] as $key) { if (array_key_exists($key, $profile_fields)) { $fields[$key] = (string) $profile_fields[$key]; } @@ -310,7 +307,6 @@ class AuthApply { $can_manage = current_user_can('aksrt_review_identity') && current_user_can('edit_user', $user_id); $public_name = (string) ($application['public_name'] ?? ''); - $public_desc = (string) ($application['public_desc'] ?? ''); $identity_type = in_array((string) ($application['type'] ?? ''), ['personal', 'enterprise'], true) ? (string) $application['type'] : 'personal'; @@ -350,17 +346,11 @@ class AuthApply { - + - - - - - - @@ -374,8 +364,7 @@ class AuthApply { - - + $identity_type, 'public_name' => $public_name, - 'public_desc' => $public_desc, ]; $current_status = (string) ($application['status'] ?? ''); @@ -428,7 +415,7 @@ class AuthApply { } $target_status = $status === '' ? 'cancelled' : $status; if ($target_status === 'verified' && $public_name === '') { - $this->set_admin_profile_notice('error', __('设为已认证时请填写认证身份。', 'aksrt')); + $this->set_admin_profile_notice('error', __('设为已认证时请填写姓名 / 主体全称。', 'aksrt')); return; } if (in_array($target_status, ['rejected', 'cancelled'], true) && $target_status !== $current_status && $note === '') { @@ -476,7 +463,6 @@ class AuthApply { 'provider' => '', 'status' => 'created', 'public_name' => $fields['public_name'], - 'public_desc' => $fields['public_desc'], 'fee_amount' => '0.00', 'fee_status' => 'not_required', 'attempt_ordinal' => $repo->count_user_type($user_id, $fields['type']) + 1, diff --git a/tests/widget-system/user-features-contract.test.cjs b/tests/widget-system/user-features-contract.test.cjs index d2379728..eeb78a8d 100644 --- a/tests/widget-system/user-features-contract.test.cjs +++ b/tests/widget-system/user-features-contract.test.cjs @@ -185,7 +185,7 @@ test('native user profile omits ledger tables and renders canonical images eager assert.doesNotMatch(level, /Level::get_badge_html/); }); -test('identity status and public details are directly editable on the native profile', () => { +test('identity status, type, and name are directly editable on the native profile', () => { const auth = read('src/User/AuthApply.php'); const transitions = read('src/Identity/TransitionService.php'); @@ -197,7 +197,7 @@ test('identity status and public details are directly editable on the native pro assert.match(auth, /value="personal"[\s\S]*?个人认证/); assert.match(auth, /value="enterprise"[\s\S]*?企业认证/); assert.match(auth, /name="aksrt_identity_public_name"/); - assert.match(auth, /name="aksrt_identity_public_desc"/); + assert.match(auth, /姓名 \/ 主体全称/); assert.match(auth, /name="aksrt_identity_status"/); assert.match(auth, /'manual_pending' => __\('待审核'/); assert.match(auth, /'verified' => __\('已认证'/);