chore: use eleme.cn as domain (#15139)

pull/15144/head
hetech 2019-04-16 19:00:32 +08:00 committed by GitHub
parent 116b01d9ff
commit 01a4118c51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -60,14 +60,13 @@
const href = location.href; const href = location.href;
const preferGithub = localStorage.getItem('PREFER_GITHUB'); const preferGithub = localStorage.getItem('PREFER_GITHUB');
if (href.indexOf('element-cn') > -1 || href.indexOf('element.faas') > -1 || preferGithub) return; const cnHref = href.indexOf('eleme.cn') > -1 || href.indexOf('element-cn') > -1 || href.indexOf('element.faas') > -1;
if (cnHref || preferGithub) return;
setTimeout(() => { setTimeout(() => {
if (this.lang !== 'zh-CN') return; if (this.lang !== 'zh-CN') return;
this.$confirm('建议大陆用户访问部署在国内的站点,是否跳转?', '提示') this.$confirm('建议大陆用户访问部署在国内的站点,是否跳转?', '提示')
.then(() => { .then(() => {
location.href = location.href location.replace('https://element.eleme.cn');
.replace('https:', 'http:')
.replace('element.', 'element-cn.');
}) })
.catch(() => { .catch(() => {
localStorage.setItem('PREFER_GITHUB', 'true'); localStorage.setItem('PREFER_GITHUB', 'true');