登录请求错误解决

This commit is contained in:
username 2025-07-30 03:57:52 +08:00
parent 4a2cacbd8f
commit 80ee63236a
5 changed files with 31 additions and 280 deletions

View File

@ -1,4 +1,4 @@
import request from '../request'
// import request from '../request'
import type { ApiResponse } from '../types'
// 活动相关的类型定义

View File

@ -5,7 +5,7 @@ import type {
User,
LoginRequest,
LoginResponse,
BackendLoginResponse,
// BackendLoginResponse,
RegisterRequest,
UserProfile,
} from '../types'

View File

@ -14,7 +14,7 @@ export function useNetworkStatus() {
try {
const startTime = Date.now()
const response = await fetch('/favicon.ico', {
await fetch('/favicon.ico', {
method: 'HEAD',
cache: 'no-cache'
})

View File

@ -1,36 +1,5 @@
<template>
<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="container">
@ -279,47 +248,15 @@
</template>
</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>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { ActivityApi, type Activity } from '@/api/modules/activity'
const route = useRoute()
const router = useRouter()
// ID
const activityId = ref(Number(route.params.id))
@ -330,27 +267,27 @@ const loading = ref(true)
const error = ref('')
//
const activeCategory = ref(1)
// const activeCategory = ref(1)
//
const selectedGroup = ref(0)
// -
const categories = computed(() => {
if (!activity.value) return []
return activity.value.categories.map((name, index) => ({
id: index + 1,
name
}))
})
// const categories = computed(() => {
// if (!activity.value) return []
// return activity.value.categories.map((name, index) => ({
// id: index + 1,
// name
// }))
// })
const timeline = computed(() => activity.value?.timeline || [])
const activityContent = computed(() => activity.value?.content || [])
// const timeline = computed(() => activity.value?.timeline || [])
// const activityContent = computed(() => activity.value?.content || [])
//
const setActiveCategory = (categoryId: number) => {
activeCategory.value = categoryId
}
// const setActiveCategory = (categoryId: number) => {
// activeCategory.value = categoryId
// }
//
const getStatusText = (status: string) => {
@ -434,130 +371,7 @@ onMounted(() => {
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 {
@ -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>

View File

@ -258,7 +258,7 @@
<!-- 作业附件区域 -->
<div class="box_6">
<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"
:class="['image_' + (24 + index)]" />
</div>
@ -306,7 +306,7 @@
<!-- 附件图片列表 -->
<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"
:class="['image_' + (24 + index)]" />
</div>
@ -396,6 +396,13 @@ import { ref, computed, onMounted, reactive } from 'vue'
import { useMessage, NModal, NUpload, NInput, NForm, NFormItem, NButton } from 'naive-ui'
import { useUserStore } from '@/stores/user'
//
interface UploadFile {
name: string
size: number
type?: string
}
//
interface Course {
id: number
@ -662,7 +669,7 @@ const filteredAssignments = computed(() => {
//
const isCoursesTab = computed(() => activeTab.value === 'courses')
const isHomeworkTab = computed(() => activeTab.value === 'homework')
const isOtherTab = computed(() => !isCoursesTab.value && !isHomeworkTab.value)
// const isOtherTab = computed(() => !isCoursesTab.value && !isHomeworkTab.value)
//
const handleMenuSelect = (key: TabType) => {
@ -751,11 +758,11 @@ const currentAssignment = ref<Assignment | null>(null)
const uploadForm = reactive({
title: '',
content: '',
files: []
files: [] as UploadFile[]
})
//
const expandedAssignments = ref<Record<number, boolean>>({})
// const expandedAssignments = ref<Record<number, boolean>>({})
//
const showDetailView = ref(false)
@ -816,7 +823,7 @@ const submitAssignment = () => {
}
//
const customRequest = ({ file, onFinish, onError }: any) => {
const customRequest = ({ file, onFinish }: any) => {
//
setTimeout(() => {
uploadForm.files.push(file)