Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2b44f1d6
authored
May 12, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:个人中心修改信息后,左侧没变化
parent
02d284bc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
src/views/Profile/Index.vue
+8
-2
src/views/Profile/components/BasicInfo.vue
+8
-0
src/views/Profile/components/ProfileUser.vue
+6
-0
No files found.
src/views/Profile/Index.vue
View file @
2b44f1d6
...
...
@@ -7,13 +7,13 @@
<span>
{{
t
(
'profile.user.title'
)
}}
</span>
</div>
</
template
>
<ProfileUser
/>
<ProfileUser
ref=
"profileUserRef"
/>
</el-card>
<el-card
class=
"user ml-3 w-2/3"
shadow=
"hover"
>
<div>
<el-tabs
v-model=
"activeName"
class=
"profile-tabs"
style=
"height: 400px"
tab-position=
"top"
>
<el-tab-pane
:label=
"t('profile.info.basicInfo')"
name=
"basicInfo"
>
<BasicInfo
/>
<BasicInfo
@
success=
"handleBasicInfoSuccess"
/>
</el-tab-pane>
<el-tab-pane
:label=
"t('profile.info.resetPwd')"
name=
"resetPwd"
>
<ResetPwd
/>
...
...
@@ -32,6 +32,12 @@ import { BasicInfo, ProfileUser, ResetPwd, UserSocial } from './components'
const
{
t
}
=
useI18n
()
defineOptions
({
name
:
'Profile'
})
const
activeName
=
ref
(
'basicInfo'
)
const
profileUserRef
=
ref
()
// 处理基本信息更新成功
const
handleBasicInfoSuccess
=
async
()
=>
{
await
profileUserRef
.
value
?.
refresh
()
}
</
script
>
<
style
scoped
>
.user
{
...
...
src/views/Profile/components/BasicInfo.vue
View file @
2b44f1d6
...
...
@@ -28,6 +28,12 @@ defineOptions({ name: 'BasicInfo' })
const
{
t
}
=
useI18n
()
const
message
=
useMessage
()
// 消息弹窗
const
userStore
=
useUserStore
()
// 定义事件
const
emit
=
defineEmits
<
{
(
e
:
'success'
):
void
}
>
()
// 表单校验
const
rules
=
reactive
<
FormRules
>
({
nickname
:
[{
required
:
true
,
message
:
t
(
'profile.rules.nickname'
),
trigger
:
'blur'
}],
...
...
@@ -82,6 +88,8 @@ const submit = () => {
message
.
success
(
t
(
'common.updateSuccess'
))
const
profile
=
await
init
()
userStore
.
setUserNicknameAction
(
profile
.
nickname
)
// 发送成功事件
emit
(
'success'
)
}
})
}
...
...
src/views/Profile/components/ProfileUser.vue
View file @
2b44f1d6
...
...
@@ -60,6 +60,12 @@ const getUserInfo = async () => {
const
users
=
await
getUserProfile
()
userInfo
.
value
=
users
}
// 暴露刷新方法
defineExpose
({
refresh
:
getUserInfo
})
onMounted
(
async
()
=>
{
await
getUserInfo
()
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment