Commit | Line | Data |
---|---|---|
a3ac374b BA |
1 | <template lang="pug"> |
2 | main | |
3 | .row | |
4 | .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 | |
910d631b | 5 | p {{ st.tr["Logout successful!"] }} |
a3ac374b BA |
6 | </template> |
7 | ||
8 | <script> | |
9 | import { store } from "@/store"; | |
10 | import { ajax } from "@/utils/ajax"; | |
a3ac374b | 11 | export default { |
6808d7a1 | 12 | name: "my-logout", |
a3ac374b BA |
13 | data: function() { |
14 | return { | |
910d631b | 15 | st: store.state |
a3ac374b BA |
16 | }; |
17 | }, | |
18 | created: function() { | |
910d631b BA |
19 | ajax( |
20 | "/logout", | |
21 | "GET", | |
22 | () => { | |
23 | this.st.user.id = 0; | |
24 | this.st.user.name = ""; | |
25 | this.st.user.email = ""; | |
26 | this.st.user.notify = false; | |
27 | localStorage.removeItem("myid"); | |
28 | localStorage.removeItem("myname"); | |
29 | } | |
30 | ); | |
6808d7a1 | 31 | } |
a3ac374b BA |
32 | }; |
33 | </script> |