调整界面

This commit is contained in:
huangdeliang
2021-05-31 10:52:30 +08:00
parent b31aafc6e4
commit 7e3311ad64
9 changed files with 184 additions and 25 deletions

View File

@ -8,6 +8,7 @@ import settings from "./modules/settings";
import recipes from "./modules/recipes";
import recipesShow from "./modules/recipesShow";
import global from "./modules/global";
import message from "./modules/message";
import getters from "./getters";
import actions from "./actions";
@ -23,7 +24,8 @@ const store = new Vuex.Store({
settings,
recipes,
recipesShow,
global
global,
message
},
getters,
actions

View File

@ -0,0 +1,45 @@
import {
fetchTopicList,
postTopicReply,
fetchTopicDetail,
postTopicComment
} from "@/api/custom/message";
const oriState = {
topicList: undefined,
detailData: undefined
};
const mutations = {
save(state, payload) {
Object.keys(payload).forEach(key => {
state[key] = payload[key];
});
},
clean(state) {
Object.keys(oriState).forEach(key => {
state[key] = oriState[key];
});
}
};
const actions = {
async init({ rootGetters, commit }, payload) {
const {
roles: [role],
userId
} = rootGetters;
const result = await fetchTopicList({ role: "dietician", uid: 131 });
console.log({ result });
}
};
const getters = {};
export default {
namespaced: "message",
state: Object.assign({}, oriState),
mutations,
actions,
getters
};