first commit

This commit is contained in:
muzi
2025-06-16 14:42:26 +08:00
commit 6f06721506
149 changed files with 56883 additions and 0 deletions

View File

@ -0,0 +1,46 @@
/*
* @Author: 田鑫
* @Date: 2023-03-05 14:57:17
* @LastEditors: 田鑫
* @LastEditTime: 2023-03-05 15:29:15
* @Description: 用户相关状态
*/
type Role = 'ENTERPRISE' | 'PERSON';
interface UserState {
role: Role;
isLogin: boolean;
}
export const useUserStore = defineStore('user', {
state: (): UserState => ({
role: 'PERSON',
isLogin: false,
}),
getters: {
userRole(state) {
return state.role;
},
userIsLogin(state) {
return state.isLogin;
},
},
actions: {
setUserRole(role: Role) {
this.role = role;
},
setUserLoginStatus(isLogin: boolean) {
this.isLogin = isLogin;
},
async getUserInfo() {
// todo 调用获取用户信息接口当前用mock数据表示
AMessage.success(`当前用户角色为ENTERPRISE`)
this.setUserRole('ENTERPRISE');
},
},
});