You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
701 B
33 lines
701 B
import { defineStore } from 'pinia'
|
|
export const useUserStore = defineStore({
|
|
id: 'user', // id必填,且需要唯一
|
|
// state
|
|
state: () => {
|
|
return {
|
|
allUserList: [],
|
|
operUser: '',
|
|
loginUser: '',
|
|
loginUserPermission: 3,
|
|
}
|
|
},
|
|
// actions
|
|
actions: {
|
|
updatePermission(loginUserPermission) {
|
|
this.loginUserPermission = loginUserPermission
|
|
},
|
|
updateLoginUser(loginUser) {
|
|
this.loginUser = loginUser
|
|
},
|
|
updateOperUser(operUser) {
|
|
this.operUser = operUser
|
|
},
|
|
updateUserList(userList) {
|
|
this.allUserList = userList
|
|
},
|
|
},
|
|
getters: {
|
|
userList: state => {
|
|
return state.allUserList
|
|
},
|
|
},
|
|
})
|