mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 09:35:29 +08:00
支持应用管理
This commit is contained in:
parent
506d0923b0
commit
f5c985aa4e
@ -58,8 +58,6 @@ spring:
|
|||||||
messages:
|
messages:
|
||||||
# 国际化资源文件路径
|
# 国际化资源文件路径
|
||||||
basename: i18n/messages
|
basename: i18n/messages
|
||||||
profiles:
|
|
||||||
active: @profiles.active@
|
|
||||||
# 文件上传
|
# 文件上传
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: local
|
active: dev
|
||||||
application:
|
application:
|
||||||
name: saas-tenant-admin
|
name: saas-tenant-admin
|
||||||
config:
|
config:
|
||||||
@ -19,7 +19,7 @@ spring:
|
|||||||
spring:
|
spring:
|
||||||
config:
|
config:
|
||||||
activate:
|
activate:
|
||||||
on-profile: local
|
on-profile: dev
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
@ -33,20 +33,20 @@ spring:
|
|||||||
group: dev
|
group: dev
|
||||||
|
|
||||||
---
|
---
|
||||||
# dev
|
# prod
|
||||||
spring:
|
spring:
|
||||||
config:
|
config:
|
||||||
activate:
|
activate:
|
||||||
on-profile: dev
|
on-profile: prod
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: http://nacos:8848
|
server-addr: http://nacos:8848
|
||||||
namespace: c5c00044-93e6-4e66-8060-3f39aa7ab82b
|
namespace: rrrrrrrrr
|
||||||
group: dev
|
group: prod
|
||||||
config:
|
config:
|
||||||
server-addr: http://nacos:8848
|
server-addr: http://nacos:8848
|
||||||
file-extension: yaml
|
file-extension: yaml
|
||||||
namespace: c5c00044-93e6-4e66-8060-3f39aa7ab82b
|
namespace: rrrrrrrrr
|
||||||
group: dev
|
group: prod
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
package org.dromara.common.security.config;
|
package org.dromara.common.security.config;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.context.SaHolder;
|
||||||
import cn.dev33.satoken.exception.NotLoginException;
|
import cn.dev33.satoken.exception.NotLoginException;
|
||||||
import cn.dev33.satoken.filter.SaServletFilter;
|
import cn.dev33.satoken.filter.SaServletFilter;
|
||||||
import cn.dev33.satoken.httpauth.basic.SaHttpBasicUtil;
|
import cn.dev33.satoken.httpauth.basic.SaHttpBasicUtil;
|
||||||
import cn.dev33.satoken.interceptor.SaInterceptor;
|
import cn.dev33.satoken.interceptor.SaInterceptor;
|
||||||
import cn.dev33.satoken.router.SaRouter;
|
import cn.dev33.satoken.router.SaRouter;
|
||||||
|
import cn.dev33.satoken.same.SaSameUtil;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.dev33.satoken.util.SaResult;
|
import cn.dev33.satoken.util.SaResult;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -87,6 +89,10 @@ public class SecurityConfig implements WebMvcConfigurer {
|
|||||||
.addInclude("/actuator", "/actuator/**")
|
.addInclude("/actuator", "/actuator/**")
|
||||||
.setAuth(obj -> {
|
.setAuth(obj -> {
|
||||||
SaHttpBasicUtil.check(username + ":" + password);
|
SaHttpBasicUtil.check(username + ":" + password);
|
||||||
|
|
||||||
|
// 校验 Same-Token 身份凭证 —— 以下两句代码可简化为:SaSameUtil.checkCurrentRequestToken();
|
||||||
|
String token = SaHolder.getRequest().getHeader(SaSameUtil.SAME_TOKEN);
|
||||||
|
SaSameUtil.checkToken(token);
|
||||||
})
|
})
|
||||||
.setError(e -> SaResult.error(e.getMessage()).setCode(HttpStatus.UNAUTHORIZED));
|
.setError(e -> SaResult.error(e.getMessage()).setCode(HttpStatus.UNAUTHORIZED));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user