2019-02-28 08:00:59 +00:00
|
|
|
import Element from 'main/index.js';
|
|
|
|
import { post, get } from './ajax';
|
|
|
|
|
|
|
|
const { version } = Element;
|
|
|
|
|
|
|
|
const hostList = {
|
|
|
|
local: 'http://localhost:3008/',
|
|
|
|
alpha: 'https://ssr.alpha.elenet.me/element-theme-server/',
|
2019-06-04 05:58:24 +00:00
|
|
|
production: 'https://ssr.ele.me/element-theme-server/'
|
2019-02-28 08:00:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const host = hostList[process.env.FAAS_ENV] || hostList.production;
|
|
|
|
|
|
|
|
export const getVars = () => {
|
|
|
|
return get(`${host}getVariable?version=${version}`);
|
|
|
|
};
|
|
|
|
|
2019-05-30 11:49:23 +00:00
|
|
|
export const getTestEle = () => {
|
2019-06-04 05:58:24 +00:00
|
|
|
return get(`${hostList.alpha}getVariable?version=${version}`);
|
2019-05-30 11:49:23 +00:00
|
|
|
};
|
|
|
|
|
2019-02-28 08:00:59 +00:00
|
|
|
export const updateVars = (data, cb) => {
|
|
|
|
return post(`${host}updateVariable?version=${version}`, data, cb);
|
|
|
|
};
|