import { getUrlParam } from '@/utils/index';
import store from 'store';

const env = process.env;

// 路由模式
const routerMode = 'hash';

// 请求地址
const baseUrl = (() => {
	let proxy = getUrlParam('proxy');
	console.log('proxy', proxy);

	if (proxy) {
		store.set('proxy', proxy);
	} else {
		proxy = store.get('proxy') || 'dev';
	}

	switch (env.NODE_ENV) {
		case 'development':
			return `/${proxy}`;
		case 'production':
			// return `/api/admin`;
			return `http://api.s.huaml.com`;
		default:
			return '';
	}
})();

// 阿里字体图标库 https://at.alicdn.com/t/**.css
const iconfontUrl = ``;

export { env, routerMode, baseUrl, iconfontUrl };
