From f9b6879cbb899358dc8cae43a2edf358dff7254c Mon Sep 17 00:00:00 2001 From: xmcp Date: Sun, 25 Aug 2019 11:17:25 +0800 Subject: [PATCH] complete api ver param --- src/Message.js | 4 ++-- src/UserAction.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Message.js b/src/Message.js index 2ea98f8..da6b16d 100644 --- a/src/Message.js +++ b/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) diff --git a/src/UserAction.js b/src/UserAction.js index a3e1aea..285204f 100644 --- a/src/UserAction.js +++ b/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',