| | |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | beforeRouteUpdate(route, from, next) { |
| | | this.redirect = route.query && route.query.redirect; |
| | | let code = route.query.code; |
| | | if (code) { |
| | | this.getUserDate(code); |
| | | } else { |
| | | this.getWeChatUrl(); |
| | | } |
| | | }, |
| | | mounted() { |
| | | let code = this.$route.query.code; |
| | | if (code) { |
| | | this.getUserDate(code); |
| | | } else { |
| | | this.getWeChatUrl(); |
| | | } |
| | | let code = this.$route.query.code; |
| | | if (code) { |
| | | this.getUserDate(code); |
| | | } else { |
| | | this.getWeChatUrl(); |
| | | } |
| | | }, |
| | | methods: { |
| | | getUserDate(code) { |
| | | login({ |
| | | code: code, |
| | | }).then((res) => { |
| | | localStorage.setItem("user", JSON.stringify(res)); |
| | | this.$router.push("/student"); |
| | | }); |
| | | getUserDate(code) { |
| | | login({ |
| | | code: code, |
| | | }).then((res) => { |
| | | localStorage.setItem("user", JSON.stringify(res)); |
| | | this.$router.push("/student"); |
| | | }); |
| | | }, |
| | | getWeChatUrl() { |
| | | // api.wachatQrUrl().then(res => { |