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 09b405503a47a447cada15ee0b788a7485453752 Mon Sep 17 00:00:00 2001 From: JayChou Date: Tue, 25 Mar 2025 17:54:35 +0800 Subject: [PATCH 2/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 的返回值 From 1908c449ff64ecf570e074ab3cf6f3c282921d15 Mon Sep 17 00:00:00 2001 From: Ly <503441659@qq.com> Date: Wed, 26 Mar 2025 08:56:04 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8E=BB=E5=AD=A6=E4=B9=A0=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/images/bg10.png | Bin 1018 -> 679 bytes src/views/resultsAnnounced/index.vue | 56 +++++++++++++-------------- src/views/subjectTest/index.vue | 8 ++-- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/assets/images/bg10.png b/src/assets/images/bg10.png index c4fe07bcbea8909c2c1213a95894ad7457e70d95..856d3ebb41030f3ad8e5a5543e9296c9ee8c6dce 100644 GIT binary patch delta 661 zcmV;G0&4yG2d4!giBL{Q4GJ0x0000DNk~Le0000T0000T2nGNE09KP{50N1se*#fS zL_t(YiM5tdQrj>PhQE~q(}zy5Zx9BTnLahSK{x@uL6Z}-JpuFtEhiwHpm2i14d_#5 z5_d>XAjeOgg1mi*od#mZCM5eLtz>ffUz%k6CW9!fyjLx77(NUn@CpNO$HXiTl zf>OuN!$59V&8dWn;XQCt7b=D?z)I*=ueZ!9PufWN_6G)a7krfo=S9%{e?VetEc6_! zgpRFtF?7qujfXvWEoU2rV(5yL3rQUlpcE<)>vN&T!)6PYty(??q;O#rTw1WPDADsM zQH`d0SGAFs+D1cWXtg!6T385-t#Qtz)l(5p9K=Jbol2-0f7$}Q0{?Gd4t3B4T3NRjB}&+oeh$q1{_YOP)lgv~a9!kI z?1zC|Mu`sizro(GskRsEE>UjHJr|YG!=?S`aI()OAWU`=K&@=vy=IYq5&R>OB|E=_5OX}jDpapgu)ff v>Y>zeltTYtPdd41U?#2<`l+MyCXnlYoAL=d+y+bc00000NkvXXu0mjfCcrx4 delta 1003 zcmVgR zL_t(oh0T^Y*@qLDB-)jbFF^kl;=>%ie|H*k^KJt7iMHw?=dUze#Y_#ydyx!Z5(qY(o+R3> zhYWnC@fAA~d6lej6 zaJ{!9?;_BNWR$~Mxe@YmDy;X8Z8A-?`5xmw;#9x6D2!9>yZxmISnrzvs(jszWd2bE zGQ*`?hsudtFZF>q)dA22=AmKNCooR6AHbn1kDJos%hhtOeI0SC->_FYGwkk1GOM|d zuEpBFBX@9`XfqEOC>#KYe?Xk-r*=b*tHvi!dLeM`t6wX@M<9N2#7HC)-GRjHS~a) zBjK9MIMu#yT$M`}9kJyan2Us!X)X~UWQX-|H(|IJ$uKKO%&n4Bf2-usH*RaBY{?QX zUd<}X8c@TdgsTFgjBE;yyrxu=0+4`_=2l+#Gfwpj;AF{6ky2Y{ODH3t)+?)|%()T1 zdi&>osB`!Z@K44qi_{zeH!M;*bn`)_&K{Qt*!;NAmIOKtxl!c|kD!&gbnpFsB(vP` z*(2d_6Bhdbg!M(Leb{ke5X@`#nwGPI;kF&gPq2dvG&2}gC!wyv)u66?_}F>pJ?lk8YiCdrOheH4W002ovPDHLkV1mRT;WhvO diff --git a/src/views/resultsAnnounced/index.vue b/src/views/resultsAnnounced/index.vue index 57e3c5f..4dde974 100644 --- a/src/views/resultsAnnounced/index.vue +++ b/src/views/resultsAnnounced/index.vue @@ -41,7 +41,7 @@
- {{0}}题 + 错误 {{ 0 }} 题
@@ -57,9 +57,8 @@
@@ -100,13 +99,13 @@ const Back =()=>{