diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index 4029d6a5..12ffe41e 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -69,7 +69,7 @@ php xcat createAdmin mariadb -h DB_HOST -P DB_PORT -u DB_USER -p BUSINESS_DB < /home/virt-cloud/web/sql/user_profile.sql ``` -该增量文件只为当前分支的测试环境补充姓、名、手机号和地址字段,不读取或迁移已退役系统的数据。已有用户默认保留空资料,可登录后在“账户设置 → 账户信息”补齐;新注册用户必须完整填写。 +该增量文件只为当前分支的测试环境补充姓、名、手机号和地址字段,不读取或迁移已退役系统的数据。注册流程不采集这些资料;新用户和已有用户均可登录后在“账户设置 → 账户信息”中补充。 若实例是在缺少 PHP 模板展示快照的早期 Go Agent 版本中创建,更新面板代码后先执行只读检查,再显式应用元数据修复: diff --git a/web/app/Controllers/AuthController.php b/web/app/Controllers/AuthController.php index 02037226..1d78157b 100644 --- a/web/app/Controllers/AuthController.php +++ b/web/app/Controllers/AuthController.php @@ -21,7 +21,6 @@ use App\Services\RegistrationIpRestriction; use App\Services\RedisClient; use App\Services\ReferralService; use App\Services\TrustedLoginDeviceService; -use App\Services\UserProfileService; use App\Models\User; use App\Models\LoginIp; use App\Models\EmailVerify; @@ -880,15 +879,6 @@ class AuthController extends BaseController if (!Check::isEmailLegal($email) || strlen($email) > 254 || $name === '' || mb_strlen($name) > 128) { return $this->echoJson($response, ['ret' => 0, 'msg' => '请填写有效的用户名和邮箱']); } - $profileInput = []; - foreach (UserProfileService::FIELDS as $field) { - $profileInput[$field] = $read($field); - } - try { - $profile = UserProfileService::validate($profileInput); - } catch (\InvalidArgumentException $exception) { - return $this->echoJson($response, ['ret' => 0, 'msg' => $exception->getMessage()]); - } $whitelist = RegistrationEmailWhitelist::configuredRules(); if ($whitelist['enabled'] && !RegistrationEmailWhitelist::allows($email, $whitelist['domains'])) { return $this->echoJson($response, ['ret' => 0, 'msg' => '此邮箱暂不允许注册']); @@ -908,7 +898,7 @@ class AuthController extends BaseController $connection = (new User())->getConnection(); try { - $connection->transaction(function () use ($read, $email, $name, $password, $code, $profile) { + $connection->transaction(function () use ($read, $email, $name, $password, $code) { if (User::where('email', $email)->exists()) { throw new \InvalidArgumentException('该邮箱已被注册'); } @@ -968,9 +958,6 @@ class AuthController extends BaseController $user = new User(); $user->user_name = (new AntiXSS())->xss_clean($name); $user->email = $email; - foreach ($profile as $field => $value) { - $user->{$field} = $value; - } $user->pass = Hash::passwordHash($password); $user->enable = 1; $user->is_admin = 0; diff --git a/web/public/cloud/account.css b/web/public/cloud/account.css index 33bb9b8f..c7a07160 100644 --- a/web/public/cloud/account.css +++ b/web/public/cloud/account.css @@ -1147,17 +1147,6 @@ body.venix-auth .auth-subtitle { line-height: 1.7; } body.venix-auth .auth-form { display: flex; flex-direction: column; gap: 18px; } -body.venix-auth .auth-profile-section { - display: grid; - gap: 16px; - padding: 18px; - background: var(--vu-panel-soft); - border: 1px solid var(--vu-border); - border-radius: 12px; -} -body.venix-auth .auth-profile-heading { display: grid; gap: 4px; } -body.venix-auth .auth-profile-heading strong { color: var(--vu-text); font-size: 15px; } -body.venix-auth .auth-profile-heading span { color: var(--vu-muted); font-size: 12px; line-height: 1.55; } body.venix-auth .auth-field { min-width: 0; display: flex; @@ -1379,7 +1368,6 @@ body.venix-auth .auth-modal-actions { body.venix-auth .auth-site-nav nav a { padding: 7px 8px; font-size: 12px; } body.venix-auth .auth-shell { align-items: start; padding: 28px 14px; } body.venix-auth .auth-panel { padding: 26px 20px; border-radius: 15px; } - body.venix-auth .auth-profile-section { padding: 16px; } body.venix-auth .auth-panel-wide { width: 100%; margin-left: 0; diff --git a/web/public/cloud/app.js b/web/public/cloud/app.js index 65c04d23..729e228e 100644 --- a/web/public/cloud/app.js +++ b/web/public/cloud/app.js @@ -1,4 +1,4 @@ -import { initializeTaskCenter } from './task-center.js?v=2026102405'; +import { initializeTaskCenter } from './task-center.js?v=2026102406'; const pageModules = Object.freeze({ instances: '/cloud/instances.js', diff --git a/web/resources/views/venix/auth/register.tpl b/web/resources/views/venix/auth/register.tpl index 4a7288df..f5d3fb3b 100644 --- a/web/resources/views/venix/auth/register.tpl +++ b/web/resources/views/venix/auth/register.tpl @@ -30,56 +30,6 @@ {/if} -
-
- {if $language == 'true'}Account information{else}账户信息{/if} - {if $language == 'true'}Enter the contact and address details for this account.{else}请填写账户联系人和地址信息。{/if} -
- -
-
- - -
-
- - -
-
- -
- - -
- -
-
- - -
-
- - -
-
- -
-
- - -
-
- - -
-
- -
- - -
-
-
@@ -194,14 +144,6 @@ VenixAuth.post('/auth/register', { email: fieldValue('email'), name: fieldValue('name'), - last_name: fieldValue('last_name'), - first_name: fieldValue('first_name'), - phone: fieldValue('phone'), - country: fieldValue('country'), - province: fieldValue('province'), - city: fieldValue('city'), - address: fieldValue('address'), - postal_code: fieldValue('postal_code'), aff: affCode || (Number.isInteger(affid) ? affid : ''), passwd: fieldValue('passwd'), repasswd: fieldValue('repasswd'), diff --git a/web/resources/views/venix/layout_assets.tpl b/web/resources/views/venix/layout_assets.tpl index f6160611..3768b472 100644 --- a/web/resources/views/venix/layout_assets.tpl +++ b/web/resources/views/venix/layout_assets.tpl @@ -1,2 +1,2 @@ {* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *} -{assign var=venix_asset_version value='2026102405' scope='global'} +{assign var=venix_asset_version value='2026102406' scope='global'} diff --git a/web/resources/views/venix/user/edit.tpl b/web/resources/views/venix/user/edit.tpl index 80aa1559..0bf1121a 100644 --- a/web/resources/views/venix/user/edit.tpl +++ b/web/resources/views/venix/user/edit.tpl @@ -9,7 +9,7 @@
-
+
账户信息管理联系人、电话和地址资料 diff --git a/web/tests/UserProfileTest.php b/web/tests/UserProfileTest.php index bf692a48..d0538653 100644 --- a/web/tests/UserProfileTest.php +++ b/web/tests/UserProfileTest.php @@ -99,12 +99,15 @@ $assert(str_contains($sources['routes'], "'/profile'") && str_contains($sources['account'], 'AdminCsrf::verify') && str_contains($sources['account'], 'UserProfileService::update'), 'The authenticated CSRF-protected profile API is not fully wired.'); -$assert(str_contains($sources['auth'], 'UserProfileService::validate($profileInput)') - && str_contains($sources['auth'], 'foreach ($profile as $field => $value)'), - 'Registration does not validate and persist the shared profile payload.'); +$assert(!str_contains($sources['auth'], 'UserProfileService') + && !str_contains($sources['register'], 'registrationProfileTitle') + && str_contains($sources['register'], "email: fieldValue('email')") + && str_contains($sources['register'], "name: fieldValue('name')"), + 'Registration must keep its original fields and must not collect account profile data.'); $assert(str_contains($sources['drawer'], 'id="vuProfileForm"') - && str_contains($sources['runtime'], 'post("/user/profile", profile)'), - 'The account information form is not wired to its profile API.'); + && str_contains($sources['runtime'], 'post("/user/profile", profile)') + && preg_match('/]*\bopen\b/i', $sources['drawer']) !== 1, + 'The account information form is not wired correctly or a drawer card is open by default.'); $assert(preg_match('/CREATE TABLE `user` \((.*?)\) ENGINE=/s', $sources['schema'], $userTable) === 1, 'The fresh user table definition is missing.'); @@ -122,10 +125,10 @@ foreach (UserProfileService::FIELDS as $field) { $assert(str_contains($userTable[1], '`' . $field . '` ' . $columnDefinitions[$field]) && str_contains($sources['migration'], '`' . $field . '`'), 'The user table schema is missing the profile column: ' . $field); - $assert(str_contains($sources['register'], 'name="' . $field . '"') - && str_contains($sources['register'], $field . ": fieldValue('" . $field . "')") + $assert(!str_contains($sources['register'], 'name="' . $field . '"') + && !str_contains($sources['register'], $field . ": fieldValue('" . $field . "')") && str_contains($sources['drawer'], 'name="' . $field . '"'), - 'A registration or account profile field is missing: ' . $field); + 'Profile data must be editable in account settings without appearing during registration: ' . $field); } -echo "User registration and account profile checks passed.\n"; +echo "User account profile and registration separation checks passed.\n";