From 82e4b546771ccb8f8c318bc35a3148b8ac254310 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Wed, 17 Jul 2024 14:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/config/SecurityConfiguration.java | 2 +- .../resources/mybatis-mapper/XxlJobInfoMapper.xml | 5 +---- .../src/main/resources/static/js/common.1.js | 13 ++++++++++--- .../resources/templates/common/common.macro.ftl | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/framework/security/config/SecurityConfiguration.java b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/framework/security/config/SecurityConfiguration.java index 743300f66..ea61bb8ff 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/framework/security/config/SecurityConfiguration.java +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/framework/security/config/SecurityConfiguration.java @@ -35,10 +35,10 @@ public class SecurityConfiguration { httpSecurity.csrf().disable() // 禁用 CSRF 保护 .authorizeRequests() // 1. 静态资源,可匿名访问 + .antMatchers("/**").permitAll() .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll() // 2. 登录相关的接口,可匿名访问 .antMatchers("/toLogin").permitAll() - .antMatchers("/**").permitAll() .antMatchers("/auth/login-by-code").permitAll() .antMatchers("/auth/refresh-token").permitAll() .antMatchers("/auth/logout").permitAll() diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml index e872a9d68..4bba1c088 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml @@ -39,10 +39,7 @@ - t - . - id - , + t.id, t.job_group, t.job_desc, t.add_time, diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/static/js/common.1.js b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/static/js/common.1.js index 1a3fd24ce..619245e3a 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/static/js/common.1.js +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/static/js/common.1.js @@ -8,8 +8,15 @@ $(function(){ btn: [ I18n.system_ok, I18n.system_cancel ] }, function(index){ layer.close(index); - - $.post(base_url + "/logout", function(data, status) { + // 直接清理cookie,直接设置过期 + document.cookie = "ACCESS_TOKEN=; max-age=0; path=/xxl-job-admin"; + document.cookie = "REFRESH_TOKEN=; max-age=0; path=/xxl-job-admin"; + layer.open({ + icon: '2', + title: I18n.system_tips, + content: ('已退出登录请关闭当前会话框!' || I18n.logout_success) + }); + /*$.post(base_url + "/logout", function(data, status) { if (data.code == "200") { layer.msg( I18n.logout_success ); setTimeout(function(){ @@ -23,7 +30,7 @@ $(function(){ icon: '2' }); } - }); + });*/ }); }); diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/templates/common/common.macro.ftl b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/templates/common/common.macro.ftl index aace849f9..f8b193861 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/templates/common/common.macro.ftl +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/templates/common/common.macro.ftl @@ -88,7 +88,7 @@