登录请求错误解决
This commit is contained in:
parent
4a2cacbd8f
commit
80ee63236a
@ -1,4 +1,4 @@
|
|||||||
import request from '../request'
|
// import request from '../request'
|
||||||
import type { ApiResponse } from '../types'
|
import type { ApiResponse } from '../types'
|
||||||
|
|
||||||
// 活动相关的类型定义
|
// 活动相关的类型定义
|
||||||
|
@ -5,7 +5,7 @@ import type {
|
|||||||
User,
|
User,
|
||||||
LoginRequest,
|
LoginRequest,
|
||||||
LoginResponse,
|
LoginResponse,
|
||||||
BackendLoginResponse,
|
// BackendLoginResponse,
|
||||||
RegisterRequest,
|
RegisterRequest,
|
||||||
UserProfile,
|
UserProfile,
|
||||||
} from '../types'
|
} from '../types'
|
||||||
|
@ -14,7 +14,7 @@ export function useNetworkStatus() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const startTime = Date.now()
|
const startTime = Date.now()
|
||||||
const response = await fetch('/favicon.ico', {
|
await fetch('/favicon.ico', {
|
||||||
method: 'HEAD',
|
method: 'HEAD',
|
||||||
cache: 'no-cache'
|
cache: 'no-cache'
|
||||||
})
|
})
|
||||||
|
@ -1,36 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="activity-detail-page">
|
<div class="activity-detail-page">
|
||||||
<!-- 顶部导航栏 -->
|
|
||||||
<header class="top-header">
|
|
||||||
<div class="container">
|
|
||||||
<div class="header-content">
|
|
||||||
<div class="logo-section">
|
|
||||||
<img src="/logo/logo1.png" alt="Logo" class="logo" />
|
|
||||||
<span class="logo-text">首页</span>
|
|
||||||
</div>
|
|
||||||
<nav class="main-nav">
|
|
||||||
<a href="#" class="nav-item active">🔥 热门活动</a>
|
|
||||||
<a href="#" class="nav-item">专项训练</a>
|
|
||||||
<a href="#" class="nav-item">学习力量</a>
|
|
||||||
<a href="#" class="nav-item">竞赛活动</a>
|
|
||||||
<a href="#" class="nav-item">活动 <span class="hot-badge">HOT</span></a>
|
|
||||||
</nav>
|
|
||||||
<div class="header-right">
|
|
||||||
<div class="search-box">
|
|
||||||
<input type="text" placeholder="请输入关键词搜索内容" />
|
|
||||||
<button class="search-btn">🔍</button>
|
|
||||||
</div>
|
|
||||||
<div class="user-actions">
|
|
||||||
<span class="user-info">🌙 切换登录</span>
|
|
||||||
<span class="user-info">🌐 中文 3IP ⚙</span>
|
|
||||||
<span class="user-info">👤 管理员</span>
|
|
||||||
<button class="login-btn">登录 | 注册</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<!-- 面包屑导航 -->
|
<!-- 面包屑导航 -->
|
||||||
<div class="breadcrumb-container">
|
<div class="breadcrumb-container">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@ -279,47 +248,15 @@
|
|||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 页脚 -->
|
|
||||||
<footer class="footer">
|
|
||||||
<div class="container">
|
|
||||||
<div class="footer-content">
|
|
||||||
<div class="footer-left">
|
|
||||||
<img src="/logo/logo1.png" alt="Logo" class="footer-logo" />
|
|
||||||
<div class="footer-info">
|
|
||||||
<p class="footer-title">中小学教师人工智能素养提升在线学习平台</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="footer-right">
|
|
||||||
<div class="footer-badges">
|
|
||||||
<div class="badge-item">
|
|
||||||
<div class="badge-icon">🏛️</div>
|
|
||||||
<div class="badge-text">
|
|
||||||
<p>版权所有 © 互联网ICP备案</p>
|
|
||||||
<p>地址:重庆市教委 重庆市教育信息技术与装备中心 650500</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="badge-item">
|
|
||||||
<div class="badge-icon">🏢</div>
|
|
||||||
<div class="badge-text">
|
|
||||||
<p>地址:二一一四四人民区 - 重庆市二一一大道208号 | 邮编:650092</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { ActivityApi, type Activity } from '@/api/modules/activity'
|
import { ActivityApi, type Activity } from '@/api/modules/activity'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
// 活动ID
|
// 活动ID
|
||||||
const activityId = ref(Number(route.params.id))
|
const activityId = ref(Number(route.params.id))
|
||||||
@ -330,27 +267,27 @@ const loading = ref(true)
|
|||||||
const error = ref('')
|
const error = ref('')
|
||||||
|
|
||||||
// 当前选中的分类
|
// 当前选中的分类
|
||||||
const activeCategory = ref(1)
|
// const activeCategory = ref(1)
|
||||||
|
|
||||||
// 当前选中的分组
|
// 当前选中的分组
|
||||||
const selectedGroup = ref(0)
|
const selectedGroup = ref(0)
|
||||||
|
|
||||||
// 计算属性 - 从活动数据中获取信息
|
// 计算属性 - 从活动数据中获取信息
|
||||||
const categories = computed(() => {
|
// const categories = computed(() => {
|
||||||
if (!activity.value) return []
|
// if (!activity.value) return []
|
||||||
return activity.value.categories.map((name, index) => ({
|
// return activity.value.categories.map((name, index) => ({
|
||||||
id: index + 1,
|
// id: index + 1,
|
||||||
name
|
// name
|
||||||
}))
|
// }))
|
||||||
})
|
// })
|
||||||
|
|
||||||
const timeline = computed(() => activity.value?.timeline || [])
|
// const timeline = computed(() => activity.value?.timeline || [])
|
||||||
const activityContent = computed(() => activity.value?.content || [])
|
// const activityContent = computed(() => activity.value?.content || [])
|
||||||
|
|
||||||
// 设置活动分类
|
// 设置活动分类
|
||||||
const setActiveCategory = (categoryId: number) => {
|
// const setActiveCategory = (categoryId: number) => {
|
||||||
activeCategory.value = categoryId
|
// activeCategory.value = categoryId
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 获取状态文本
|
// 获取状态文本
|
||||||
const getStatusText = (status: string) => {
|
const getStatusText = (status: string) => {
|
||||||
@ -434,130 +371,7 @@ onMounted(() => {
|
|||||||
background: #f8f9fa;
|
background: #f8f9fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 顶部导航栏 */
|
|
||||||
.top-header {
|
|
||||||
background: white;
|
|
||||||
border-bottom: 1px solid #e8e8e8;
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-content {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 12px 0;
|
|
||||||
max-width: 1200px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo-section {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
width: 32px;
|
|
||||||
height: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo-text {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-nav {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item {
|
|
||||||
color: #666;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 8px 0;
|
|
||||||
position: relative;
|
|
||||||
transition: color 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item.active {
|
|
||||||
color: #1890ff;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hot-badge {
|
|
||||||
background: #ff4d4f;
|
|
||||||
color: white;
|
|
||||||
font-size: 10px;
|
|
||||||
padding: 2px 4px;
|
|
||||||
border-radius: 2px;
|
|
||||||
margin-left: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-box {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: #f5f5f5;
|
|
||||||
border-radius: 20px;
|
|
||||||
padding: 6px 16px;
|
|
||||||
width: 280px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-box input {
|
|
||||||
border: none;
|
|
||||||
background: none;
|
|
||||||
outline: none;
|
|
||||||
flex: 1;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-box input::placeholder {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-btn {
|
|
||||||
border: none;
|
|
||||||
background: none;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-actions {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-info {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-btn {
|
|
||||||
background: #1890ff;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
padding: 8px 16px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 14px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-btn:hover {
|
|
||||||
background: #40a9ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 面包屑导航 */
|
/* 面包屑导航 */
|
||||||
.breadcrumb-container {
|
.breadcrumb-container {
|
||||||
@ -1187,75 +1001,5 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 页脚样式 */
|
|
||||||
.footer {
|
|
||||||
background: #00bcd4;
|
|
||||||
color: white;
|
|
||||||
padding: 40px 0;
|
|
||||||
margin-top: 80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-content {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
max-width: 1200px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-left {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-logo {
|
|
||||||
width: 60px;
|
|
||||||
height: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-badges {
|
|
||||||
display: flex;
|
|
||||||
gap: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge-icon {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge-text {
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge-text p {
|
|
||||||
margin: 0;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge-text p:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -258,7 +258,7 @@
|
|||||||
<!-- 作业附件区域 -->
|
<!-- 作业附件区域 -->
|
||||||
<div class="box_6">
|
<div class="box_6">
|
||||||
<div class="attachment-images">
|
<div class="attachment-images">
|
||||||
<img v-for="(attachment, index) in detailAssignment.attachments.slice(0, 5)" :key="index"
|
<img v-for="(_, index) in detailAssignment.attachments.slice(0, 5)" :key="index"
|
||||||
src="/images/traings/traing1.png"
|
src="/images/traings/traing1.png"
|
||||||
:class="['image_' + (24 + index)]" />
|
:class="['image_' + (24 + index)]" />
|
||||||
</div>
|
</div>
|
||||||
@ -306,7 +306,7 @@
|
|||||||
|
|
||||||
<!-- 附件图片列表 -->
|
<!-- 附件图片列表 -->
|
||||||
<div class="attachment-images">
|
<div class="attachment-images">
|
||||||
<img v-for="(attachment, index) in assignment.attachments.slice(0, 5)" :key="index"
|
<img v-for="(_, index) in assignment.attachments.slice(0, 5)" :key="index"
|
||||||
src="/images/traings/traing1.png"
|
src="/images/traings/traing1.png"
|
||||||
:class="['image_' + (24 + index)]" />
|
:class="['image_' + (24 + index)]" />
|
||||||
</div>
|
</div>
|
||||||
@ -396,6 +396,13 @@ import { ref, computed, onMounted, reactive } from 'vue'
|
|||||||
import { useMessage, NModal, NUpload, NInput, NForm, NFormItem, NButton } from 'naive-ui'
|
import { useMessage, NModal, NUpload, NInput, NForm, NFormItem, NButton } from 'naive-ui'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
|
|
||||||
|
// 定义文件接口
|
||||||
|
interface UploadFile {
|
||||||
|
name: string
|
||||||
|
size: number
|
||||||
|
type?: string
|
||||||
|
}
|
||||||
|
|
||||||
// 定义课程接口
|
// 定义课程接口
|
||||||
interface Course {
|
interface Course {
|
||||||
id: number
|
id: number
|
||||||
@ -662,7 +669,7 @@ const filteredAssignments = computed(() => {
|
|||||||
// 计算属性用于模板中的条件判断
|
// 计算属性用于模板中的条件判断
|
||||||
const isCoursesTab = computed(() => activeTab.value === 'courses')
|
const isCoursesTab = computed(() => activeTab.value === 'courses')
|
||||||
const isHomeworkTab = computed(() => activeTab.value === 'homework')
|
const isHomeworkTab = computed(() => activeTab.value === 'homework')
|
||||||
const isOtherTab = computed(() => !isCoursesTab.value && !isHomeworkTab.value)
|
// const isOtherTab = computed(() => !isCoursesTab.value && !isHomeworkTab.value)
|
||||||
|
|
||||||
// 处理菜单选择
|
// 处理菜单选择
|
||||||
const handleMenuSelect = (key: TabType) => {
|
const handleMenuSelect = (key: TabType) => {
|
||||||
@ -751,11 +758,11 @@ const currentAssignment = ref<Assignment | null>(null)
|
|||||||
const uploadForm = reactive({
|
const uploadForm = reactive({
|
||||||
title: '',
|
title: '',
|
||||||
content: '',
|
content: '',
|
||||||
files: []
|
files: [] as UploadFile[]
|
||||||
})
|
})
|
||||||
|
|
||||||
// 作业描述展开状态管理
|
// 作业描述展开状态管理
|
||||||
const expandedAssignments = ref<Record<number, boolean>>({})
|
// const expandedAssignments = ref<Record<number, boolean>>({})
|
||||||
|
|
||||||
// 作业详情视图状态
|
// 作业详情视图状态
|
||||||
const showDetailView = ref(false)
|
const showDetailView = ref(false)
|
||||||
@ -816,7 +823,7 @@ const submitAssignment = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 自定义上传处理
|
// 自定义上传处理
|
||||||
const customRequest = ({ file, onFinish, onError }: any) => {
|
const customRequest = ({ file, onFinish }: any) => {
|
||||||
// 模拟上传
|
// 模拟上传
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uploadForm.files.push(file)
|
uploadForm.files.push(file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user