|
|
|
@@ -36,17 +36,17 @@ const { authPanelCenter, authPanelLeft, authPanelRight, isDark } =
|
|
|
|
|
usePreferences();
|
|
|
|
|
</script> -->
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import { useAuthStore } from '../../../../../apps/web-antd/src/store'
|
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
import { useAuthStore } from '../../../../../apps/web-antd/src/store';
|
|
|
|
|
import { Checkbox } from 'ant-design-vue';
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const authStore = useAuthStore();
|
|
|
|
|
|
|
|
|
|
// 响应式数据
|
|
|
|
|
const username = ref('')
|
|
|
|
|
const password = ref('')
|
|
|
|
|
const rememberMe = ref(false)
|
|
|
|
|
const username = ref('');
|
|
|
|
|
const password = ref('');
|
|
|
|
|
const rememberMe = ref(false);
|
|
|
|
|
|
|
|
|
|
// 页面加载时恢复用户名
|
|
|
|
|
onMounted(() => {
|
|
|
|
@@ -58,55 +58,59 @@ onMounted(() => {
|
|
|
|
|
});
|
|
|
|
|
function getRetUrlParam() {
|
|
|
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
|
|
|
console.log('urlParams', urlParams);
|
|
|
|
|
return urlParams.get('returl');
|
|
|
|
|
}
|
|
|
|
|
const retUrl : string | null = getRetUrlParam();
|
|
|
|
|
const retUrl: string | null = getRetUrlParam();
|
|
|
|
|
|
|
|
|
|
// 登录逻辑
|
|
|
|
|
const login = () => {
|
|
|
|
|
// 验证输入
|
|
|
|
|
if (!username.value.trim()) {
|
|
|
|
|
alert('请输入用户名')
|
|
|
|
|
return
|
|
|
|
|
alert('请输入用户名');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!password.value.trim()) {
|
|
|
|
|
alert('请输入密码')
|
|
|
|
|
return
|
|
|
|
|
alert('请输入密码');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 模拟登录请求
|
|
|
|
|
console.log('正在登录...', { username: username.value, password: password.value })
|
|
|
|
|
console.log('正在登录...', {
|
|
|
|
|
username: username.value,
|
|
|
|
|
password: password.value,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
alert('登录成功!')
|
|
|
|
|
alert('登录成功!');
|
|
|
|
|
|
|
|
|
|
// 存储用户名
|
|
|
|
|
if (rememberMe.value) {
|
|
|
|
|
localStorage.setItem('rememberedUser', username.value)
|
|
|
|
|
localStorage.setItem('rememberedUser', username.value);
|
|
|
|
|
} else {
|
|
|
|
|
localStorage.removeItem('rememberedUser')
|
|
|
|
|
localStorage.removeItem('rememberedUser');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 跳转页面
|
|
|
|
|
router.push('/navigation')
|
|
|
|
|
}, 800)
|
|
|
|
|
}
|
|
|
|
|
router.push('/navigation');
|
|
|
|
|
}, 800);
|
|
|
|
|
};
|
|
|
|
|
const handleAccountLogin = async () => {
|
|
|
|
|
try {
|
|
|
|
|
// const requestParam: any = omit(values, ['code']);
|
|
|
|
|
// 登录
|
|
|
|
|
await authStore.authLogin({
|
|
|
|
|
grantType: "password",
|
|
|
|
|
grantType: 'password',
|
|
|
|
|
password: password.value,
|
|
|
|
|
tenantId: "000000",
|
|
|
|
|
tenantId: '000000',
|
|
|
|
|
username: username.value,
|
|
|
|
|
retUrl: retUrl,
|
|
|
|
|
});
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error(error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
@@ -122,7 +126,11 @@ const handleAccountLogin = async () => {
|
|
|
|
|
<h3>用户登录</h3>
|
|
|
|
|
<!-- 用户名输入 -->
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
<img src="../../../../../apps/web-antd/src/assets/my.png" alt="User Icon" class="input-icon">
|
|
|
|
|
<img
|
|
|
|
|
src="../../../../../apps/web-antd/src/assets/my.png"
|
|
|
|
|
alt="User Icon"
|
|
|
|
|
class="input-icon"
|
|
|
|
|
/>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder="请输入您的用户名"
|
|
|
|
@@ -132,7 +140,11 @@ const handleAccountLogin = async () => {
|
|
|
|
|
|
|
|
|
|
<!-- 密码输入 -->
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
<img src="../../../../../apps/web-antd/src/assets/mima.png" alt="Password Icon" class="input-icon">
|
|
|
|
|
<img
|
|
|
|
|
src="../../../../../apps/web-antd/src/assets/mima.png"
|
|
|
|
|
alt="Password Icon"
|
|
|
|
|
class="input-icon"
|
|
|
|
|
/>
|
|
|
|
|
<input
|
|
|
|
|
type="password"
|
|
|
|
|
placeholder="请输入您的密码"
|
|
|
|
@@ -280,7 +292,8 @@ const handleAccountLogin = async () => {
|
|
|
|
|
<style scoped>
|
|
|
|
|
@font-face {
|
|
|
|
|
font-family: 'BaiduVariety';
|
|
|
|
|
src: url('../../../../../apps/web-antd/src/assets/fonts/百度综艺简体.ttf') format('truetype');
|
|
|
|
|
src: url('../../../../../apps/web-antd/src/assets/fonts/百度综艺简体.ttf')
|
|
|
|
|
format('truetype');
|
|
|
|
|
font-weight: normal;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
}
|
|
|
|
@@ -293,14 +306,16 @@ const handleAccountLogin = async () => {
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
background:
|
|
|
|
|
/* url('../../../../../apps/web-antd/src/assets/juxing.png') no-repeat center center fixed, */
|
|
|
|
|
url('../../../../../apps/web-antd/src/assets/222.png') no-repeat center center fixed;
|
|
|
|
|
background-size: 100% 100%, 100% 100%;
|
|
|
|
|
/* url('../../../../../apps/web-antd/src/assets/juxing.png') no-repeat center center fixed, */ url('../../../../../apps/web-antd/src/assets/222.png')
|
|
|
|
|
no-repeat center center fixed;
|
|
|
|
|
background-size:
|
|
|
|
|
100% 100%,
|
|
|
|
|
100% 100%;
|
|
|
|
|
/* background-repeat: no-repeat, no-repeat;
|
|
|
|
|
background-position: center center, center center; */
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
.login-wapter{
|
|
|
|
|
.login-wapter {
|
|
|
|
|
position: relative;
|
|
|
|
|
top: -115px; /* 负值越大,越往上 */
|
|
|
|
|
.login-wapter1 {
|
|
|
|
@@ -308,8 +323,8 @@ const handleAccountLogin = async () => {
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
.login-wapter2 {
|
|
|
|
|
}
|
|
|
|
|
.login-wapter2 {
|
|
|
|
|
font-size: 60px;
|
|
|
|
|
/* margin-bottom: 38px; */
|
|
|
|
|
background: linear-gradient(to bottom, #ffffff, #cbeaff);
|
|
|
|
@@ -320,9 +335,9 @@ const handleAccountLogin = async () => {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-family: 'BaiduVariety',sans-serif;
|
|
|
|
|
font-family: 'BaiduVariety', sans-serif;
|
|
|
|
|
letter-spacing: 6px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.login-bg_1 {
|
|
|
|
|
flex-direction: column;
|
|
|
|
@@ -335,7 +350,8 @@ const handleAccountLogin = async () => {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
background: url('../../../../../apps/web-antd/src/assets/from.png') no-repeat center center fixed;
|
|
|
|
|
background: url('../../../../../apps/web-antd/src/assets/from.png') no-repeat
|
|
|
|
|
center center fixed;
|
|
|
|
|
}
|
|
|
|
|
.login-form {
|
|
|
|
|
border-radius: 10px;
|
|
|
|
@@ -380,8 +396,8 @@ input:-webkit-autofill {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
border: none;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
background-color: #19DCF8;
|
|
|
|
|
color: #0254A5;
|
|
|
|
|
background-color: #19dcf8;
|
|
|
|
|
color: #0254a5;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 22px;
|
|
|
|
|
margin-top: 70px;
|
|
|
|
@@ -401,8 +417,6 @@ input:-webkit-autofill {
|
|
|
|
|
color: #eee;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 新增 .input-group 样式 */
|
|
|
|
|
.input-group {
|
|
|
|
|
display: flex;
|
|
|
|
@@ -433,7 +447,7 @@ input:-webkit-autofill {
|
|
|
|
|
.login-form input::placeholder {
|
|
|
|
|
color: rgba(255, 255, 255, 0.42); /* 例如灰色 */
|
|
|
|
|
}
|
|
|
|
|
.login-footer{
|
|
|
|
|
.login-footer {
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|