范鹏 c9a7c24672 1. tabbar
2. 我的页面
3. 用户信息页面
4. 更新头像、更新昵称、更新邮箱、重置密码
2024-08-20 19:54:37 +08:00

48 lines
921 B
Vue

<template>
<view>
home
</view>
</template>
<script>
import { getUserInfoRequest } from '@/api/user'
import { useUserStore } from '@/stores/user'
import { mapState, mapActions } from 'pinia'
import { getCompanyRequest } from '@/api/app'
export default {
data() {
return {
}
},
computed: {
...mapState(useUserStore, ['userInfo'])
},
async onLoad() {
uni.setStorageSync('token', '3016|NQth8ud3JRGLDKO3Gsmg7gEgv9yBjowrZNijlBCp975d2a97')
this.getUserInfo()
},
methods: {
...mapActions(useUserStore, ['updateUserInfo']),
async getUserInfo() {
const { code, data } = await getUserInfoRequest()
if(code === 0) {
this.updateUserInfo(data)
console.log(this.userInfo)
}
}
}
}
</script>
<style lang="scss">
page {
background-color: $uni-bg-color-grey;
}
</style>
<style scoped lang="scss">
</style>