Chore: support theme configuration (#15190)

This commit is contained in:
iamkun
2019-04-24 19:52:52 +08:00
committed by hetech
parent 792979b5b9
commit ac3aa99503
76 changed files with 2689 additions and 570 deletions

View File

@@ -0,0 +1,20 @@
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/',
production: 'https://ssr.elenet.me/element-theme-server/'
};
const host = hostList[process.env.FAAS_ENV] || hostList.production;
export const getVars = () => {
return get(`${host}getVariable?version=${version}`);
};
export const updateVars = (data, cb) => {
return post(`${host}updateVariable?version=${version}`, data, cb);
};