完成实验部分打磨,准备大作业部分

This commit is contained in:
li-chx
2025-05-03 22:18:45 +08:00
parent eae8781eaa
commit 3ab2c26776
6 changed files with 107 additions and 73 deletions
+3
View File
@@ -4,6 +4,7 @@ export interface UserInfo {
userEmail: string;
userAvatar: string;
userAmount: string;
userBirthday: string;
lastGetTime: Date;
}
export interface UserState extends UserInfo {
@@ -17,6 +18,7 @@ export const useUserStore = defineStore('User', {
userEmail: '',
userAvatar: '',
userAmount: '',
userBirthday: '',
lastGetTime: new Date(),
}),
actions: {
@@ -30,6 +32,7 @@ export const useUserStore = defineStore('User', {
this.userEmail = res.data.userEmail;
this.userAvatar = res.data.userAvatar;
this.userAmount = '500';
this.userBirthday = res.data.userBirthday;
this.lastGetTime = new Date();
} catch (error) {
console.error('Error fetching user info:', error);