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/assets/images/bg10.png b/src/assets/images/bg10.png index c4fe07b..856d3eb 100644 Binary files a/src/assets/images/bg10.png and b/src/assets/images/bg10.png differ 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 29da051..c71ab96 100644 --- a/src/layout/loginPage.vue +++ b/src/layout/loginPage.vue @@ -428,7 +428,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 51cd543..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/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() { 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 =()=>{