You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.3 KiB
52 lines
1.3 KiB
import defaultSettings from '@/settings' |
|
|
|
const { showSettings, fixedHeader, sidebarLogo } = defaultSettings |
|
|
|
const state = { |
|
showSettings: showSettings, |
|
fixedHeader: fixedHeader, |
|
sidebarLogo: sidebarLogo, |
|
|
|
// 系统配置 |
|
configMain: { |
|
version:'', |
|
supportedThemes: '', |
|
admin_supportedFileTypes: '.jpg, .jpeg, .png, .gif, .webp', |
|
admin_maxUploadFileSize: 5242870, |
|
admin_maxUploadFileNumber: 5 |
|
} |
|
} |
|
|
|
const mutations = { |
|
// CHANGE_SETTING: (state, { key, value }) => { |
|
// // eslint-disable-next-line no-prototype-builtins |
|
// if (state.hasOwnProperty(key)) { |
|
// state[key] = value |
|
// } |
|
// } |
|
CONFIG_DATA: (state, configdata) => { |
|
state.configMain.version = configdata.version |
|
state.configMain.supportedThemes = configdata.currentTheme |
|
state.configMain.admin_supportedFileTypes = configdata.admin_supportedFileTypes |
|
state.configMain.admin_maxUploadFileSize = configdata.admin_maxUploadFileSize |
|
state.configMain.admin_maxUploadFileNumber = configdata.admin_maxUploadFileNumber |
|
} |
|
} |
|
|
|
const actions = { |
|
// changeSetting({ commit }, data) { |
|
// commit('CHANGE_SETTING', data) |
|
// } |
|
configMain({ commit }, configdata) { |
|
//console.log(configdata); |
|
commit('CONFIG_DATA', configdata) |
|
} |
|
} |
|
|
|
export default { |
|
namespaced: true, |
|
state, |
|
mutations, |
|
actions |
|
} |
|
|
|
|