对接数据

This commit is contained in:
2025-10-24 15:45:38 +08:00
parent 672a2f4c90
commit d3375a347f
138 changed files with 16904 additions and 1026 deletions

View File

@ -1,20 +1,29 @@
//默认就是根store不需要namespacedtrue访问的时候直接写根级别的key : this.$store.dispatch('example)
export const state = () => ({
bannerConfig: {}
})
export const mutations = {
SET_BANNER_CONFIG(state, config) {
state.bannerConfig = config
}
}
export const actions = {
// 只在服务端渲染时运行一次
async nuxtServerInit({ dispatch, commit }, { app, req }) {
}
await dispatch('getBannerConfig');
},
async getBannerConfig({ commit }) {
const {data: res} = await this.$api.config.getModuleConfigKey('banner')
const {code, data} = res;
if (code === 0 && data.banner) {
commit('SET_BANNER_CONFIG', data.banner);
}
}
}
export const getters = {
}
bannerConfig: (state) => state.bannerConfig
}