Commit d905deb3 authored by mercury233's avatar mercury233

test logout

parent ad1b6494
Pipeline #19632 passed with stages
in 1 minute and 22 seconds
......@@ -24,6 +24,9 @@ export default {
signOut(state) {
console.log('sign out');
localStorage.removeItem('token');
if (window.ygopro) {
window.ygopro.logoutUser("YGOMobile萌卡登出");
}
location.href = '/';
return state;
},
......
......@@ -214,6 +214,9 @@ export default {
}
if (pathname === '/logout') {
localStorage.removeItem('token');
if (window.ygopro) {
window.ygopro.logoutUser("YGOMobile 萌卡登出");
}
location.href = query.redirect;
}
});
......
......@@ -4,6 +4,9 @@ import React from 'react';
class Logout extends React.Component {
componentDidMount() {
window.localStorage.removeItem('token');
if (window.ygopro) {
window.ygopro.logoutUser("YGOMobile萌卡已登出");
}
const url = new URL(window.location.href);
const redirect = url.searchParams.get('redirect') || '/';
window.location.href = redirect;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment