运行成功
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Card, Form, Input, Button, message, Typography, AutoComplete, Layout } from 'antd';
|
||||
import { Card, Form, Input, Button, App, Typography, AutoComplete, Layout } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useUser } from '../contexts';
|
||||
import { userAPI } from '../services/api';
|
||||
@@ -16,6 +16,7 @@ interface LoginHistory {
|
||||
|
||||
const HomePage = () => {
|
||||
const navigate = useNavigate();
|
||||
const { message } = App.useApp();
|
||||
const { setUser } = useUser();
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect, useMemo, useRef, type TouchEventHandler } from 'react';
|
||||
import { Card, Button, Modal, message } from 'antd';
|
||||
import { Card, Button, Modal, App } from 'antd';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
import { useUser, useQuiz } from '../contexts';
|
||||
import { quizAPI } from '../services/api';
|
||||
@@ -19,8 +19,7 @@ interface Question {
|
||||
answer: string | string[];
|
||||
analysis?: string;
|
||||
score: number;
|
||||
createdAt: string;
|
||||
category?: string;
|
||||
category: string;
|
||||
}
|
||||
|
||||
interface LocationState {
|
||||
@@ -34,6 +33,7 @@ interface LocationState {
|
||||
|
||||
const QuizPage = () => {
|
||||
const navigate = useNavigate();
|
||||
const { message } = App.useApp();
|
||||
const location = useLocation();
|
||||
const { user } = useUser();
|
||||
const { questions, setQuestions, currentQuestionIndex, setCurrentQuestionIndex, answers, setAnswer, setAnswers, clearQuiz } = useQuiz();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Card, Button, Descriptions, message } from 'antd';
|
||||
import { Card, Button, Descriptions, App } from 'antd';
|
||||
import { useParams, useNavigate } from 'react-router-dom';
|
||||
import { useUser } from '../contexts';
|
||||
import { quizAPI } from '../services/api';
|
||||
@@ -85,6 +85,7 @@ const StatusIcon = ({ status }: { status: QuizRecord['status'] }) => {
|
||||
const ResultPage = () => {
|
||||
const { id: recordId } = useParams<{ id: string }>();
|
||||
const navigate = useNavigate();
|
||||
const { message } = App.useApp();
|
||||
const { user } = useUser();
|
||||
const [record, setRecord] = useState<QuizRecord | null>(null);
|
||||
const [answers, setAnswers] = useState<QuizAnswer[]>([]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Button, Typography, Tag, Space, Spin, message, Modal } from 'antd';
|
||||
import { Button, Typography, Tag, Space, Spin, App, Modal } from 'antd';
|
||||
import { ClockCircleOutlined, BookOutlined, RightOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useUser } from '../contexts';
|
||||
@@ -37,6 +37,7 @@ export const SubjectSelectionPage: React.FC = () => {
|
||||
const [tasks, setTasks] = useState<ExamTask[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const navigate = useNavigate();
|
||||
const { message } = App.useApp();
|
||||
const { user } = useUser();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Card, Table, Tag, Button, Space, Spin, message, Typography } from 'antd';
|
||||
import { Card, Table, Tag, Button, Space, Spin, App, Typography } from 'antd';
|
||||
import { EyeOutlined, BookOutlined, CalendarOutlined } from '@ant-design/icons';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useUser } from '../contexts';
|
||||
@@ -28,6 +28,7 @@ export const UserTaskPage: React.FC = () => {
|
||||
const [records, setRecords] = useState<QuizRecord[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const navigate = useNavigate();
|
||||
const { message } = App.useApp();
|
||||
const { user } = useUser();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Card, Form, Input, Button, message, Select, Layout } from 'antd';
|
||||
import { Card, Form, Input, Button, App, Select, Layout } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useAdmin } from '../../contexts';
|
||||
import { adminAPI } from '../../services/api';
|
||||
@@ -45,6 +45,7 @@ const saveLoginRecord = (record: LoginRecord) => {
|
||||
|
||||
const AdminLoginPage = () => {
|
||||
const navigate = useNavigate();
|
||||
const { message } = App.useApp();
|
||||
const { setAdmin } = useAdmin();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [form] = Form.useForm();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Table, Button, Input, Space, message, Popconfirm, Modal, Form, InputNumber, Card, Progress, Row, Col, Tag, Radio } from 'antd';
|
||||
import { Table, Button, Input, Space, App, Popconfirm, Modal, Form, InputNumber, Card, Progress, Row, Col, Tag, Radio, Segmented } from 'antd';
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined, EyeOutlined } from '@ant-design/icons';
|
||||
import api from '../../services/api';
|
||||
import { getCategoryColorHex } from '../../lib/categoryColors';
|
||||
@@ -38,6 +38,7 @@ interface QuestionCategory {
|
||||
}
|
||||
|
||||
const ExamSubjectPage = () => {
|
||||
const { message } = App.useApp();
|
||||
const [subjects, setSubjects] = useState<ExamSubject[]>([]);
|
||||
const [categories, setCategories] = useState<QuestionCategory[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
Reference in New Issue
Block a user