Auto merge base into i18n

This commit is contained in:
GitHub Actions 2025-06-06 14:59:38 +00:00
commit 28f3c64ced
2 changed files with 11 additions and 8 deletions

View File

@ -8,17 +8,17 @@
<template>
<view class="profile-container">
{{ JSON.stringify(userStore.userInfo) }}
{{ JSON.stringify(userInfo) }}
<!-- 用户信息区域 -->
<view class="user-info-section">
<!-- #ifdef MP-WEIXIN -->
<button class="avatar-button" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<wd-img :src="userStore.userInfo.avatar" width="80px" height="80px" radius="50%"></wd-img>
<wd-img :src="userInfo.avatar" width="80px" height="80px" radius="50%"></wd-img>
</button>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="avatar-wrapper" @click="run">
<wd-img :src="userStore.userInfo.avatar" width="100%" height="100%" radius="50%"></wd-img>
<wd-img :src="userInfo.avatar" width="100%" height="100%" radius="50%"></wd-img>
</view>
<!-- #endif -->
<view class="user-details">
@ -27,13 +27,13 @@
type="nickname"
class="weui-input"
placeholder="请输入昵称"
v-model="userStore.userInfo.username"
v-model="userInfo.username"
/>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="username">{{ userStore.userInfo.username }}</view>
<view class="username">{{ userInfo.username }}</view>
<!-- #endif -->
<view class="user-id">ID: {{ userStore.userInfo.id }}</view>
<view class="user-id">ID: {{ userInfo.id }}</view>
</view>
</view>
@ -93,7 +93,8 @@ import { storeToRefs } from 'pinia'
import { IUploadSuccessInfo } from '@/api/login.typings'
const userStore = useUserStore()
// 使storeToRefsuserInfo
const { userInfo } = storeToRefs(userStore)
const toast = useToast()
const hasLogin = ref(false)
@ -142,7 +143,7 @@ const onChooseAvatar = (e: any) => {
{
onSuccess: (res) => {
console.log('头像上传成功', res)
//
useUserStore().setUserAvatar(res)
},
},
avatarUrl,

View File

@ -36,6 +36,8 @@ export const useUserStore = defineStore(
}
const setUserAvatar = (avatar: string) => {
userInfo.value.avatar = avatar
console.log('设置用户头像', avatar)
console.log('userInfo', userInfo.value)
}
// 删除用户信息
const removeUserInfo = () => {