|
|
@@ -11,7 +11,7 @@ import gql from "graphql-tag";
|
|
|
import _ from 'lodash';
|
|
|
import {idGen} from "../func";
|
|
|
import {setCookie} from "../cookie";
|
|
|
-import {loginUrl, registerUrl, getIdUrl} from '../config'
|
|
|
+import {loginUrl, registerUrl, getIdUrl, logoutUrl} from '../config'
|
|
|
import {graphqlUrl} from "../config";
|
|
|
|
|
|
axios.defaults.withCredentials = true;
|
|
|
@@ -220,6 +220,17 @@ class LoginInput extends Component {
|
|
|
this._isMounted = false
|
|
|
}
|
|
|
|
|
|
+ logout = () => {
|
|
|
+
|
|
|
+ axios.get(logoutUrl)
|
|
|
+ .then((res) => {
|
|
|
+ console.log('logout success',res);
|
|
|
+ setCookie("user_id", '');
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
render() {
|
|
|
return (
|
|
|
<div>
|
|
|
@@ -277,6 +288,9 @@ class LoginInput extends Component {
|
|
|
loginStatus: '',
|
|
|
loginOnce: true
|
|
|
});
|
|
|
+
|
|
|
+ this.logout();
|
|
|
+
|
|
|
// cookie.remove('ring-session')
|
|
|
}}><FormattedMessage id="exit"/></Button>
|
|
|
<div style={{marginTop: 20}}>
|