From 9cbf06b6eee89922017b4c2db2a9ac510dfbc8f9 Mon Sep 17 00:00:00 2001 From: liuchen864 <23082234@qq.com> Date: Sat, 7 Oct 2023 16:12:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E6=88=90magic-api=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/WinWebSecurityConfigurerAdapter.java | 2 ++ win-server/pom.xml | 5 +++++ .../src/main/resources/application-dev.yaml | 17 ----------------- .../src/main/resources/application-prod.yaml | 17 ----------------- .../src/main/resources/application-test.yaml | 17 ----------------- win-server/src/main/resources/application.yaml | 4 +--- 6 files changed, 8 insertions(+), 54 deletions(-) diff --git a/win-framework/win-spring-boot-starter-security/src/main/java/com/win/framework/security/config/WinWebSecurityConfigurerAdapter.java b/win-framework/win-spring-boot-starter-security/src/main/java/com/win/framework/security/config/WinWebSecurityConfigurerAdapter.java index b2cb477c..312adc1c 100644 --- a/win-framework/win-spring-boot-starter-security/src/main/java/com/win/framework/security/config/WinWebSecurityConfigurerAdapter.java +++ b/win-framework/win-spring-boot-starter-security/src/main/java/com/win/framework/security/config/WinWebSecurityConfigurerAdapter.java @@ -131,6 +131,8 @@ public class WinWebSecurityConfigurerAdapter { //.antMatchers("/captcha/captchaImage").permitAll() // 1.6 webSocket 允许匿名访问 .antMatchers("/websocket/message").permitAll() + // 1.7 magic-api 允许匿名访问 + .antMatchers("/magic/web/**").anonymous() // ②:每个项目的自定义规则 .and().authorizeRequests(registry -> // 下面,循环设置自定义规则 authorizeRequestsCustomizers.forEach(customizer -> customizer.customize(registry))) diff --git a/win-server/pom.xml b/win-server/pom.xml index ebace6af..8883d200 100644 --- a/win-server/pom.xml +++ b/win-server/pom.xml @@ -22,6 +22,11 @@ + + org.ssssssss + magic-api-spring-boot-starter + + com.win win-module-wms-biz diff --git a/win-server/src/main/resources/application-dev.yaml b/win-server/src/main/resources/application-dev.yaml index 136b59cb..bc750888 100644 --- a/win-server/src/main/resources/application-dev.yaml +++ b/win-server/src/main/resources/application-dev.yaml @@ -160,20 +160,3 @@ win: - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求 - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 demo: false # 开启演示模式 - -justauth: - enabled: true - type: - DINGTALK: # 钉钉 - client-id: dingvrnreaje3yqvzhxg - client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI - ignore-check-redirect-uri: true - WECHAT_ENTERPRISE: # 企业微信 - client-id: wwd411c69a39ad2e54 - client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw - agent-id: 1000004 - ignore-check-redirect-uri: true - cache: - type: REDIS - prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: - timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 diff --git a/win-server/src/main/resources/application-prod.yaml b/win-server/src/main/resources/application-prod.yaml index 0c271ec8..e42929f0 100644 --- a/win-server/src/main/resources/application-prod.yaml +++ b/win-server/src/main/resources/application-prod.yaml @@ -159,20 +159,3 @@ win: - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求 - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 demo: false # 开启演示模式 - -justauth: - enabled: true - type: - DINGTALK: # 钉钉 - client-id: dingvrnreaje3yqvzhxg - client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI - ignore-check-redirect-uri: true - WECHAT_ENTERPRISE: # 企业微信 - client-id: wwd411c69a39ad2e54 - client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw - agent-id: 1000004 - ignore-check-redirect-uri: true - cache: - type: REDIS - prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: - timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 diff --git a/win-server/src/main/resources/application-test.yaml b/win-server/src/main/resources/application-test.yaml index 823b9082..c168e9b5 100644 --- a/win-server/src/main/resources/application-test.yaml +++ b/win-server/src/main/resources/application-test.yaml @@ -158,20 +158,3 @@ win: - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求 - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 demo: false # 开启演示模式 - -justauth: - enabled: true - type: - DINGTALK: # 钉钉 - client-id: dingvrnreaje3yqvzhxg - client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI - ignore-check-redirect-uri: true - WECHAT_ENTERPRISE: # 企业微信 - client-id: wwd411c69a39ad2e54 - client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw - agent-id: 1000004 - ignore-check-redirect-uri: true - cache: - type: REDIS - prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: - timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 diff --git a/win-server/src/main/resources/application.yaml b/win-server/src/main/resources/application.yaml index 3fe7da65..1f50aff1 100644 --- a/win-server/src/main/resources/application.yaml +++ b/win-server/src/main/resources/application.yaml @@ -101,9 +101,6 @@ win: web: admin-ui: url: http://dashboard.win.iocoder.cn # Admin 管理后台 UI 的地址 - security: - permit-all_urls: - - /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,不需要登录 websocket: enable: true # websocket的开关 path: /websocket/message # 路径 @@ -143,6 +140,7 @@ win: - /admin-api/system/captcha/captchaImage # 校验图片验证码,和租户无关 - /admin-api/infra/file/*/get/** # 获取图片,和租户无关 - /jmreport/* # 积木报表,无法携带租户编号 + - /magic/web/* # magic-api 和租户无关 ignore-tables: - system_tenant - system_tenant_package