switch domain

This commit is contained in:
xmcp
2019-04-11 17:44:32 +08:00
parent 7219ff5a48
commit 4660f8676b
5 changed files with 17 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
React 版 P大树洞[pkuhelper.com/hole](http://pkuhelper.com/hole/)
React 版 P大树洞[pkuhelper.pku.edu.cn/hole](https://pkuhelper.pku.edu.cn/hole/)
与 PKU Helper 客户端的树洞模块比较,本项目……

View File

@@ -1,11 +0,0 @@
/static/*
Cache-Control: public, max-age=86400
/service-worker.js
Cache-Control: public, max-age=86400
/
Cache-Control: public, max-age=120
/?src=pwa
Cache-Control: public, max-age=120

View File

@@ -1,3 +0,0 @@
/api_proxy/* http://www.pkuhelper.com:10301/services/pkuhole/:splat 200
/audio_proxy/* http://www.pkuhelper.com:10301/services/pkuhole/audios/:splat 200
/login_proxy/* http://www.pkuhelper.com:10301/services/login/:splat 200

View File

@@ -8,18 +8,26 @@ import {TokenCtx,ISOP_APPKEY} from './UserAction';
import ImasuguApp from './imasugu/src/App';
function DeprecatedAlert(props) {
if(['pkuhelper.com','www.pkuhelper.com','webhole.xmcp.ml','127.0.0.1','localhost'].indexOf(document.domain)===-1)
if(['pkuhelper.pku.edu.cn','127.0.0.1','localhostx'].indexOf(document.domain)===-1)
return (
<div className="flow-item-row">
<div className="box box-tip aux-margin">
<p><b>官宣</b></p>
<p><b>树洞又㕛叒换域名</b></p>
<br />
<p>访问官方树洞网页版</p>
<p><a href="http://pkuhelper.com/hole">http://pkuhelper.com/hole</a></p>
<p>加载三倍速访问不卡顿</p>
<p>记住新网址</p>
<p><a href="https://pkuhelper.pku.edu.cn/hole">pkuhelper.pku.edu.cn/hole</a></p>
<br />
<p>当前域名停止维护</p>
<p>@xmcp</p>
<p>当前域名我也不清楚什么时候停止维护</p>
<p>另外我们终于支持 HTTPS HTTP/2 </p>
<br />
<TokenCtx.Consumer>{(token)=>(
!!token.value && <div>
<p>*Tips: </p>
<p>点击右上角的 <span className="icon icon-about" /> 复制 User Token在新网址的登录页面输入就不用重发验证码了</p>
<br />
</div>
)}</TokenCtx.Consumer>
<p>@xmcp from PKUHelper Team</p>
</div>
</div>
);

View File

@@ -2,7 +2,7 @@ import {API_BASE} from './Common';
export const API_VERSION_PARAM='&PKUHelperAPI=3.0';
export const PKUHELPER_ROOT= // don't use :10301 if we are already in the same domain
(document.domain==='pkuhelper.com'||document.domain==='www.pkuhelper.com') ? '/' : '//pkuhelper.com/';
document.domain==='pkuhelper.pku.edu.cn' ? '/' : '//pkuhelper.pku.edu.cn/';
function token_param(token) {
return API_VERSION_PARAM + (token ? ('&user_token='+token) : '');