mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-04-05 17:37:53 +08:00
修复 sa-token-quick-login 插件无法正常拦截的问题
This commit is contained in:
parent
ba79154dc8
commit
1298012bcb
@ -138,7 +138,7 @@ sa-token.sso-client.client=sso-client-shop
|
||||
<!---------------------------- tabs:end ---------------------------->
|
||||
|
||||
|
||||
然后在 `sso-server` 的 `configSso` 方法里 `notLoginView` 函数中根据 client 值,返回不同的登录视图
|
||||
然后在 `sso-server` 里为每个系统开发不同的登录页,并在 `configSso` 方法里 `notLoginView` 函数中根据 client 值,返回不同的登录视图:
|
||||
|
||||
``` java
|
||||
// 配置SSO相关参数
|
||||
|
@ -75,7 +75,7 @@ public Object ssoRequest() {
|
||||
if(req.isPath("/sso/auth") && req.hasParam("redirect") == false && StpUtil.isLogin()) {
|
||||
return SaHolder.getResponse().redirect("/home");
|
||||
}
|
||||
return SaSsoServerProcessor.instance.serverDister();
|
||||
return SaSsoServerProcessor.instance.dister();
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -15,17 +15,17 @@
|
||||
*/
|
||||
package cn.dev33.satoken.quick;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
import cn.dev33.satoken.context.SaHolder;
|
||||
import cn.dev33.satoken.filter.SaServletFilter;
|
||||
import cn.dev33.satoken.quick.config.SaQuickConfig;
|
||||
import cn.dev33.satoken.router.SaRouter;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.dev33.satoken.util.SaFoxUtil;
|
||||
import cn.dev33.satoken.util.SaTokenConsts;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
* Quick Login 相关 Bean 注册
|
||||
@ -66,13 +66,13 @@ public class SaQuickRegister {
|
||||
.addInclude("/**")
|
||||
|
||||
// 排除掉登录相关接口,不需要鉴权的
|
||||
.addExclude("/favicon.ico", "/saLogin", "/doLogin", "/sa-res/**").
|
||||
.addExclude("/favicon.ico", "/saLogin", "/doLogin", "/sa-res/**")
|
||||
|
||||
// 认证函数: 每次请求执行
|
||||
setAuth(obj -> {
|
||||
.setAuth(obj -> {
|
||||
SaRouter
|
||||
.match(SaQuickManager.getConfig().getInclude().split(","))
|
||||
.notMatch(SaQuickManager.getConfig().getExclude().split(","))
|
||||
.match(SaFoxUtil.convertStringToList(SaQuickManager.getConfig().getInclude()))
|
||||
.notMatch(SaFoxUtil.convertStringToList(SaQuickManager.getConfig().getExclude()))
|
||||
.check(r -> {
|
||||
// 未登录时直接转发到login.html页面
|
||||
if (SaQuickManager.getConfig().getAuth() && ! StpUtil.isLogin()) {
|
||||
|
Loading…
Reference in New Issue
Block a user