From 4dab2b9866e3eb974a97bf24341e187654037b4b Mon Sep 17 00:00:00 2001 From: ks3356143 <314298729@qq.com> Date: Tue, 7 May 2024 17:32:46 +0800 Subject: [PATCH] 321 --- cdTMP/index.html | 266 +++++++++++++----------- cdTMP/src/api/request.js | 7 +- cdTMP/src/layout/project-layout.vue | 12 +- cdTMP/src/utils/request.js | 10 +- cdTMP/src/views/project/round/index.vue | 12 +- 5 files changed, 170 insertions(+), 137 deletions(-) diff --git a/cdTMP/index.html b/cdTMP/index.html index 9e4a587..21814a7 100644 --- a/cdTMP/index.html +++ b/cdTMP/index.html @@ -1,139 +1,153 @@ - - - - - - - - - 成都测试管理平台 - - - -
-
- -
- - - - - - - - -
- - - - - - - - -
-
-
-
- + - @keyframes loader { - 0%, - 75%, - 100% { - opacity: 0; - transform: rotateY(-90deg); - } + + +
+
+ +
+ + + + + + + + +
+ + + + + + + + +
+
+
+
+ + + - 25%, - 50% { - opacity: 1; - transform: rotateY(0deg); - } - } - - - diff --git a/cdTMP/src/api/request.js b/cdTMP/src/api/request.js index 2578ec2..66c2e70 100644 --- a/cdTMP/src/api/request.js +++ b/cdTMP/src/api/request.js @@ -63,10 +63,13 @@ function createService() { break case 401: err("登录状态已过期,需要重新登录") - // 清楚本地localStorage + // 清除本地localStorage tool.local.clear() // 移动到网站的根目录-这里不需要因为导航守卫可以返回login页面 - if (error.response.data.data.code === 40001) { + if ( + error.response.data.data.code === 40001 || + error.response.data.data.detail === "No active account found with the given credentials" + ) { } else { window.location.href = "/" } diff --git a/cdTMP/src/layout/project-layout.vue b/cdTMP/src/layout/project-layout.vue index 0b2aad4..daa306e 100644 --- a/cdTMP/src/layout/project-layout.vue +++ b/cdTMP/src/layout/project-layout.vue @@ -613,22 +613,26 @@ const soDutColumn = ref([ { title: "空行", dataIndex: "black_line", - formType: "input" + formType: "input-number", + rules: [{ required: true, message: "空行数必填" }], }, { title: "纯注释", dataIndex: "comment_line", - formType: "input" + formType: "input-number", + rules: [{ required: true, message: "纯注释数必填" }], }, { title: "混合行", dataIndex: "mix_line", - formType: "input" + formType: "input-number", + rules: [{ required: true, message: "混合行必填" }], }, { title: "纯代码", dataIndex: "code_line", - formType: "input" + formType: "input-number", + rules: [{ required: true, message: "纯代码行必填" }], } ]) diff --git a/cdTMP/src/utils/request.js b/cdTMP/src/utils/request.js index f878411..ab57a66 100644 --- a/cdTMP/src/utils/request.js +++ b/cdTMP/src/utils/request.js @@ -61,8 +61,16 @@ function createService() { break case 401: err("登录状态已过期,需要重新登录") + // 清楚本地localStorage tool.local.clear() - window.location.href = "/login" + // 移动到网站的根目录-这里不需要因为导航守卫可以返回login页面 + if ( + error.response.data.data.code === 40001 || + error.response.data.data.detail === "No active account found with the given credentials" + ) { + } else { + window.location.href = "/" + } break case 403: err("没有权限访问该资源") diff --git a/cdTMP/src/views/project/round/index.vue b/cdTMP/src/views/project/round/index.vue index bde9742..9500315 100644 --- a/cdTMP/src/views/project/round/index.vue +++ b/cdTMP/src/views/project/round/index.vue @@ -176,28 +176,32 @@ const crudColumns = ref([ hide: true, align: "center", dataIndex: "black_line", - formType: "input-number" + formType: "input-number", + commonRules: [{ required: true, message: "空行数必填" }], }, { title: "纯代码行", hide: true, align: "center", dataIndex: "code_line", - formType: "input-number" + formType: "input-number", + commonRules: [{ required: true, message: "纯代码行数必填" }], }, { title: "纯注释行", hide: true, align: "center", dataIndex: "comment_line", - formType: "input-number" + formType: "input-number", + commonRules: [{ required: true, message: "纯注释行数必填" }], }, { title: "混合行", hide: true, align: "center", dataIndex: "mix_line", - formType: "input-number" + formType: "input-number", + commonRules: [{ required: true, message: "混合行数必填" }], }, { title: "注释率 %",