Commit b15312c4 authored by lj's avatar lj

config(auth): 更新前端跳转地址并调整CORS配置

- 将登录成功后的跳转地址从 qytydp.qyting.com 更新为 qyzhjt.justh5.com
- 移除CORS配置中的 allowCredentials 设置以确保跨域请求兼容性
- 保留所有域名、头部和方法的通配符允许设置
parent 1cd6092a
...@@ -44,7 +44,6 @@ public class ConfigurerAdapter implements WebMvcConfigurer { ...@@ -44,7 +44,6 @@ public class ConfigurerAdapter implements WebMvcConfigurer {
public CorsFilter corsFilter() { public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration(); CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.addAllowedOrigin("*"); config.addAllowedOrigin("*");
config.addAllowedHeader("*"); config.addAllowedHeader("*");
config.addAllowedMethod("*"); config.addAllowedMethod("*");
......
...@@ -184,7 +184,7 @@ public class AuthorizationController { ...@@ -184,7 +184,7 @@ public class AuthorizationController {
redisUtils.set(String.format(RedisCacheConfigPath.loginUserCacheKey, jwtUserDto.getUsername()), JSONObject.toJSONString(jwtUserDto), 1, TimeUnit.HOURS); redisUtils.set(String.format(RedisCacheConfigPath.loginUserCacheKey, jwtUserDto.getUsername()), JSONObject.toJSONString(jwtUserDto), 1, TimeUnit.HOURS);
log.info("跳转前端首页--token:{}",jwtUserDto.getToken()); log.info("跳转前端首页--token:{}",jwtUserDto.getToken());
httpServletResponse.setHeader("authorization",jwtUserDto.getToken()); httpServletResponse.setHeader("authorization",jwtUserDto.getToken());
httpServletResponse.sendRedirect("http://qytydp.qyting.com/dashboard?token="+jwtUserDto.getToken()); httpServletResponse.sendRedirect("https://qyzhjt.justh5.com/dashboard?token="+jwtUserDto.getToken());
return null; return null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment