| | |
| | | }, |
| | | |
| | | { |
| | | path: "/logging", |
| | | component: () => import("@/views/logging/index"), |
| | | hidden: true, |
| | | }, |
| | | |
| | | { |
| | | path: "/404", |
| | | component: () => import("@/views/404"), |
| | | hidden: true, |
New file |
| | |
| | | <template> |
| | | <div> |
| | | 登录中…… |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { login } from "@/api/user"; |
| | | |
| | | export default { |
| | | mounted() { |
| | | 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"); |
| | | }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style></style> |
| | |
| | | <script> |
| | | import { validUsername } from "@/utils/validate"; |
| | | import wxlogin from "vue-wxlogin"; |
| | | import { login } from "@/api/user"; |
| | | export default { |
| | | name: "Login", |
| | | components: { wxlogin }, |
| | |
| | | }; |
| | | return { |
| | | appid: "wx7103925df6236723", |
| | | redirect_uri: encodeURIComponent("https://dingdang.9village.cn/#/login"), |
| | | redirect_uri: encodeURIComponent("https://dingdang.9village.cn/#/logging"), |
| | | state: "1", |
| | | href: "data:text/css;base64,LmltcG93ZXJCb3ggLnFyY29kZSB7CiAgICAgICAgICBib3JkZXI6IG5vbmU7CiAgICAgICAgICB3aWR0aDogMTQwcHg7CiAgICAgICAgICBoZWlnaHQ6IDE0MHB4OwogICAgICAgIH0=", // 自定义样式链接 |
| | | loginForm: { |
| | |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | mounted() { |
| | | 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"); |
| | | }); |
| | | }, |
| | | getWeChatUrl() { |
| | | // api.wachatQrUrl().then(res => { |
| | | // if (res && res.code === '0000') { |