| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <template>
- <div class="quick-login-container">
- <div class="loading-overlay">
- <div class="loading-content">
- <el-loading-spinner class="loading-spinner"></el-loading-spinner>
- <p class="loading-text">登录中...</p>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import { onMounted } from 'vue'
- import { useRouter } from 'vue-router'
- import { autoLogin } from '@/utils/loginUtils.js'
- const router = useRouter()
- // 测试账号信息
- const testAccount = {
- tenantName: import.meta.env.VITE_APP_TITLE,
- username: import.meta.env.VITE_APP_GUANGDIAN_LOGIN_USERNAME,
- password: import.meta.env.VITE_APP_GUANGDIAN_LOGIN_PASSWORD
- }
- // 组件挂载时立即执行自动登录
- onMounted(async () => {
- await autoLogin(
- testAccount.tenantName,
- testAccount.username,
- testAccount.password,
- router,
- '/ai-general-course'
- )
- })
- </script>
- <style scoped>
- .quick-login-container {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- background: linear-gradient(to bottom, #001169, #8a78d0);
- }
- .loading-overlay {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 100%;
- }
- .loading-content {
- text-align: center;
- color: white;
- }
- .loading-spinner {
- width: 60px;
- height: 60px;
- margin-bottom: 20px;
- }
- .loading-text {
- font-size: 18px;
- font-weight: 500;
- }
- </style>
|