import {
	setStore
} from '@/untils/store.js'

const hostDic = {
	'10.165.0.173': {
		name: '劳动力转移就业公共服务平台',
		id: '1'
	}
}

export function setPlatform($store, platformId, platformName) {
	if (platformId) {
		$store.commit('SET_HOME_NAV_SHOW', false);
		$store.commit('SET_HOME_TITLE', platformName);
		setStore({
			name: 'platformId',
			content: platformId
		})
	}
}

export function setPlatformByHostName($store) {
	const hostname = window.location.hostname
	if (hostDic.hasOwnProperty(hostname)) {
		const dic = hostDic[hostname]
		setPlatform($store, dic.id, dic.name)
	}
}
