优化一些问题
This commit is contained in:
@@ -209,6 +209,9 @@ const userInfo = ref<UserVO>({
|
||||
id: 0,
|
||||
nickname: '',
|
||||
account: '',
|
||||
avatar: '',
|
||||
type: 0,
|
||||
status: 0,
|
||||
createTime: '',
|
||||
updateTime: ''
|
||||
})
|
||||
@@ -275,9 +278,9 @@ const menuItems = ref([
|
||||
const fetchUserInfo = async () => {
|
||||
try {
|
||||
console.log('开始获取用户信息...')
|
||||
const res = await userApi.getUserInfo()
|
||||
console.log('获取到的用户信息:', res)
|
||||
userInfo.value = res as unknown as UserVO
|
||||
const response = await userApi.getUserInfo() as any
|
||||
console.log('获取到的用户信息:', response)
|
||||
userInfo.value = response
|
||||
console.log('设置后的 userInfo:', userInfo.value)
|
||||
} catch (error) {
|
||||
console.error('获取用户信息失败:', error)
|
||||
@@ -368,9 +371,9 @@ const handleCancelEdit = () => {
|
||||
const loadOrders = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await orderApi.getOrderList()
|
||||
orders.value = data
|
||||
orderCount.value = data.length
|
||||
const response = await orderApi.getOrderList() as any
|
||||
orders.value = response
|
||||
orderCount.value = response.length
|
||||
} catch (error) {
|
||||
message.error('获取订单列表失败')
|
||||
} finally {
|
||||
@@ -473,8 +476,8 @@ onMounted(() => {
|
||||
// 加载优惠券数量
|
||||
const loadCouponCount = async () => {
|
||||
try {
|
||||
const data = await couponApi.listUserCoupons()
|
||||
couponCount.value = data.length
|
||||
const response = await couponApi.listUserCoupons() as any
|
||||
couponCount.value = response.length
|
||||
} catch (error) {
|
||||
console.error('获取优惠券数量失败:', error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user