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

22 lines
394 B
TypeScript
Raw Normal View History

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