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 | |
f0c68a04 BA |
5 | div(v-if="logoutOk") |
6 | p {{ st.tr["Logout successful!"] }} | |
a3ac374b BA |
7 | </template> |
8 | ||
9 | <script> | |
10 | import { store } from "@/store"; | |
11 | import { ajax } from "@/utils/ajax"; | |
a3ac374b | 12 | export default { |
6808d7a1 | 13 | name: "my-logout", |
a3ac374b BA |
14 | data: function() { |
15 | return { | |
f0c68a04 BA |
16 | st: store.state, |
17 | logoutOk: false | |
a3ac374b BA |
18 | }; |
19 | }, | |
20 | created: function() { | |
910d631b BA |
21 | ajax( |
22 | "/logout", | |
23 | "GET", | |
24 | () => { | |
f0c68a04 | 25 | this.logoutOk = true; |
910d631b BA |
26 | this.st.user.id = 0; |
27 | this.st.user.name = ""; | |
28 | this.st.user.email = ""; | |
29 | this.st.user.notify = false; | |
30 | localStorage.removeItem("myid"); | |
31 | localStorage.removeItem("myname"); | |
32 | } | |
33 | ); | |
6808d7a1 | 34 | } |
a3ac374b BA |
35 | }; |
36 | </script> |