|
|
@@ -48,15 +48,116 @@
|
|
|
.login-btn:hover {
|
|
|
opacity: 0.9;
|
|
|
}
|
|
|
+ * {
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+ body {
|
|
|
+ font-family: 'Arial', sans-serif;
|
|
|
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
+ min-height: 100vh;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .container {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .loading-container {
|
|
|
+ background: rgba(255, 255, 255, 0.95);
|
|
|
+ border-radius: 20px;
|
|
|
+ padding: 40px;
|
|
|
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
|
|
|
+ backdrop-filter: blur(10px);
|
|
|
+ margin-bottom: 30px;
|
|
|
+ transition: all 0.3s ease;
|
|
|
+ }
|
|
|
+
|
|
|
+ .spinner {
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ border: 5px solid #f3f3f3;
|
|
|
+ border-top: 5px solid #667eea;
|
|
|
+ border-radius: 50%;
|
|
|
+ animation: spin 1s linear infinite;
|
|
|
+ margin: 0 auto 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ @keyframes spin {
|
|
|
+ 0% { transform: rotate(0deg); }
|
|
|
+ 100% { transform: rotate(360deg); }
|
|
|
+ }
|
|
|
+
|
|
|
+ .loading-text {
|
|
|
+ font-size: 18px;
|
|
|
+ color: #333;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 准备进入状态样式 */
|
|
|
+ .ready-enter {
|
|
|
+ animation: pulse 2s infinite;
|
|
|
+ }
|
|
|
+
|
|
|
+ @keyframes pulse {
|
|
|
+ 0% {
|
|
|
+ transform: scale(1);
|
|
|
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
|
|
|
+ }
|
|
|
+ 50% {
|
|
|
+ transform: scale(1.05);
|
|
|
+ box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ transform: scale(1);
|
|
|
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .trigger-btn {
|
|
|
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
+ color: white;
|
|
|
+ border: none;
|
|
|
+ padding: 15px 30px;
|
|
|
+ font-size: 16px;
|
|
|
+ border-radius: 50px;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.3s ease;
|
|
|
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
|
|
|
+ }
|
|
|
+
|
|
|
+ .trigger-btn:hover {
|
|
|
+ transform: translateY(-3px);
|
|
|
+ box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
|
|
|
+ }
|
|
|
+
|
|
|
+ .trigger-btn:active {
|
|
|
+ transform: translateY(0);
|
|
|
+ }
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
+<div class="container">
|
|
|
+ <div class="loading-container" id="loadingContainer">
|
|
|
+ <div class="spinner"></div>
|
|
|
+ <div class="loading-text" id="loadingText">加载中...</div>
|
|
|
+ </div>
|
|
|
+<!-- <button class="trigger-btn" id="triggerBtn">发起网络请求</button>-->
|
|
|
+</div>
|
|
|
<!--<div class="login-container">-->
|
|
|
<!-- <h1>在线教育平台</h1>-->
|
|
|
<!-- <button class="login-btn student-btn" onclick="login()">登录</button>-->
|
|
|
<!--</div>-->
|
|
|
-<!--http://localhost:63342/onlineEducation-front/public/html/loginJump.html?_ijt=eqdbr9d1k5uh8if53et5u8j8su&_ij_reload=RELOAD_ON_SAVE&code=126345&type=1&id=1958766027408039938-->
|
|
|
+<!--http://localhost:63342/onlineEducation-front/public/html/loginJump.html?_ijt=eqdbr9d1k5uh8if53et5u8j8su&_ij_reload=RELOAD_ON_SAVE&code=teacher&state=type=1&id=1958766027408039938-->
|
|
|
<script>
|
|
|
+ let loadingContainer
|
|
|
+ let loadingText
|
|
|
+ let triggerBtn
|
|
|
+
|
|
|
|
|
|
let baseUrl = 'http://192.168.1.213:9003'
|
|
|
let baseUrlt = 'http://192.168.1.202:9000'
|
|
|
@@ -64,14 +165,14 @@
|
|
|
// 创建axios实例,参考request.js中的配置
|
|
|
const service = axios.create({
|
|
|
baseURL: '/api',
|
|
|
- timeout: 5000
|
|
|
+ timeout: 10000
|
|
|
});
|
|
|
|
|
|
// 登录函数
|
|
|
const login = async () => {
|
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
|
let code = urlParams.get('code');
|
|
|
- let type = urlParams.get('type');
|
|
|
+ let type = urlParams.get('state').split('=')[1];
|
|
|
let id = urlParams.get('id');
|
|
|
if (code == undefined || type == undefined) {
|
|
|
alert('数据参数不对');
|
|
|
@@ -82,6 +183,9 @@
|
|
|
return
|
|
|
}
|
|
|
console.log('什么数值呢', code)
|
|
|
+
|
|
|
+ loadingContainer.classList.remove('ready-enter');
|
|
|
+ loadingText.textContent = '加载中...';
|
|
|
// 这里需要替换为实际的登录接口URL
|
|
|
const loginUrl = baseUrl+'/api/webapp/disk/CollegeUser/getUser';
|
|
|
|
|
|
@@ -100,15 +204,24 @@
|
|
|
let url = baseUrl+'/api/webapp/auth/b/getLoginUser'
|
|
|
let ress = await service.get(url, {
|
|
|
headers: {
|
|
|
- 'token': res.data.msg,
|
|
|
+ 'token': res.data.data,
|
|
|
}
|
|
|
})
|
|
|
console.log('获取人员信息:', ress);
|
|
|
if(ress.data.code == 200 && ress.data.data.eduIdentity == 1){
|
|
|
+ // 请求完成后切换到准备进入状态
|
|
|
+ loadingText.textContent = '准备进入';
|
|
|
+ loadingContainer.classList.add('ready-enter');
|
|
|
+
|
|
|
+ // 可选:移除spinner,只显示文字
|
|
|
+ const spinner = document.querySelector('.spinner');
|
|
|
+ if (spinner) {
|
|
|
+ spinner.style.display = 'none';
|
|
|
+ }
|
|
|
//去教师段
|
|
|
// 构建带参数的URL
|
|
|
const params = new URLSearchParams({
|
|
|
- token: res.data.msg,
|
|
|
+ userId: ress.data.data.id,
|
|
|
type,
|
|
|
id
|
|
|
});
|
|
|
@@ -150,6 +263,9 @@
|
|
|
// 在<script>标签内添加
|
|
|
window.onload = function() {
|
|
|
console.log('页面加载完成');
|
|
|
+ loadingContainer = document.getElementById('loadingContainer');
|
|
|
+ loadingText = document.getElementById('loadingText');
|
|
|
+ triggerBtn = document.getElementById('triggerBtn');
|
|
|
login()
|
|
|
// 在这里可以执行初始化操作
|
|
|
// 比如自动登录等
|