Compare commits
1 Commits
dcab19a765
...
feature-lo
| Author | SHA1 | Date | |
|---|---|---|---|
| f93057e4d1 |
@@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: Kane
|
|
||||||
* @Date: 2023-01-12 15:01:22
|
|
||||||
* @LastEditors: Kane
|
|
||||||
* @LastEditTime: 2023-01-12 15:15:59
|
|
||||||
* @FilePath: \AdminSys\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java
|
|
||||||
* @Description: 用于检查token的过滤器
|
|
||||||
*
|
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
|
||||||
*/
|
|
||||||
package com.cpic.xim.web.filters.token;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.servlet.Filter;
|
|
||||||
import javax.servlet.FilterChain;
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.ServletRequest;
|
|
||||||
import javax.servlet.ServletResponse;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
@SuppressWarnings( "unused")
|
|
||||||
public class TokenFilter implements Filter
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain )
|
|
||||||
throws ServletException, IOException
|
|
||||||
{
|
|
||||||
HttpServletRequest request = (HttpServletRequest) req;
|
|
||||||
HttpServletResponse response = (HttpServletResponse) resp;
|
|
||||||
|
|
||||||
String URI = request.getRequestURI();
|
|
||||||
|
|
||||||
chain.doFilter( request, response );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
|
||||||
version="3.1">
|
|
||||||
<display-name>Archetype Created Web Application</display-name>
|
<display-name>Archetype Created Web Application</display-name>
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
@@ -27,15 +24,6 @@
|
|||||||
<url-pattern>*.do</url-pattern>
|
<url-pattern>*.do</url-pattern>
|
||||||
</filter-mapping>
|
</filter-mapping>
|
||||||
|
|
||||||
<filter>
|
|
||||||
<filter-name>token-filter</filter-name>
|
|
||||||
<filter-class>com.cpic.xim.web.filters.token.TokenFilter</filter-class>
|
|
||||||
</filter>
|
|
||||||
<filter-mapping>
|
|
||||||
<filter-name>token-filter</filter-name>
|
|
||||||
<url-pattern>*.do</url-pattern>
|
|
||||||
</filter-mapping>
|
|
||||||
|
|
||||||
<!-- 配置文件路径参数 -->
|
<!-- 配置文件路径参数 -->
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>config_file_location</param-name>
|
<param-name>config_file_location</param-name>
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2023-01-04 11:40:03
|
* @Date: 2023-01-04 11:40:03
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2023-01-06 12:54:17
|
* @LastEditTime: 2023-01-11 21:27:22
|
||||||
* @FilePath: \admin_system\src\layout\components\Main.vue
|
* @FilePath: \admin_system\src\layout\components\Main.vue
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<router-view />
|
<div><router-view /></div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -19,5 +19,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.main_content {
|
||||||
|
min-height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2022-12-14 15:12:46
|
* @Date: 2022-12-14 15:12:46
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2023-01-12 14:52:09
|
* @LastEditTime: 2023-01-11 10:28:24
|
||||||
* @FilePath: \admin_system\src\router\index.js
|
* @FilePath: \admin_system\src\router\index.js
|
||||||
* @Description: 定义应用路由配置
|
* @Description: 定义应用路由配置
|
||||||
*
|
*
|
||||||
@@ -62,15 +62,6 @@ const routes = [
|
|||||||
icon: "edit",
|
icon: "edit",
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
|
||||||
path: "/staffInfo",
|
|
||||||
name: "StaffInfo",
|
|
||||||
meta: {
|
|
||||||
title: "人员信息",
|
|
||||||
icon: "edit",
|
|
||||||
},
|
|
||||||
component: () => import("../views/info/StaffInfo.vue"),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "/newsIndex",
|
path: "/newsIndex",
|
||||||
name: "NewsIndex",
|
name: "NewsIndex",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2022-12-22 09:10:20
|
* @Date: 2022-12-22 09:10:20
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2023-01-12 17:47:36
|
* @LastEditTime: 2023-01-11 17:02:15
|
||||||
* @FilePath: \admin_system\src\utils\api\info\account.js
|
* @FilePath: \admin_system\src\utils\api\info\account.js
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
@@ -13,13 +13,11 @@ import { API_URL } from "@/utils/api/config"; //所有API的地址
|
|||||||
import router from "../../../router/index";
|
import router from "../../../router/index";
|
||||||
import store from "../../../store/index";
|
import store from "../../../store/index";
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录请求函数
|
|
||||||
* @param {*} userInfo
|
|
||||||
* @returns 返回promise对象
|
|
||||||
*/
|
|
||||||
export function Login(userInfo)
|
export function Login(userInfo)
|
||||||
{
|
{
|
||||||
|
//debugger;
|
||||||
|
console.log(API_URL.URL_LOGIN);
|
||||||
|
|
||||||
return instance.request(
|
return instance.request(
|
||||||
{
|
{
|
||||||
method: "post",
|
method: "post",
|
||||||
@@ -29,7 +27,6 @@ export function Login(userInfo)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function Logout()
|
export function Logout()
|
||||||
{
|
{
|
||||||
// if (this.$store && this.$store.state.app)
|
// if (this.$store && this.$store.state.app)
|
||||||
|
|||||||
@@ -2,16 +2,14 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2022-12-22 17:18:10
|
* @Date: 2022-12-22 17:18:10
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2023-01-12 17:47:39
|
* @LastEditTime: 2023-01-11 14:58:44
|
||||||
* @FilePath: \admin_system\src\utils\api\request.js
|
* @FilePath: \admin_system\src\utils\api\request.js
|
||||||
* @Description: 配置axios拦截器
|
* @Description:
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import store from "../../store/index";
|
import store from "../../store/index";
|
||||||
import { ElMessageBox } from "element-plus";
|
|
||||||
import router from "@/router";
|
|
||||||
|
|
||||||
const service = axios.create(
|
const service = axios.create(
|
||||||
{
|
{
|
||||||
@@ -20,10 +18,7 @@ const service = axios.create(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//加上请求拦截器
|
||||||
/**
|
|
||||||
* 加上请求拦截器
|
|
||||||
*/
|
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
function (config)
|
function (config)
|
||||||
{
|
{
|
||||||
@@ -52,42 +47,13 @@ service.interceptors.request.use(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
//响应拦截器
|
|
||||||
service.interceptors.response.use(
|
service.interceptors.response.use(
|
||||||
function (response)
|
function (response)
|
||||||
{
|
{
|
||||||
//200
|
|
||||||
if (response.status === 200)
|
|
||||||
{
|
|
||||||
console.log("响应拦截器,响应代码", response.status);
|
|
||||||
}
|
|
||||||
|
|
||||||
//401,用户token失效,跳转到
|
|
||||||
if (response.state === 401)
|
|
||||||
{
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
"用户登录超时,请重新登录",
|
|
||||||
"警告",
|
|
||||||
{
|
|
||||||
confirmButtonText: "是",
|
|
||||||
cancelButtonText: "否",
|
|
||||||
type: "warning",
|
|
||||||
},
|
|
||||||
).then(() =>
|
|
||||||
{
|
|
||||||
router.replace("/login");
|
|
||||||
}).catch(() =>
|
|
||||||
{
|
|
||||||
router.replace("/login");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
},
|
},
|
||||||
function (error)
|
function (error)
|
||||||
{
|
{
|
||||||
console.log("响应拦截器,异常信息:", error);
|
|
||||||
|
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: Kane
|
|
||||||
* @Date: 2023-01-12 14:43:46
|
|
||||||
* @LastEditors: Kane
|
|
||||||
* @LastEditTime: 2023-01-12 14:43:48
|
|
||||||
* @FilePath: \admin_system\src\views\info\StaffInfo.vue
|
|
||||||
* @Description:
|
|
||||||
*
|
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<div>员工信息查询</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "staff-info",
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user