<template>
    <div class="login"></div>
</template>

<script setup>
// import { getScanUrl } from '@/api/login';
import { encrypt, decrypt } from '@/utils/jsencrypt';
import * as ww from '@wecom/jssdk';
import useUserStore from '@/store/modules/user';

const userStore = useUserStore();
const route = useRoute();
const router = useRouter();

const loginForm = ref({
    username: '', //admin
    password: '', //admin123
    rememberMe: false,
    code: '',
    uuid: '',
});

const codeUrl = ref('');
const loading = ref(false);
// 验证码开关
const captchaEnabled = ref(true);
// 注册开关
const register = ref(false);
const redirect = ref(undefined);
const scanShow = ref(false);
const scanUrl = ref('');

watch(
    route,
    newRoute => {
        redirect.value = newRoute.query && newRoute.query.redirect;
        console.log(newRoute.query);
        console.log(newRoute);
    },
    { immediate: true }
);

function getUrlParams2(url) {
    let urlStr = url.split('?')[1];
    const urlSearchParams = new URLSearchParams(urlStr);
    const result = Object.fromEntries(urlSearchParams.entries());
    return result;
}

function getConfig() {
    getQwxconfig().then(res => {});
}
</script>

<style lang="scss" scoped>
.login {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background-image: url('../assets/images/login-background.jpg');
    background-size: cover;
    position: relative;
}
.title {
    margin: 0px auto 30px auto;
    text-align: center;
    color: #707070;
}

.login-form {
    border-radius: 6px;
    background: #ffffff;
    width: 400px;
    padding: 25px 25px 5px 25px;
    position: relative;
    .scan-box {
        position: absolute;
        top: 0;
        right: 0;
    }
    .scan-iframe {
        width: 100%;
        height: 400px;
        border: 0;
    }
    .el-input {
        height: 40px;
        input {
            height: 40px;
        }
    }
    .input-icon {
        height: 39px;
        width: 14px;
        margin-left: 0px;
    }
}
.login-tip {
    font-size: 13px;
    text-align: center;
    color: #bfbfbf;
}
.login-code {
    width: 33%;
    height: 40px;
    float: right;
    img {
        cursor: pointer;
        vertical-align: middle;
    }
}
.el-login-footer {
    height: 40px;
    line-height: 40px;
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    font-family: Arial;
    font-size: 12px;
    letter-spacing: 1px;
}
.login-code-img {
    height: 40px;
    padding-left: 12px;
}
</style>
