forked from newthuhole/hole_thu_frontend
use new backend
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"copy-to-clipboard": "^3.0.8",
|
"copy-to-clipboard": "^3.0.8",
|
||||||
"load-script": "^1.0.0",
|
"load-script": "^1.0.0",
|
||||||
"md5": "^2.2.1",
|
|
||||||
"pressure": "^2.1.2",
|
"pressure": "^2.1.2",
|
||||||
"react": "^16.4.2",
|
"react": "^16.4.2",
|
||||||
"react-dom": "^16.4.2",
|
"react-dom": "^16.4.2",
|
||||||
|
|||||||
12
src/App.js
12
src/App.js
@@ -3,20 +3,10 @@ import {Flow} from './Flows';
|
|||||||
import {Title} from './Title';
|
import {Title} from './Title';
|
||||||
import {Sidebar} from './Sidebar';
|
import {Sidebar} from './Sidebar';
|
||||||
import {PressureHelper} from './PressureHelper';
|
import {PressureHelper} from './PressureHelper';
|
||||||
import {TokenCtx,ISOP_APPKEY} from './UserAction';
|
import {TokenCtx} from './UserAction';
|
||||||
import {load_config,bgimg_style} from './Config';
|
import {load_config,bgimg_style} from './Config';
|
||||||
|
|
||||||
function DeprecatedAlert(props) {
|
function DeprecatedAlert(props) {
|
||||||
if(document.domain==='hole.xmcp.ml')
|
|
||||||
return (
|
|
||||||
<div className="flow-item">
|
|
||||||
<div className="box box-tip">
|
|
||||||
<p><b>请使用新域名访问P大树洞!</b></p>
|
|
||||||
<p><a href="http://pkuhelper.pku.edu.cn/hole/">pkuhelper.pku.edu.cn/hole</a></p>
|
|
||||||
<p>当前域名将停止支持</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import React, {Component, PureComponent} from 'react';
|
import React, {Component, PureComponent} from 'react';
|
||||||
import {ISOP_APPKEY,ISOP_APPCODE,ISOP_SVCID} from './infrastructure/const';
|
|
||||||
import copy from 'copy-to-clipboard';
|
import copy from 'copy-to-clipboard';
|
||||||
import {API_BASE,SafeTextarea} from './Common';
|
import {API_BASE,SafeTextarea} from './Common';
|
||||||
import {MessageViewer} from './Message';
|
import {MessageViewer} from './Message';
|
||||||
import {API_VERSION_PARAM,PKUHELPER_ROOT,API,get_json} from './flows_api';
|
import {API_VERSION_PARAM,PKUHELPER_ROOT,API,get_json} from './flows_api';
|
||||||
import md5 from 'md5';
|
|
||||||
|
|
||||||
import './UserAction.css';
|
import './UserAction.css';
|
||||||
|
|
||||||
@@ -15,8 +13,6 @@ const MAX_IMG_DIAM=8000;
|
|||||||
const MAX_IMG_PX=6000000;
|
const MAX_IMG_PX=6000000;
|
||||||
const MAX_IMG_FILESIZE=450000*BASE64_RATE;
|
const MAX_IMG_FILESIZE=450000*BASE64_RATE;
|
||||||
|
|
||||||
export {ISOP_APPKEY,ISOP_APPCODE,ISOP_SVCID};
|
|
||||||
|
|
||||||
export const TokenCtx=React.createContext({
|
export const TokenCtx=React.createContext({
|
||||||
value: null,
|
value: null,
|
||||||
set_value: ()=>{},
|
set_value: ()=>{},
|
||||||
@@ -95,15 +91,8 @@ export class LoginForm extends Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
loading_status: 'loading',
|
loading_status: 'loading',
|
||||||
},()=>{
|
},()=>{
|
||||||
let param=
|
|
||||||
'user='+this.username_ref.current.value+
|
|
||||||
'&svcId='+ISOP_SVCID+
|
|
||||||
'&appKey='+ISOP_APPKEY+
|
|
||||||
'×tamp='+(+new Date());
|
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
PKUHELPER_ROOT+'isop_proxy/'+api_name+'?'+param+
|
PKUHELPER_ROOT+'api_xmcp/isop/'+api_name+'?user='+encodeURIComponent(this.username_ref.current.value),
|
||||||
'&msg='+md5(param+ISOP_APPCODE),
|
|
||||||
)
|
)
|
||||||
.then(get_json)
|
.then(get_json)
|
||||||
.then((json)=>{
|
.then((json)=>{
|
||||||
|
|||||||
Submodule src/infrastructure updated: 1bbc568e5f...d1b302d3d1
Reference in New Issue
Block a user