|
@@ -1,66 +1,48 @@
|
|
|
<template>
|
|
|
<div class="login flex justify-center items-center h-full">
|
|
|
<div class="login-box">
|
|
|
- <div class="left">
|
|
|
- <div class="app-info">
|
|
|
- <a href="http://www.qmth.com.cn" target="_blank"
|
|
|
- >Copyright © 2021 启明泰和 v1.3.12 beta20230601</a
|
|
|
+ <t-form
|
|
|
+ ref="form"
|
|
|
+ :data="formData"
|
|
|
+ :label-width="0"
|
|
|
+ class="login-form"
|
|
|
+ :rules="rules"
|
|
|
+ >
|
|
|
+ <t-form-item name="a">
|
|
|
+ <t-input
|
|
|
+ v-model="formData.a"
|
|
|
+ clearable
|
|
|
+ placeholder="账号"
|
|
|
+ size="large"
|
|
|
>
|
|
|
- <br />
|
|
|
- <a href="https://beian.miit.gov.cn/" target="_blank"
|
|
|
- >鄂ICP备12000033号-3</a
|
|
|
- >
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="right">
|
|
|
- <router-view></router-view>
|
|
|
- <template v-if="isLoginPage">
|
|
|
- <h1>高校考试管理平台</h1>
|
|
|
+ <template #prefix-icon>
|
|
|
+ <desktop-icon />
|
|
|
+ </template>
|
|
|
+ </t-input>
|
|
|
+ </t-form-item>
|
|
|
|
|
|
- <div class="tab-box">
|
|
|
- <t-tabs v-model="loginMode" class="tabs">
|
|
|
- <t-tab-panel value="admin" label="管理员登录"> </t-tab-panel>
|
|
|
- <t-tab-panel value="mark" label="评卷员登录"> </t-tab-panel>
|
|
|
- </t-tabs>
|
|
|
- </div>
|
|
|
- <t-form
|
|
|
- ref="form"
|
|
|
- :data="formData"
|
|
|
- :label-width="0"
|
|
|
- class="login-form"
|
|
|
- :rules="rules"
|
|
|
+ <t-form-item name="b">
|
|
|
+ <t-input
|
|
|
+ v-model="formData.b"
|
|
|
+ type="password"
|
|
|
+ clearable
|
|
|
+ placeholder="密码"
|
|
|
+ size="large"
|
|
|
>
|
|
|
- <t-form-item name="a">
|
|
|
- <t-input
|
|
|
- v-model="formData.a"
|
|
|
- clearable
|
|
|
- placeholder="账号"
|
|
|
- size="large"
|
|
|
- >
|
|
|
- <template #prefix-icon>
|
|
|
- <desktop-icon />
|
|
|
- </template>
|
|
|
- </t-input>
|
|
|
- </t-form-item>
|
|
|
-
|
|
|
- <t-form-item name="b">
|
|
|
- <t-input
|
|
|
- v-model="formData.b"
|
|
|
- type="password"
|
|
|
- clearable
|
|
|
- placeholder="密码"
|
|
|
- size="large"
|
|
|
- >
|
|
|
- <template #prefix-icon>
|
|
|
- <lock-on-icon />
|
|
|
- </template>
|
|
|
- </t-input>
|
|
|
- </t-form-item>
|
|
|
-
|
|
|
- <a class="submit-btn" @click="loginHandle">登 录</a>
|
|
|
- </t-form>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
+ <template #prefix-icon>
|
|
|
+ <lock-on-icon />
|
|
|
+ </template>
|
|
|
+ </t-input>
|
|
|
+ </t-form-item>
|
|
|
+ </t-form>
|
|
|
+ <t-button
|
|
|
+ block
|
|
|
+ class="m-t-30px"
|
|
|
+ @click="loginHandle"
|
|
|
+ size="large"
|
|
|
+ theme="success"
|
|
|
+ >登 录</t-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- <button @click="loginHandle" class="m-t-10px">登录!</button> -->
|
|
@@ -77,13 +59,6 @@ const form = ref(null);
|
|
|
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
-const isLoginPage = computed(() => {
|
|
|
- return route.name === 'Login';
|
|
|
-});
|
|
|
-const loginMode = ref('admin');
|
|
|
-const toggleMode = (m) => {
|
|
|
- loginMode.value = m;
|
|
|
-};
|
|
|
|
|
|
const formData = reactive({
|
|
|
a: '',
|
|
@@ -99,14 +74,7 @@ const rules = {
|
|
|
};
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
-// const loginHandler = async () => {
|
|
|
-// try {
|
|
|
-// await userStore.login({});
|
|
|
-// router.push(redirect);
|
|
|
-// } catch (e) {
|
|
|
-// console.log(e);
|
|
|
-// }
|
|
|
-// };
|
|
|
+
|
|
|
const loginHandle = () => {
|
|
|
form.value.validate().then(async (result) => {
|
|
|
const redirect = route.query.redirect
|
|
@@ -121,64 +89,13 @@ const loginHandle = () => {
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.login {
|
|
|
+ background: rgba(26, 188, 156, 1);
|
|
|
.login-box {
|
|
|
- width: 920px;
|
|
|
- height: 520px;
|
|
|
- background: rgba(255, 255, 255, 0.75);
|
|
|
- box-shadow: 0px 15px 15px 0px rgba(203, 205, 211, 0.3);
|
|
|
- .left {
|
|
|
- width: 320px;
|
|
|
- float: left;
|
|
|
- height: 100%;
|
|
|
- position: relative;
|
|
|
- background: #142862 url(../../assets/imgs/loginbg.png) no-repeat 0 0;
|
|
|
- .app-info {
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- bottom: 40px;
|
|
|
- padding: 0 38px;
|
|
|
- a {
|
|
|
- color: rgba(255, 255, 255, 0.65);
|
|
|
- line-height: 1.5;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .right {
|
|
|
- padding: 95px 130px;
|
|
|
- margin-left: 320px;
|
|
|
- height: 100%;
|
|
|
- position: relative;
|
|
|
- .submit-btn {
|
|
|
- display: block;
|
|
|
- width: 160px;
|
|
|
- height: 54px;
|
|
|
- text-align: center;
|
|
|
- line-height: 54px;
|
|
|
- border-radius: 26px;
|
|
|
- background-image: linear-gradient(to right, #88d3fc, #66ade8);
|
|
|
- margin: 40px auto 0 auto;
|
|
|
- font-size: 20px;
|
|
|
- color: #fff;
|
|
|
- font-weight: 700;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- .login-form {
|
|
|
- margin-top: 30px;
|
|
|
- }
|
|
|
- & > h1 {
|
|
|
- font-size: 23px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- .tab-box {
|
|
|
- margin-top: 30px;
|
|
|
- width: 204px;
|
|
|
- margin-left: auto;
|
|
|
- margin-right: auto;
|
|
|
- .t-tabs {
|
|
|
- background-color: transparent !important;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ width: 350px;
|
|
|
+ background: #fff;
|
|
|
+ box-shadow: rgba(0, 0, 0, 0.35) 0px 0px 10px;
|
|
|
+ border-radius: 10px;
|
|
|
+ padding: 24px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|