注册集成手机号登录,修改密码,修改手机号

This commit is contained in:
xiaowang
2026-03-03 14:39:02 +08:00
parent 2c505deaf9
commit b301e37468
29 changed files with 1405 additions and 44 deletions
+24
View File
@@ -33,6 +33,20 @@
</div>
</div>
</div>
<!-- 密码设置提示 -->
<div v-if="needSetPassword" class="password-tip">
<a-alert
type="warning"
message="请尽快设置密码"
description="为了账户安全,建议您设置一个安全的密码"
show-icon
:closable="false"
>
<template #action>
<a-button size="small" type="primary" @click="handleSetPassword">去设置</a-button>
</template>
</a-alert>
</div>
<a-button type="primary" block @click="handleEditProfile" class="edit-btn">
编辑资料
</a-button>
@@ -217,6 +231,7 @@ const userInfo = ref<UserVO>({
})
const hasNotification = ref(true)
const needSetPassword = ref(false)
const editModalVisible = ref(false)
const saving = ref(false)
@@ -282,6 +297,8 @@ const fetchUserInfo = async () => {
console.log('获取到的用户信息:', response)
userInfo.value = response
console.log('设置后的 userInfo:', userInfo.value)
// 检查是否需要设置密码
needSetPassword.value = localStorage.getItem('needSetPassword') === 'true'
} catch (error) {
console.error('获取用户信息失败:', error)
message.error('获取用户信息失败')
@@ -438,6 +455,8 @@ const handleLogout = () => {
} finally {
localStorage.removeItem('accessToken')
localStorage.removeItem('refreshToken')
localStorage.removeItem('userInfo')
localStorage.removeItem('needSetPassword')
sessionStorage.removeItem('accessToken')
message.success('已退出登录')
router.push('/')
@@ -451,6 +470,11 @@ const handleSettingsClick = () => {
router.push('/settings')
}
const handleSetPassword = () => {
console.log('去设置密码')
router.push('/settings/password')
}
const handleShopClick = () => {
console.log('店铺信息被点击')
if (userInfo.value.shopId) {