Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-12-01 18:18:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1c19fc43d07a8c6d877af0f7b79d6726249a153e
1c19fc43
1 parent
92ddd3b1
style(PhoneSettingPage): 调整验证码输入和按钮的样式
统一表单元素的样式,改进间距和焦点状态
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
src/views/profile/settings/PhoneSettingPage.vue
src/views/profile/settings/PhoneSettingPage.vue
View file @
1c19fc4
...
...
@@ -43,7 +43,7 @@
<!-- 验证码输入 -->
<div class="mb-6">
<label for="verificationCode" class="block text-sm font-medium text-gray-700
mb-2
">
<label for="verificationCode" class="block text-sm font-medium text-gray-700">
验证码 <span class="text-red-500">*</span>
</label>
<div class="flex space-x-2">
...
...
@@ -54,13 +54,13 @@
required
maxlength="6"
placeholder="请输入验证码"
class="
flex-1 px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent
"
class="
mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500
"
/>
<button
type="button"
:disabled="countdown > 0 || !isPhoneValid"
@click="sendVerificationCode"
class="
px-4 py-3 border border-transparent text-sm font-medium rounded-lg
text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap"
class="
mt-1 px-4 py-2 border border-transparent text-sm font-medium rounded-md
text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap"
>
{{ countdown > 0 ? `${countdown}秒后重试` : '获取验证码' }}
</button>
...
...
@@ -191,11 +191,11 @@ const handlePhoneChange = async () => {
loading.value = true;
try {
const { code, data } = await updateUserInfoAPI({
const { code, data } = await updateUserInfoAPI({
mobile: formData.value.phone,
sms_code: formData.value.verificationCode
});
if (code) {
// 更新auth上下文中的用户信息
currentUser.value = {
...
...
@@ -204,14 +204,14 @@ const handlePhoneChange = async () => {
};
// 更新localStorage中的用户信息
localStorage.setItem('currentUser', JSON.stringify(currentUser.value));
// 更新当前显示的手机号
currentPhone.value = formData.value.phone;
// 清空表单
formData.value.phone = '';
formData.value.verificationCode = '';
showToast('手机号修改成功');
}
} catch (error) {
...
...
Please
register
or
login
to post a comment