|
|
@ -92,10 +92,19 @@ const actions = {
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
load: async ({ state, commit }) => {
|
|
|
|
load: async ({ state, commit }) => {
|
|
|
|
|
|
|
|
const deep = (arr) =>
|
|
|
|
|
|
|
|
arr.map((item) => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
...item,
|
|
|
|
|
|
|
|
id: item.id + '',
|
|
|
|
|
|
|
|
childList: deep(item.childList || []),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
commit('setOpts', {
|
|
|
|
commit('setOpts', {
|
|
|
|
...state.opts,
|
|
|
|
...state.opts,
|
|
|
|
init: true,
|
|
|
|
init: true,
|
|
|
|
category: await categoryAPI.search(),
|
|
|
|
category: deep(await categoryAPI.search()),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
detail: async (context, id) => {
|
|
|
|
detail: async (context, id) => {
|
|
|
|