| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getCodeImg } from "@/api/login" |
| | | import { getCodeImg, authBinding } from "@/api/login" |
| | | import Cookies from "js-cookie" |
| | | import { encrypt, decrypt } from "@/utils/jsencrypt" |
| | | import useUserStore from "@/store/modules/user" |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const userStore = useUserStore() |
| | | const route = useRoute() |
| | |
| | | const register = ref(false) |
| | | const redirect = ref(undefined) |
| | | |
| | | watch( |
| | | route, |
| | | (newRoute) => { |
| | | redirect.value = newRoute.query && newRoute.query.redirect |
| | | }, |
| | | { immediate: true } |
| | | ) |
| | | // watch( |
| | | // route, |
| | | // (newRoute) => { |
| | | // redirect.value = newRoute.query && newRoute.query.redirect |
| | | // }, |
| | | // { immediate: true } |
| | | // ) |
| | | |
| | | function handleLogin() { |
| | | proxy.$refs.loginRef.validate((valid) => { |
| | |
| | | } |
| | | } |
| | | |
| | | getCode() |
| | | getCookie() |
| | | /** |
| | | * 第三方登录 |
| | | * @param type |
| | | */ |
| | | const doSocialLogin = () => { |
| | | console.log("doSocialLogin") |
| | | authBinding().then((res) => { |
| | | console.log(res); |
| | | if (res.code === 200) { |
| | | // 获取授权地址跳转 |
| | | window.location.href = res.data; |
| | | } else { |
| | | ElMessage.error(res.msg); |
| | | } |
| | | }); |
| | | }; |
| | | // 非单点登录放开下边两行,否则注释掉 |
| | | // getCode() |
| | | // getCookie() |
| | | // 单点登录放开下边一行,否则注释掉 |
| | | doSocialLogin() |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .login { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 100%; |
| | | background-image: url("@/assets/images/login-background.jpg"); |
| | | height: 100vh; |
| | | background-image: url("@/assets/images/login-background.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | flex-direction: column; |
| | | position: relative; |
| | | min-width: 700px; |
| | | min-height: 700px; |
| | | background-color:#001146 |
| | | } |
| | | |
| | | .middle-view { |