use new backend

This commit is contained in:
xmcp
2019-08-07 15:07:55 +08:00
parent acdf8664d9
commit b17b792f97
4 changed files with 3 additions and 25 deletions

View File

@@ -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",

View File

@@ -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;
} }

View File

@@ -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+
'&timestamp='+(+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)=>{