complete api ver param

This commit is contained in:
xmcp
2019-08-25 11:17:25 +08:00
parent 3bfa5bf2ca
commit f9b6879cbb
2 changed files with 6 additions and 4 deletions

View File

@@ -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)

View File

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