fix: 保存用户信息后正确更新本地存储

This commit is contained in:
菜鸟生产 2026-03-18 13:11:30 +08:00
parent 57e2eec9a0
commit e7939abbbe
2 changed files with 5 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Version Configuration for Zodiac Collection Management System
# 当前版本号 (语义化版本:主版本。次版本.修订版)
VERSION=1.1.0
VERSION=1.1.1
# 版本代号 (可选)
VERSION_CODENAME="新生"

View File

@ -83,12 +83,15 @@ export default function Settings() {
})
if (res.ok) {
const data = await res.json()
setSuccess('保存成功!')
//
const userStr = localStorage.getItem('user')
if (userStr) {
const user = JSON.parse(userStr)
user.username = form.username
user.username = data.username || user.username
user.email = data.email || user.email
user.phone = data.phone || user.phone
localStorage.setItem('user', JSON.stringify(user))
}
} else {