mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-05-04 20:57:56 +08:00
优化 sso-server 前后端分离 demo 代码
This commit is contained in:
parent
ebe405fe8b
commit
dab9e15673
@ -1,19 +1,13 @@
|
|||||||
package com.pj.h5;
|
package com.pj.h5;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import javax.servlet.Filter;
|
|
||||||
import javax.servlet.FilterChain;
|
|
||||||
import javax.servlet.FilterConfig;
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.ServletRequest;
|
|
||||||
import javax.servlet.ServletResponse;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跨域过滤器
|
* 跨域过滤器
|
||||||
* @author click33
|
* @author click33
|
||||||
@ -46,7 +40,6 @@ public class CorsFilter implements Filter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// System.out.println("*********************************过滤器被使用**************************");
|
|
||||||
chain.doFilter(req, res);
|
chain.doFilter(req, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public class H5Controller {
|
|||||||
* 获取 redirectUrl
|
* 获取 redirectUrl
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/sso/getRedirectUrl")
|
@RequestMapping("/sso/getRedirectUrl")
|
||||||
private Object getRedirectUrl(String redirect, String mode, String client) {
|
public SaResult getRedirectUrl(String redirect, String mode, String client) {
|
||||||
// 未登录情况下,返回 code=401
|
// 未登录情况下,返回 code=401
|
||||||
if(StpUtil.isLogin() == false) {
|
if(StpUtil.isLogin() == false) {
|
||||||
return SaResult.code(401);
|
return SaResult.code(401);
|
||||||
|
Loading…
Reference in New Issue
Block a user