记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
613f42ea
Commit
613f42ea
authored
Jun 04, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt;
parent
32ae5bea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
94 deletions
+0
-94
CrossDomainFilter.java
...va/com/liquidnet/common/web/filter/CrossDomainFilter.java
+0
-43
DefaultProfileUtil.java
...ava/com/liquidnet/common/web/util/DefaultProfileUtil.java
+0
-51
No files found.
liquidnet-bus-common/liquidnet-common-web/src/main/java/com/liquidnet/common/web/filter/CrossDomainFilter.java
deleted
100644 → 0
View file @
32ae5bea
//package com.liquidnet.common.web.filter;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.context.annotation.Configuration;
//
//import javax.servlet.*;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//@Slf4j
//@Configuration
//public class CrossDomainFilter implements Filter {
//
//
// @Override
// public void init(FilterConfig filterConfig) throws ServletException {
//
// }
//
// @Override
// public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
// HttpServletResponse resp = (HttpServletResponse)servletResponse;
// HttpServletRequest req = (HttpServletRequest)servletRequest;
// //获取请求的源
// String url = req.getHeader("Origin");
// resp.setHeader("Access-Control-Allow-Origin", url);
// resp.setHeader("Access-Control-Allow-Headers", "X-Requested-With, accept, content-type, token, xxxx");
// resp.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");
// resp.setHeader("Access-Control-Allow-Credentials", "true");
// HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
// String requestMethod = httpServletRequest.getMethod();
// if ("OPTIONS".equalsIgnoreCase(requestMethod)) {
// return;
// }
// filterChain.doFilter(servletRequest, servletResponse);
// }
//
// @Override
// public void destroy() {
//
// }
//}
liquidnet-bus-common/liquidnet-common-web/src/main/java/com/liquidnet/common/web/util/DefaultProfileUtil.java
deleted
100644 → 0
View file @
32ae5bea
package
com
.
liquidnet
.
common
.
web
.
util
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.core.env.Environment
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* Utility class to load a Spring profile to be used as default
* when there is no <code>spring.profiles.active</code> set in the environment or as command line argument.
* If the value is not available in <code>application.yml</code> then <code>dev</code> profile will be used as default.
*/
public
final
class
DefaultProfileUtil
{
private
static
final
String
SPRING_PROFILE_DEFAULT
=
"spring.profiles.default"
;
private
static
final
String
SPRING_PROFILE_DEVELOPMENT
=
"dev"
;
private
DefaultProfileUtil
()
{
}
/**
* Set a default to use when no profile is configured.
*
* @param app the Spring application
*/
public
static
void
addDefaultProfile
(
SpringApplication
app
)
{
Map
<
String
,
Object
>
defProperties
=
new
HashMap
<>();
/*
* The default profile to use when no other profiles are defined
* This cannot be set in the <code>application.yml</code> file.
* See https://github.com/spring-projects/spring-boot/issues/1219
*/
defProperties
.
put
(
SPRING_PROFILE_DEFAULT
,
SPRING_PROFILE_DEVELOPMENT
);
app
.
setDefaultProperties
(
defProperties
);
}
/**
* Get the profiles that are applied else get default profiles.
*
* @param env spring environment
* @return profiles
*/
public
static
String
[]
getActiveProfiles
(
Environment
env
)
{
String
[]
profiles
=
env
.
getActiveProfiles
();
if
(
profiles
.
length
==
0
)
{
return
env
.
getDefaultProfiles
();
}
return
profiles
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment