Skip to content

Commit

Permalink
Chore: update api host (ElemeFE#15784)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun authored and lzq4047 committed May 22, 2020
1 parent 39bd33a commit 5aade2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/components/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
import compoLang from '../i18n/component.json';
import Element from 'main/index.js';
import themeLoader from './theme/loader';
import { getVars } from './theme/loader/api.js';
import { getTestEle } from './theme/loader/api.js';
import bus from '../bus';
import { ACTION_USER_CONFIG_UPDATE } from './theme/constant.js';
Expand Down Expand Up @@ -425,7 +425,7 @@
}
},
mounted() {
getVars()
getTestEle()
.then(() => {
this.$isEle = true;
ga('send', 'event', 'DocView', 'Inner');
Expand Down
7 changes: 6 additions & 1 deletion examples/components/theme/loader/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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/'
production: 'https://ssr.ele.me/element-theme-server/',
productionEle: 'https://ssr.elenet.me/element-theme-server/'
};

const host = hostList[process.env.FAAS_ENV] || hostList.production;
Expand All @@ -15,6 +16,10 @@ export const getVars = () => {
return get(`${host}getVariable?version=${version}`);
};

export const getTestEle = () => {
return get(`${hostList.productionEle}getVariable?version=${version}`);
};

export const updateVars = (data, cb) => {
return post(`${host}updateVariable?version=${version}`, data, cb);
};

0 comments on commit 5aade2b

Please sign in to comment.