|
|
@@ -24,6 +24,8 @@ import WxCreate from "./wechatService/wxCreate/WxCreate";
|
|
|
import {CASE_AND_PROJECT, GET_USER} from "../gql";
|
|
|
import axios from 'axios';
|
|
|
import {getCookie, setCookie} from "../cookie";
|
|
|
+import {logoutUrl} from "../config";
|
|
|
+import Graphiql from "./common/Graphiql";
|
|
|
|
|
|
axios.defaults.withCredentials = true;
|
|
|
|
|
|
@@ -355,9 +357,11 @@ class App extends Component {
|
|
|
<Route path="/wechat-service/trial-case/:case" component={WxTrialCase}/>
|
|
|
<Route path="/wechat-service/my-create/:case" component={WxUserCreate}/>
|
|
|
<Route path="/quant-service/:sidebar/:case" component={QuantService}/>
|
|
|
+ <Route path="/quant-service/:sidebar/:case" component={QuantService}/>
|
|
|
<Route path="/login/:setting" component={Login}/>
|
|
|
<Route path="/login" component={Login}/>
|
|
|
<Route path="/ticket" component={Ticket}/>
|
|
|
+ <Route path="/graphiql" component={Graphiql}/>
|
|
|
<Redirect path="*" to="/"/>
|
|
|
</Switch>
|
|
|
</Layout>
|
|
|
@@ -612,6 +616,17 @@ class User extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ logout = () => {
|
|
|
+
|
|
|
+ axios.get(logoutUrl)
|
|
|
+ .then((res) => {
|
|
|
+ console.log('logout success',res);
|
|
|
+ setCookie("user_id", '');
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
render() {
|
|
|
return (
|
|
|
<Query query={gql(GET_USER)} variables={{id: this.props.userID}}>
|
|
|
@@ -654,6 +669,7 @@ class User extends Component {
|
|
|
<Menu.Item className={'login-out'}>
|
|
|
<a href='https://www.ioobot.com' onClick={(e) => {
|
|
|
e.preventDefault();
|
|
|
+ this.logout();
|
|
|
}}><FormattedMessage id="exit"/></a>
|
|
|
</Menu.Item>
|
|
|
</Menu>
|