删除权限

This commit is contained in:
砂糖
2025-07-19 17:29:15 +08:00
parent 245bc4973b
commit 5bd163d8cd
19 changed files with 253 additions and 221 deletions

View File

@@ -6,6 +6,7 @@ import user from './modules/user'
import tagsView from './modules/tagsView'
import permission from './modules/permission'
import settings from './modules/settings'
import category from './modules/category'
import getters from './getters'
Vue.use(Vuex)
@@ -17,7 +18,8 @@ const store = new Vuex.Store({
user,
tagsView,
permission,
settings
settings,
category
},
getters
})

View File

@@ -0,0 +1,30 @@
import { listCategory } from '@/api/wms/category';
const state = {
categoryList: []
};
const mutations = {
SET_CATEGORY_LIST(state, list) {
state.categoryList = list;
}
};
const actions = {
getCategoryList({ state, commit }) {
if (state.categoryList.length > 0) {
return Promise.resolve(state.categoryList);
}
return listCategory().then(res => {
commit('SET_CATEGORY_LIST', res.rows || []);
return res.rows || [];
});
}
};
export default {
namespaced: true,
state,
mutations,
actions
};