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

const hostDic = {
	'xhwsd.jobslink.cn': {
		name: '劳动力转移就业公共服务平台',
		id: '773491043336192037'
	},
	'lihuayaoye.jobslink.cn': {
		name: '河北利华药业有限公司',
		id: '773491043327803404'
	},
	'shangchensuye.jobslink.cn': {
		name: '河北尚辰塑业有限公司',
		id: '773491043336192009'
	},
	'jinliu.jobslink.cn': {
		name: '河北金柳化纤有限公司',
		id: '773491043323609148'
	},
	'zhanlifangshui.jobslink.cn': {
		name: '河北展利防水机械装备有限公司',
		id: '773491043336192000'
	},
	'sjzjiecheng.jobslink.cn': {
		name: '石家庄捷成门窗有限公司',
		id: '773491043327803407'
	},
	'aoyinlaye.jobslink.cn': {
		name: '奥垠行唐蜡业有限公司',
		id: '773491043336192014'
	},
	'qytongfatielu.jobslink.cn': {
		name: '河北同发铁路工程集团有限公司',
		id: '773491043323609097'
	},
	'mmingda.jobslink.cn': {
		name: '河北科创明达信息科技有限公司',
		id: '773491043323609128'
	},
	'xibumahua.jobslink.cn': {
		name: '西部马华',
		id: '773491043327803395'
	},
	'kaixuanxinyue.jobslink.cn': {
		name: '凯旋鑫悦',
		id: '773491043331997734'
	},
}

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)
	}
}
