mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
Merge pull request #439 from DemoJameson/fix-nickname-2
This commit is contained in:
@@ -199,6 +199,7 @@ async function fetchUserInfo() {
|
|||||||
userForm.value = await api.get(`user/${props.username}`)
|
userForm.value = await api.get(`user/${props.username}`)
|
||||||
if (userForm.value) {
|
if (userForm.value) {
|
||||||
userForm.value.avatar = userForm.value.avatar || avatar1
|
userForm.value.avatar = userForm.value.avatar || avatar1
|
||||||
|
userForm.value.nickname = userForm.value.settings?.nickname ?? ''
|
||||||
currentAvatar.value = userForm.value.avatar
|
currentAvatar.value = userForm.value.avatar
|
||||||
currentUserName.value = userForm.value.name
|
currentUserName.value = userForm.value.name
|
||||||
userName.value = userForm.value.name
|
userName.value = userForm.value.name
|
||||||
@@ -273,12 +274,10 @@ async function updateUser() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 将nickname保存到settings中,后端可以直接处理JSON对象
|
// 将nickname保存到settings中,后端可以直接处理JSON对象
|
||||||
if (userForm.value.nickname) {
|
if (!userForm.value.settings) {
|
||||||
if (!userForm.value.settings) {
|
userForm.value.settings = {}
|
||||||
userForm.value.settings = {}
|
|
||||||
}
|
|
||||||
userForm.value.settings.nickname = userForm.value.nickname
|
|
||||||
}
|
}
|
||||||
|
userForm.value.settings.nickname = userForm.value.nickname ?? ''
|
||||||
|
|
||||||
const oldUserName = userForm.value.name
|
const oldUserName = userForm.value.name
|
||||||
userForm.value.name = currentUserName.value
|
userForm.value.name = currentUserName.value
|
||||||
|
|||||||
@@ -162,12 +162,10 @@ async function saveAccountInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 将nickname保存到settings中,后端可以直接处理JSON对象
|
// 将nickname保存到settings中,后端可以直接处理JSON对象
|
||||||
if (accountInfo.value.nickname) {
|
if (!accountInfo.value.settings) {
|
||||||
if (!accountInfo.value.settings) {
|
accountInfo.value.settings = {}
|
||||||
accountInfo.value.settings = {}
|
|
||||||
}
|
|
||||||
accountInfo.value.settings.nickname = accountInfo.value.nickname
|
|
||||||
}
|
}
|
||||||
|
accountInfo.value.settings.nickname = accountInfo.value.nickname ?? ''
|
||||||
|
|
||||||
const oldUserName = accountInfo.value.name
|
const oldUserName = accountInfo.value.name
|
||||||
const oldAvatar = accountInfo.value.avatar
|
const oldAvatar = accountInfo.value.avatar
|
||||||
|
|||||||
Reference in New Issue
Block a user