fix: remove hardcoded defaults from profile edit page
This commit is contained in:
@@ -233,12 +233,12 @@ const form = reactive({
|
|||||||
|
|
||||||
const avatarUrl = computed(() => {
|
const avatarUrl = computed(() => {
|
||||||
if (avatarLocal.value) return avatarLocal.value
|
if (avatarLocal.value) return avatarLocal.value
|
||||||
const nickname = form.nickname || 'Zoey'
|
const nickname = form.nickname || 'User'
|
||||||
return `https://api.dicebear.com/7.x/avataaars/svg?seed=${encodeURIComponent(nickname)}&backgroundColor=b982ff`
|
return `https://api.dicebear.com/7.x/avataaars/svg?seed=${encodeURIComponent(nickname)}&backgroundColor=b982ff`
|
||||||
})
|
})
|
||||||
|
|
||||||
const birthdayDisplay = computed(() => {
|
const birthdayDisplay = computed(() => {
|
||||||
if (!birthday.value) return '1998年06月18日'
|
if (!birthday.value) return '请选择生日'
|
||||||
const [year, month, day] = birthday.value.split('-')
|
const [year, month, day] = birthday.value.split('-')
|
||||||
return `${year}年${month}月${day}日`
|
return `${year}年${month}月${day}日`
|
||||||
})
|
})
|
||||||
@@ -247,21 +247,21 @@ const syncFromStore = () => {
|
|||||||
const source = store.userProfile || store.registrationData || {}
|
const source = store.userProfile || store.registrationData || {}
|
||||||
Object.assign(form, {
|
Object.assign(form, {
|
||||||
nickname: source.nickname || '',
|
nickname: source.nickname || '',
|
||||||
gender: source.gender || '女',
|
gender: source.gender || '',
|
||||||
zodiac: source.zodiac || '巨蟹座',
|
zodiac: source.zodiac || '',
|
||||||
mbti: source.mbti || 'ENTJ',
|
mbti: source.mbti || '',
|
||||||
profession: source.profession || '产品经理',
|
profession: source.profession || '',
|
||||||
city: source.city || '上海市',
|
city: source.city || '',
|
||||||
industry: source.industry || '互联网',
|
industry: source.industry || '',
|
||||||
company: source.company || '',
|
company: source.company || '',
|
||||||
personalityTags: Array.isArray(source.personalityTags) && source.personalityTags.length ? [...source.personalityTags] : ['理性', '乐观', '独立', '有创造力', '坚韧'],
|
personalityTags: Array.isArray(source.personalityTags) ? [...source.personalityTags] : [],
|
||||||
hobbies: Array.isArray(source.hobbies) && source.hobbies.length ? [...source.hobbies] : ['阅读', '旅行', '音乐'],
|
hobbies: Array.isArray(source.hobbies) ? [...source.hobbies] : [],
|
||||||
childhood: { date: source.childhood?.date || '', text: source.childhood?.text || '' },
|
childhood: { date: source.childhood?.date || '', text: source.childhood?.text || '' },
|
||||||
joy: { date: source.joy?.date || '', text: source.joy?.text || '' },
|
joy: { date: source.joy?.date || '', text: source.joy?.text || '' },
|
||||||
low: { date: source.low?.date || '', text: source.low?.text || '' },
|
low: { date: source.low?.date || '', text: source.low?.text || '' },
|
||||||
future: { vision: source.future?.vision || '', ideal: source.future?.ideal || '热爱阅读和旅行,喜欢用文字和镜头记录生活。\n相信真诚和努力能让世界变得更美好。' }
|
future: { vision: source.future?.vision || '', ideal: source.future?.ideal || '' }
|
||||||
})
|
})
|
||||||
birthday.value = source.birthday || '1998-06-18'
|
birthday.value = source.birthday || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const onBirthday = (event) => {
|
const onBirthday = (event) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user