| 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 |
| 5 | p {{ st.tr["Authentication successful!"] }} |
| 6 | </template> |
| 7 | |
| 8 | <script> |
| 9 | import { store } from "@/store"; |
| 10 | import { ajax } from "@/utils/ajax"; |
| 11 | export default { |
| 12 | name: "my-auth", |
| 13 | data: function() { |
| 14 | return { |
| 15 | st: store.state |
| 16 | }; |
| 17 | }, |
| 18 | created: function() { |
| 19 | ajax( |
| 20 | "/authenticate", |
| 21 | "GET", |
| 22 | { token: this.$route.params["token"] }, |
| 23 | res => { |
| 24 | this.st.user.id = res.id; |
| 25 | this.st.user.name = res.name; |
| 26 | this.st.user.email = res.email; |
| 27 | this.st.user.notify = res.notify; |
| 28 | localStorage["myname"] = res.name; |
| 29 | localStorage["myid"] = res.id; |
| 30 | } |
| 31 | ); |
| 32 | } |
| 33 | }; |
| 34 | </script> |