vehicle-monitor/src/store/modules/user.ts

24 lines
413 B
TypeScript
Raw Normal View History

2025-02-28 20:14:37 +08:00
import { defineStore } from 'pinia';
import { user } from '@/api/test';
/** 用户信息 */
2025-03-13 18:39:39 +08:00
const useUserStore = defineStore('userStore', {
2025-02-28 20:14:37 +08:00
state() {
return {
userinfo: {},
};
},
getters: {},
actions: {
async getUserInfo() {
const response = await user();
if (response.code == 200) {
this.userinfo = response.data;
}
},
},
});
2025-03-13 18:39:39 +08:00
export { useUserStore };