Browse Source

complete api ver param

dev
xmcp 6 years ago
parent
commit
f9b6879cbb
  1. 4
      src/Message.js
  2. 6
      src/UserAction.js

4
src/Message.js

@ -1,5 +1,5 @@
import React, {Component, PureComponent} from 'react';
import {PKUHELPER_ROOT,get_json} from './flows_api';
import {PKUHELPER_ROOT, get_json, API_VERSION_PARAM} from './flows_api';
import {Time} from './Common';
export class MessageViewer extends PureComponent {
@ -20,7 +20,7 @@ export class MessageViewer extends PureComponent {
this.setState({
loading_status: 'loading',
},()=>{
fetch(PKUHELPER_ROOT+'api_xmcp/hole/system_msg?user_token='+encodeURIComponent(this.props.token))
fetch(PKUHELPER_ROOT+'api_xmcp/hole/system_msg?user_token='+encodeURIComponent(this.props.token)+API_VERSION_PARAM())
.then(get_json)
.then((json)=>{
if(json.error)

6
src/UserAction.js

@ -92,7 +92,9 @@ export class LoginForm extends Component {
loading_status: 'loading',
},()=>{
fetch(
PKUHELPER_ROOT+'api_xmcp/isop/'+api_name+'?user='+encodeURIComponent(this.username_ref.current.value),
PKUHELPER_ROOT+'api_xmcp/isop/'+api_name
+'?user='+encodeURIComponent(this.username_ref.current.value)
+API_VERSION_PARAM()
)
.then(get_json)
.then((json)=>{
@ -127,7 +129,7 @@ export class LoginForm extends Component {
data.append('username', this.username_ref.current.value);
data.append('valid_code', this.password_ref.current.value);
data.append('isnewloginflow', 'true');
fetch(LOGIN_BASE+'/login.php?platform=webhole', {
fetch(LOGIN_BASE+'/login.php?platform=webhole'+API_VERSION_PARAM(), {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',

Loading…
Cancel
Save