From 4660f8676ba2d2541d76c6a963ed5e72241e20ee Mon Sep 17 00:00:00 2001 From: xmcp Date: Thu, 11 Apr 2019 17:44:32 +0800 Subject: [PATCH] switch domain --- README.md | 2 +- public/_headers | 11 ----------- public/_redirects | 3 --- src/App.js | 22 +++++++++++++++------- src/flows_api.js | 2 +- 5 files changed, 17 insertions(+), 23 deletions(-) delete mode 100644 public/_headers delete mode 100644 public/_redirects diff --git a/README.md b/README.md index 97017f85..e05bc027 100644 --- a/README.md +++ b/README.md @@ -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 客户端的树洞模块比较,本项目…… diff --git a/public/_headers b/public/_headers deleted file mode 100644 index 2f2954f5..00000000 --- a/public/_headers +++ /dev/null @@ -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 \ No newline at end of file diff --git a/public/_redirects b/public/_redirects deleted file mode 100644 index 950cf225..00000000 --- a/public/_redirects +++ /dev/null @@ -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 \ No newline at end of file diff --git a/src/App.js b/src/App.js index 1f6bef92..6f01f5ab 100644 --- a/src/App.js +++ b/src/App.js @@ -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 (
-

官宣了!

+

树洞又㕛叒换域名了!


-

请访问官方树洞网页版

-

http://pkuhelper.com/hole

-

加载三倍速,访问不卡顿

+

请记住新网址:

+

pkuhelper.pku.edu.cn/hole


-

当前域名将停止维护。

-

@xmcp

+

当前域名我也不清楚什么时候停止维护。

+

另外我们终于支持 HTTPS 和 HTTP/2 了。

+
+ {(token)=>( + !!token.value &&
+

*Tips:

+

点击右上角的 ,复制 User Token,在新网址的登录页面输入,就不用重发验证码了。

+
+
+ )}
+

@xmcp from PKUHelper Team

); diff --git a/src/flows_api.js b/src/flows_api.js index b1f801c7..6f15ecfc 100644 --- a/src/flows_api.js +++ b/src/flows_api.js @@ -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) : '');