mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-19 12:04:02 +08:00
chore: init theme (#14508)
* chore: init theme * chore: update faas config
This commit is contained in:
20
examples/components/theme-configurator/utils/api.js
Normal file
20
examples/components/theme-configurator/utils/api.js
Normal 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);
|
||||
};
|
||||
Reference in New Issue
Block a user