| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getCodeImg } from "@/api/login" |
| | | // import { getCodeImg } from "@/api/login" |
| | | import Cookies from "js-cookie" |
| | | import { encrypt, decrypt } from "@/utils/jsencrypt" |
| | | import useUserStore from '@/store/modules/user' |
| | |
| | | }).catch(() => { |
| | | loading.value = false |
| | | // 重新获取验证码 |
| | | if (captchaEnabled.value) { |
| | | getCode() |
| | | } |
| | | // if (captchaEnabled.value) { |
| | | // getCode() |
| | | // } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function getCode() { |
| | | getCodeImg().then(res => { |
| | | captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled |
| | | if (captchaEnabled.value) { |
| | | codeUrl.value = "data:image/gif;base64," + res.img |
| | | loginForm.value.uuid = res.uuid |
| | | } |
| | | }) |
| | | } |
| | | // function getCode() { |
| | | // getCodeImg().then(res => { |
| | | // captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled |
| | | // if (captchaEnabled.value) { |
| | | // codeUrl.value = "data:image/gif;base64," + res.img |
| | | // loginForm.value.uuid = res.uuid |
| | | // } |
| | | // }) |
| | | // } |
| | | |
| | | function getCookie() { |
| | | const username = Cookies.get("username") |
| | |
| | | } |
| | | } |
| | | |
| | | getCode() |
| | | // getCode() |
| | | getCookie() |
| | | </script> |
| | | |
| | |
| | | //justify-content: center; |
| | | //align-items: center; |
| | | height: 100%; |
| | | background-image: url("../assets/images/login-background.png"); |
| | | background-image: url("../assets/images/Logo2Back.jpg"); |
| | | background-size: cover; |
| | | position: relative; |
| | | } |
| | |
| | | } |
| | | .login-card { |
| | | background: #ffffff; |
| | | width: 384px; |
| | | padding: 20px; |
| | | width: 430px; |
| | | position: absolute; |
| | | top: 50%; |
| | | transform: translate(0, -50%); |
| | | right: 206px; |
| | | } |
| | | @media (max-width: 992px) { |
| | | .login-card { |
| | | width: 300px; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; /* 新增水平定位基准 */ |
| | | transform: translate(-50%, -50%); /* 同时处理XY轴偏移 */ |
| | | } |
| | | } |
| | | .login-form { |
| | | border-radius: 6px; |
| | |
| | | font-size: 20px; |
| | | color: #000000; |
| | | } |
| | | @media (max-width: 992px) { |
| | | :deep(.el-form-item__content) { |
| | | width: 260px; |
| | | |
| | | } |
| | | } |
| | | </style> |