const getDefaultState = () => {
  return {
    curPath: null,
    navBarFixed: false,
    showLoginDialog: null,
    navbarStyle: '1',//1-默认蓝色；2-中国风；3-红色
  }
}

const state = getDefaultState()

const mutations = {
  RESET_STATE: (state) => {
    Object.assign(state, getDefaultState())
  },
  SET_NAV_BAR: (state, path) => {
    state.curPath = path
  },
  SET_NAVBAR_FIXED: (state, isFixed) => {
    state.navBarFixed = isFixed
  },
  OPEN_LOGIN_DIALOG: (state, showLoginDialog) => {
    state.showLoginDialog = showLoginDialog
  },
  CHANGE_NAV_COLOR: (state, themeStyle) => {
    state.navbarStyle = themeStyle
  },
}

export default {
  namespaced: true,
  state,
  mutations,
}
