添加过滤

lijinlong
李劲龙 2 months ago
parent 1633d1519e
commit 21193b3b25

@ -8,6 +8,7 @@ const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
useer: state => state.user.useer,
introduction: state => state.user.introduction,
roles: state => state.user.roles,
permissions: state => state.user.permissions,

@ -8,7 +8,8 @@ const user = {
name: '',
avatar: '',
roles: [],
permissions: []
permissions: [],
useer: ""
},
mutations: {
@ -21,6 +22,9 @@ const user = {
SET_NAME: (state, name) => {
state.name = name
},
SET_NAMEUSE: (state, name) => {
state.useer = name
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
@ -64,6 +68,7 @@ const user = {
}
commit('SET_ID', user.userId)
commit('SET_NAME', user.userName)
commit('SET_NAMEUSE', user)
commit('SET_AVATAR', avatar)
resolve(res)
}).catch(error => {

@ -189,12 +189,8 @@ export default {
},
mounted() {
console.log(this.$store.state.user);
if(this.$store.state.user.roles[0] == "admin"){
// this.pagination: {
// current: 1,
// size: 10,
// },
}
console.log(this.$store.state.user.roles[0]);
this.getInfo();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
@ -246,6 +242,9 @@ export default {
//
getInfo() {
this.loading = true;
if(this.$store.state.user.roles.includes("unit")){
this.pagination.dwmc=this.$store.state.user.useer.nickName
}
getassetTask(this.pagination).then(res => {
this.loading = false;
this.total = res.data.total;

Loading…
Cancel
Save