Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
胡慧
cash-loan-flow-boss
Commits
5f0823e9
Commit
5f0823e9
authored
Aug 21, 2019
by
WeiWei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试domain
parent
36c38834
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
LogController.java
...up/cashloanflowboss/api/log/controller/LogController.java
+2
-1
LogService.java
...antgroup/cashloanflowboss/api/log/service/LogService.java
+7
-6
CorsConfiguration.java
...ashloanflowboss/core/configuration/CorsConfiguration.java
+6
-4
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/log/controller/LogController.java
View file @
5f0823e9
...
@@ -14,7 +14,6 @@ import javax.validation.Valid;
...
@@ -14,7 +14,6 @@ import javax.validation.Valid;
/**
/**
* Created by WeiWei on 2019/7/22.
* Created by WeiWei on 2019/7/22.
*/
*/
@CrossOrigin
@RestController
@RestController
public
class
LogController
{
public
class
LogController
{
...
@@ -27,6 +26,7 @@ public class LogController {
...
@@ -27,6 +26,7 @@ public class LogController {
* @param loginFormModel
* @param loginFormModel
* @return
* @return
*/
*/
@CrossOrigin
(
allowCredentials
=
"true"
)
@PostMapping
(
"/login"
)
@PostMapping
(
"/login"
)
public
Result
<
Boolean
>
login
(
@RequestBody
@Valid
LoginFormModel
loginFormModel
)
{
public
Result
<
Boolean
>
login
(
@RequestBody
@Valid
LoginFormModel
loginFormModel
)
{
return
new
Result
<>(
ApplicationStatus
.
SUCCESS
,
this
.
logService
.
login
(
loginFormModel
.
getUsername
(),
loginFormModel
.
getPassword
()));
return
new
Result
<>(
ApplicationStatus
.
SUCCESS
,
this
.
logService
.
login
(
loginFormModel
.
getUsername
(),
loginFormModel
.
getPassword
()));
...
@@ -37,6 +37,7 @@ public class LogController {
...
@@ -37,6 +37,7 @@ public class LogController {
*
*
* @return
* @return
*/
*/
@CrossOrigin
(
allowCredentials
=
"true"
)
@DeleteMapping
(
"/logout"
)
@DeleteMapping
(
"/logout"
)
@Security
(
authorityId
=
"Log.logout"
,
authorities
=
Authority
.
READ
)
@Security
(
authorityId
=
"Log.logout"
,
authorities
=
Authority
.
READ
)
public
Result
<
Boolean
>
logout
()
{
public
Result
<
Boolean
>
logout
()
{
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/log/service/LogService.java
View file @
5f0823e9
...
@@ -66,12 +66,13 @@ public class LogService {
...
@@ -66,12 +66,13 @@ public class LogService {
session
.
setAttribute
(
ApplicationDictionary
.
PRINCIPAL
,
JSONTools
.
serialize
(
principal
));
session
.
setAttribute
(
ApplicationDictionary
.
PRINCIPAL
,
JSONTools
.
serialize
(
principal
));
Cookie
cookie
=
new
Cookie
(
"JSESSIONID"
,
session
.
getId
());
// Cookie cookie = new Cookie("JSESSIONID", session.getId());
log
.
info
(
"登录客户端IP:{}"
,
request
.
getRemoteAddr
());
// log.info("登录客户端IP:{}", request.getRemoteAddr());
cookie
.
setDomain
(
request
.
getRemoteAddr
());
// cookie.setHttpOnly(false);
cookie
.
setPath
(
"/"
);
// cookie.setDomain(request.getRemoteAddr());
// cookie.setPath("/");
this
.
response
.
addCookie
(
cookie
);
//
// this.response.addCookie(cookie);
return
true
;
return
true
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/CorsConfiguration.java
View file @
5f0823e9
...
@@ -11,14 +11,16 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
...
@@ -11,14 +11,16 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
* @author: suntao
* @author: suntao
*/
*/
@Configuration
@Configuration
public
class
CorsConfiguration
extends
WebMvcConfigurerAdapter
{
public
class
CorsConfiguration
extends
WebMvcConfigurerAdapter
{
@Override
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
registry
.
addMapping
(
"/**"
)
.
allowedMethods
(
"*"
)
.
allowedOrigins
(
"*"
)
.
allowedOrigins
(
"*"
)
.
allowedHeaders
(
"*"
);
.
allowedMethods
(
"GET"
,
"HEAD"
,
"POST"
,
"PUT"
,
"PATCH"
,
"DELETE"
,
"OPTIONS"
,
"TRACE"
)
super
.
addCorsMappings
(
registry
);
.
allowCredentials
(
true
);
}
}
}
}
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