diff --git a/code/java/后端-需求/src/main/java/com/cpic/xim/web/filters/cros/CrosFilter.java b/code/java/后端-需求/src/main/java/com/cpic/xim/web/filters/cros/CrosFilter.java
index 930d55c..0575137 100644
--- a/code/java/后端-需求/src/main/java/com/cpic/xim/web/filters/cros/CrosFilter.java
+++ b/code/java/后端-需求/src/main/java/com/cpic/xim/web/filters/cros/CrosFilter.java
@@ -2,8 +2,8 @@
* @Author: Kane
* @Date: 2023-01-29 10:39:41
* @LastEditors: Kane
- * @LastEditTime: 2023-01-29 10:39:44
- * @FilePath: \requirement\src\main\java\com\cpic\xim\web\filters\cros\CrosFilter.java
+ * @LastEditTime: 2023-02-04 17:12:05
+ * @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/filters/cros/CrosFilter.java
* @Description: 过滤器,用于对CROS访问进行响应。允许任何来源的访问。
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
@@ -33,7 +33,7 @@ public class CrosFilter implements Filter
response.setHeader( "Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE" );
response.setHeader( "Access-Control-Max-Age", "0" );
response.setHeader( "Access-Control-Allow-Headers",
- "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token" );
+ "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token,username" );
response.setHeader( "Access-Control-Allow-Credentials", "true" );
response.setHeader( "XDomainRequestAllowed", "1" );
response.setHeader( "XDomainRequestAllowed", "1" );
diff --git a/code/java/后端-需求/src/main/java/com/cpic/xim/web/filters/token/TokenFilter.java b/code/java/后端-需求/src/main/java/com/cpic/xim/web/filters/token/TokenFilter.java
index 376f6e9..b1d69df 100644
--- a/code/java/后端-需求/src/main/java/com/cpic/xim/web/filters/token/TokenFilter.java
+++ b/code/java/后端-需求/src/main/java/com/cpic/xim/web/filters/token/TokenFilter.java
@@ -2,8 +2,8 @@
* @Author: Kane
* @Date: 2023-01-29 10:50:49
* @LastEditors: Kane
- * @LastEditTime: 2023-01-29 10:55:27
- * @FilePath: \requirement\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java
+ * @LastEditTime: 2023-02-04 18:05:18
+ * @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/filters/token/TokenFilter.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
@@ -11,6 +11,7 @@
package com.cpic.xim.web.filters.token;
import java.io.IOException;
+import java.util.Enumeration;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
@@ -19,9 +20,11 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-@SuppressWarnings( "unused")
+@SuppressWarnings( "unused" )
public class TokenFilter implements Filter
{
+ private static final String FILTE_METHODS = "POST,GET";
+
@Override
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain )
throws ServletException, IOException
@@ -29,8 +32,14 @@ public class TokenFilter implements Filter
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
- // 获取请求中的token字符串
- String token = request.getHeader( "Token" );
+ String method = request.getMethod().toUpperCase();
+
+ // 只处理POST和GET
+ if ( FILTE_METHODS.indexOf( method ) != -1 )
+ {
+ // 检查token
+ String token = request.getHeader( "token" );
+ }
chain.doFilter( request, response );
}
diff --git a/code/web/IT工具综合平台/.env.development b/code/web/IT工具综合平台/.env.development
index dbd8ffb..9b794bf 100644
--- a/code/web/IT工具综合平台/.env.development
+++ b/code/web/IT工具综合平台/.env.development
@@ -1,3 +1,3 @@
VUE_APP_API_URL_LOGIN = "http://222.76.244.118:11001/admin-system/account/p13_account_check"
VUE_APP_API_URL_UPLOAD_FILE= "http://222.76.244.118:11001/admin-system/file/file-upload.do"
-VUE_APP_API_URL_REQUIREMENT_STATUS= "http://222.76.244.118:11001/requirement/query_requirement_status.do"
\ No newline at end of file
+VUE_APP_API_URL_REQUIREMENT_STATUS= "http://localhost:8080/requirement/query_requirement_status.do"
\ No newline at end of file
diff --git a/code/web/IT工具综合平台/src/layout/Index.vue b/code/web/IT工具综合平台/src/layout/Index.vue
index 03120d0..ced89eb 100644
--- a/code/web/IT工具综合平台/src/layout/Index.vue
+++ b/code/web/IT工具综合平台/src/layout/Index.vue
@@ -2,14 +2,14 @@
* @Author: Kane
* @Date: 2023-01-04 11:05:44
* @LastEditors: Kane
- * @LastEditTime: 2023-02-04 01:02:13
- * @FilePath: \IT工具综合平台\src\layout\Index.vue
+ * @LastEditTime: 2023-02-04 16:35:20
+ * @FilePath: /IT工具综合平台/src/layout/Index.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
-
+
@@ -28,35 +28,57 @@
import LayoutAside from "./components/Aside.vue";
import LayoutHeader from "./components/Header.vue";
import LayoutMain from "./components/Main.vue";
+import { useStore } from "vuex";
+import { onMounted, computed, reactive } from "vue";
+// import { query_requirement_status } from "@/utils/api/requirement/requirement.js";
export default {
name: "layoutPage",
+ setup()
+ {
+ const store = useStore();
+
+ const ui = reactive(
+ {
+ pageVisible: true,
+ });
+
+ const asideWidth = computed(() =>
+ {
+ const collapse = store.state.app.asideBarCollapse;
+
+ return collapse === true ? "65px" : "180px";
+ });
+
+ onMounted(() =>
+ {
+
+ //加载数据
+ // query_requirement_status()
+ // .then((response) =>
+ // {
+ // // debugger;
+ // const data = response.data;
+
+ // console.log(data);
+ // })
+ // .catch((error) =>
+ // {
+ // // debugger;
+ // console.log(error);
+ // });
+ });
+
+ return {
+ ui,
+ asideWidth,
+ };
+ },
components: {
LayoutAside,
LayoutHeader,
LayoutMain,
},
- data()
- {
- return {
- pageVisible: true,
- };
- },
- computed: {
- asideWidth()
- {
- const collapse = this.$store.state.app.asideBarCollapse;
-
- return collapse === true ? "65px" : "180px";
- },
- },
- mounted()
- {
- setTimeout(() =>
- {
- this.pageVisible = false;
- }, 3000);
- },
};
diff --git a/code/web/IT工具综合平台/src/store/index.js b/code/web/IT工具综合平台/src/store/index.js
index 9316233..6b03204 100644
--- a/code/web/IT工具综合平台/src/store/index.js
+++ b/code/web/IT工具综合平台/src/store/index.js
@@ -2,18 +2,20 @@
* @Author: Kane
* @Date: 2022-12-14 15:12:46
* @LastEditors: Kane
- * @LastEditTime: 2023-01-11 14:20:04
- * @FilePath: \admin_system\src\store\index.js
+ * @LastEditTime: 2023-02-04 15:59:09
+ * @FilePath: /IT工具综合平台/src/store/index.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { createStore } from 'vuex';
import app from "./modules/app";
+import requirement from "./modules/requirement";
const store = createStore({
modules: {
app,
+ requirement,
}
});
diff --git a/code/web/IT工具综合平台/src/store/modules/requirement.js b/code/web/IT工具综合平台/src/store/modules/requirement.js
new file mode 100644
index 0000000..57b1cc3
--- /dev/null
+++ b/code/web/IT工具综合平台/src/store/modules/requirement.js
@@ -0,0 +1,21 @@
+/*
+ * @Author: Kane
+ * @Date: 2023-02-04 15:55:16
+ * @LastEditors: Kane
+ * @LastEditTime: 2023-02-04 16:00:54
+ * @FilePath: /IT工具综合平台/src/store/modules/requirement.js
+ * @Description:
+ *
+ * Copyright (c) ${2022} by Kane, All Rights Reserved.
+ */
+
+const state = {
+ status: {},
+ status_update_time: new Date(),
+};
+
+export default {
+ namespaced: true,
+ state,
+};
+
diff --git a/code/web/IT工具综合平台/src/utils/api/config.js b/code/web/IT工具综合平台/src/utils/api/config.js
index 14cbf94..9f64140 100644
--- a/code/web/IT工具综合平台/src/utils/api/config.js
+++ b/code/web/IT工具综合平台/src/utils/api/config.js
@@ -2,8 +2,8 @@
* @Author: Kane
* @Date: 2022-12-23 11:10:23
* @LastEditors: Kane
- * @LastEditTime: 2022-12-23 11:11:58
- * @FilePath: \admin_system\src\utils\api\config.js
+ * @LastEditTime: 2023-02-04 17:08:15
+ * @FilePath: /IT工具综合平台/src/utils/api/config.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
@@ -11,4 +11,5 @@
export const API_URL = {
URL_LOGIN: process.env.VUE_APP_API_URL_LOGIN,
+ URL_QUERY_REQUIREMENT_STATUS: process.env.VUE_APP_API_URL_REQUIREMENT_STATUS,
};
\ No newline at end of file
diff --git a/code/web/IT工具综合平台/src/utils/api/info/account.js b/code/web/IT工具综合平台/src/utils/api/info/account.js
index 6bb587e..18c6505 100644
--- a/code/web/IT工具综合平台/src/utils/api/info/account.js
+++ b/code/web/IT工具综合平台/src/utils/api/info/account.js
@@ -2,8 +2,8 @@
* @Author: Kane
* @Date: 2022-12-22 09:10:20
* @LastEditors: Kane
- * @LastEditTime: 2023-02-03 22:04:22
- * @FilePath: \IT工具综合平台\src\utils\api\info\account.js
+ * @LastEditTime: 2023-02-04 15:45:51
+ * @FilePath: /IT工具综合平台/src/utils/api/info/account.js
* @Description: 登录登出相关的API。
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
@@ -11,7 +11,6 @@
import instance from "@/utils/api/request";
import { API_URL } from "@/utils/api/config"; //所有API的地址
import router from "../../../router/index";
-import store from "../../../store/index";
/**
* 登录请求函数
@@ -34,8 +33,6 @@ export function Login(userInfo)
*/
export function Logout()
{
- console.log(store);
-
window.localStorage.removeItem("token");
window.localStorage.removeItem("user_info");
diff --git a/code/web/IT工具综合平台/src/utils/api/request.js b/code/web/IT工具综合平台/src/utils/api/request.js
index aabbbdd..e81ebf6 100644
--- a/code/web/IT工具综合平台/src/utils/api/request.js
+++ b/code/web/IT工具综合平台/src/utils/api/request.js
@@ -2,8 +2,8 @@
* @Author: Kane
* @Date: 2022-12-22 17:18:10
* @LastEditors: Kane
- * @LastEditTime: 2023-01-12 17:47:39
- * @FilePath: \admin_system\src\utils\api\request.js
+ * @LastEditTime: 2023-02-04 17:20:01
+ * @FilePath: /IT工具综合平台/src/utils/api/request.js
* @Description: 配置axios拦截器
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
@@ -16,7 +16,7 @@ import router from "@/router";
const service = axios.create(
{
baseURL: "",
- timeout: 5000,
+ // timeout: 5000,
}
);
@@ -27,11 +27,13 @@ const service = axios.create(
service.interceptors.request.use(
function (config)
{
+ console.log(store);
+
//axios拦截器请求,在请求的header加上用户名和token
if (store.state.app.userInfo)
{
//如果userInfo存在,则加上用户名和token
- const username = store.state.app.userInfo.user_info.p13uid;
+ const username = store.state.app.userInfo.staff_info.p13uid;
const token = store.state.app.userInfo.token;
config.headers["token"] = token;
@@ -48,6 +50,7 @@ service.interceptors.request.use(
},
function (error)
{
+ console.log("请求拦截器失败!");
return Promise.reject(error);
}
);
diff --git a/code/web/IT工具综合平台/src/utils/api/requirement/requirement.js b/code/web/IT工具综合平台/src/utils/api/requirement/requirement.js
new file mode 100644
index 0000000..92f8579
--- /dev/null
+++ b/code/web/IT工具综合平台/src/utils/api/requirement/requirement.js
@@ -0,0 +1,24 @@
+/*
+ * @Author: Kane
+ * @Date: 2023-02-04 15:48:00
+ * @LastEditors: Kane
+ * @LastEditTime: 2023-02-04 17:11:07
+ * @FilePath: /IT工具综合平台/src/utils/api/requirement/requirement.js
+ * @Description:
+ *
+ * Copyright (c) ${2022} by Kane, All Rights Reserved.
+ */
+import instance from "@/utils/api/request";
+import { API_URL } from "@/utils/api/config";
+
+function query_requirement_status()
+{
+ return instance.request(
+ {
+ method: "post",
+ url: API_URL.URL_QUERY_REQUIREMENT_STATUS,
+ }
+ );
+}
+
+export { query_requirement_status };
\ No newline at end of file
diff --git a/code/web/IT工具综合平台/src/views/account/Login.vue b/code/web/IT工具综合平台/src/views/account/Login.vue
index 0632ac3..664cbce 100644
--- a/code/web/IT工具综合平台/src/views/account/Login.vue
+++ b/code/web/IT工具综合平台/src/views/account/Login.vue
@@ -3,8 +3,8 @@
* @Author: Kane
* @Date: 2022-12-14 15:23:54
* @LastEditors: Kane
- * @LastEditTime: 2023-02-03 15:46:55
- * @FilePath: \IT工具综合平台\src\views\account\Login32.vue
+ * @LastEditTime: 2023-02-04 16:55:12
+ * @FilePath: /IT工具综合平台/src/views/account/Login.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
@@ -43,8 +43,8 @@
-
+
{{ ui.current_menu === "login" ? "登录" : "注册" }}
@@ -183,6 +183,8 @@ export default {
//将获取到的用户信息和token保存到vuex和localStorage
const saveUserInfo = (userInfo) =>
{
+ console.log("保存用户信息");
+ console.log("保存用户信息", store);
//保存到vuex
store.commit("app/SET_USERINFO", userInfo);
diff --git a/code/web/IT工具综合平台/src/views/overview/Desktop.vue b/code/web/IT工具综合平台/src/views/overview/Desktop.vue
index eab4fb8..50b4592 100644
--- a/code/web/IT工具综合平台/src/views/overview/Desktop.vue
+++ b/code/web/IT工具综合平台/src/views/overview/Desktop.vue
@@ -2,8 +2,8 @@
* @Author: Kane
* @Date: 2023-01-06 15:30:12
* @LastEditors: Kane
- * @LastEditTime: 2023-02-01 16:07:55
- * @FilePath: \IT工具综合平台\src\views\overview\Desktop.vue
+ * @LastEditTime: 2023-02-04 16:56:36
+ * @FilePath: /IT工具综合平台/src/views/overview/Desktop.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
@@ -60,33 +60,52 @@
- 测试
+ 测试
diff --git a/code/web/IT工具综合平台/src/views/requirement/RequirementEditing.vue b/code/web/IT工具综合平台/src/views/requirement/RequirementEditing.vue
index 934d13d..4caf897 100644
--- a/code/web/IT工具综合平台/src/views/requirement/RequirementEditing.vue
+++ b/code/web/IT工具综合平台/src/views/requirement/RequirementEditing.vue
@@ -2,18 +2,8 @@
* @Author: Kane
* @Date: 2023-01-25 23:16:29
* @LastEditors: Kane
- * @LastEditTime: 2023-02-03 11:07:02
- * @FilePath: \IT工具综合平台\src\views\requirement\RequirementEditing.vue
- * @Description:
- *
- * Copyright (c) ${2022} by Kane, All Rights Reserved.
--->
-