From f925bb2ee51baf669fe7179a53b37df5d89e2fb8 Mon Sep 17 00:00:00 2001 From: JayChou Date: Tue, 25 Mar 2025 15:34:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B8=85=E9=99=A4=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/program/index.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/program/index.vue b/src/views/program/index.vue index fdfbaaf..c13a319 100644 --- a/src/views/program/index.vue +++ b/src/views/program/index.vue @@ -1391,7 +1391,7 @@ const onSave = async () => { // console.log(graph.toJSON()); // return; - clearLocalStorage(); + clearLocalStorage(false); const data = graph.toJSON().cells.map((item: any) => { return { node: item, @@ -1474,10 +1474,13 @@ function loadFromLocalStorage() { return JSON.parse(localStorage.getItem(SESSION_KEY) as string) || []; } -function clearLocalStorage() { +function clearLocalStorage(falg=true) { localStorage.removeItem(SESSION_KEY); + if(falg){ window.location.reload(); + } + } // 恢复画布状态 function restoreGraph() { From ca5118b81aceaa6c00ccfc8f4832f64db3e63b22 Mon Sep 17 00:00:00 2001 From: xy <2115269706@qq.com> Date: Tue, 25 Mar 2025 17:27:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B0=8F=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/loginPage.vue | 15 +++++++-------- src/layout/studyPage.vue | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/layout/loginPage.vue b/src/layout/loginPage.vue index 730d485..29da051 100644 --- a/src/layout/loginPage.vue +++ b/src/layout/loginPage.vue @@ -35,8 +35,7 @@
用户密码
- +
@@ -157,9 +156,9 @@ --> - - +
@@ -175,7 +174,7 @@
- + +
@@ -207,7 +206,7 @@
- +
diff --git a/src/layout/studyPage.vue b/src/layout/studyPage.vue index 6640097..51cd543 100644 --- a/src/layout/studyPage.vue +++ b/src/layout/studyPage.vue @@ -12,7 +12,7 @@ 知识点学习
学习
+ @click="handleBoxClick(2)">测试
仿真实验
From 09b405503a47a447cada15ee0b788a7485453752 Mon Sep 17 00:00:00 2001 From: JayChou Date: Tue, 25 Mar 2025 17:54:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=AF=B9=E6=8E=A5=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 8 + src/layout/index.vue | 50 ++--- src/layout/loginPage.vue | 2 +- src/layout/studyPage.vue | 316 +++++++++++++++++++------------- src/permissions.ts | 2 +- src/utils/request.ts | 9 +- src/views/subjectTest/index.vue | 2 +- 7 files changed, 238 insertions(+), 151 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index b521b9e..185b91c 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -73,4 +73,12 @@ export const getExperiment = ()=>{ url:'/experimental/xnExperimental/selectExperimental', method:'get', }) +} +// 确认实验 +export const submitExperiment = (data:any) => { + return request({ + url:'/xnRecords/verifyExperimentaInfo', + method:"POST", + data + }) } \ No newline at end of file diff --git a/src/layout/index.vue b/src/layout/index.vue index b3bc0b3..0501961 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -2,8 +2,9 @@
-

{{user.token?'已登录':'登录/注册'}}

+

{{ user.token ? "已登录" : "登录/注册" }}

+
{{ setting.title }}
@@ -17,19 +18,25 @@ diff --git a/src/layout/loginPage.vue b/src/layout/loginPage.vue index 730d485..e2c8451 100644 --- a/src/layout/loginPage.vue +++ b/src/layout/loginPage.vue @@ -429,7 +429,7 @@ const login = async () => { }; const res = await user.logIn(data); if (res) { - router.push('/') + router.push('/studyPage') } }; diff --git a/src/layout/studyPage.vue b/src/layout/studyPage.vue index 6640097..69b588c 100644 --- a/src/layout/studyPage.vue +++ b/src/layout/studyPage.vue @@ -1,157 +1,223 @@ \ No newline at end of file + diff --git a/src/permissions.ts b/src/permissions.ts index fa9a430..a7a06f1 100644 --- a/src/permissions.ts +++ b/src/permissions.ts @@ -6,7 +6,7 @@ const store = userStore(pinia); router.beforeEach((to: any, from: any, next: any) => { if (to.path === "/login") { if (store.token) { - next("/"); + next("/studyPage"); } else { next(); } diff --git a/src/utils/request.ts b/src/utils/request.ts index 691d243..031139b 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -2,8 +2,9 @@ import axios from "axios"; import pinia from "@/store"; import { ElMessage } from "element-plus"; - +import {removeToken} from '@/utils/auth' import userStore from "@/store/modules/user"; +import router from '@/router' // 创建axios实例 const server = axios.create({ baseURL: import.meta.env.VITE_APP_BASE_API, @@ -26,8 +27,14 @@ server.interceptors.response.use((response) => { // useuserStore.clearStatus(); // return Promise.reject(response); } + if(response.data.code=== 401){ + ElMessage.error(response.data.message); + return Promise.reject(response); + } if (response.data.code === 412) { ElMessage.error(response.data.message); + removeToken() + router.push('/login') return Promise.reject(response); } return response.data; diff --git a/src/views/subjectTest/index.vue b/src/views/subjectTest/index.vue index 1c6f31a..b211dac 100644 --- a/src/views/subjectTest/index.vue +++ b/src/views/subjectTest/index.vue @@ -157,7 +157,7 @@ import { useRouter } from 'vue-router'; // 退出答题 const router = useRouter() const resetAnswers = () => { - router.push('/spacePage') + router.push('/studyPage') }; // 计时器相关变量 const timer = ref(null); // 用于存储 setInterval 的返回值