export default {
	state: {
		appName: "库房管理系统", // 应用名称
		secName: "", // 应用名称
		themeColor: "#1A7284", // 主题颜色
		oldThemeColor: "#1A7284", // 上一次主题颜色
		collapse: false, // 导航栏收缩状态
		routeLoaded: false, // 菜单和路由是否已经加载
		menuLoaded: false, // 菜单和路由是否已经加载
		serverName: process.env.BASE_API,
		token: "",
	},
	getters: {
		collapse(state) { // 对应着上面state
			return state.collapse 
		}
	},
	mutations: {
		onCollapse(state) { // 改变收缩状态
			state.collapse = !state.collapse
		},
		setThemeColor(state, themeColor) { // 改变主题颜色
			state.oldThemeColor = state.themeColor
			state.themeColor = themeColor
		},
		setMenuLoaded(state, menuLoaded) { // 改变菜单和路由的加载状态
			state.menuLoaded = menuLoaded
		},
		setRouteLoaded(state, routeLoaded) { // 改变菜单和路由的加载状态
			state.routeLoaded = routeLoaded
		},
		setToken(state, token) {
			state.token = token
		},
			setSecName(state, secName) {
			state.secName = secName
		}
	},
	actions: {}
}
