Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
Details
Activity
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
base_platform_enterprise
gic-platform-enterprise
Commits
915485eb
Commit
915485eb
authored
Apr 10, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二维码
parent
5b10482b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
Config.java
...eb/src/main/java/com/gic/operation/web/config/Config.java
+1
-1
LoginController.java
...ava/com/gic/operation/web/controller/LoginController.java
+10
-6
No files found.
gic-platform-operation-web/src/main/java/com/gic/operation/web/config/Config.java
View file @
915485eb
...
...
@@ -4,7 +4,7 @@ import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
//
@Configuration
public
class
Config
{
@Value
(
"${host}"
)
private
String
host
;
...
...
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/LoginController.java
View file @
915485eb
...
...
@@ -5,7 +5,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.gic.operation.web.config.Config
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -46,8 +47,7 @@ public class LoginController {
private
UserApiService
userApiService
;
@Autowired
private
MarketUserApiService
marketUserApiService
;
@Autowired
private
Config
config
;
// private static final String URL = "https://four.gicdev.com";
...
...
@@ -83,7 +83,9 @@ public class LoginController {
ServiceResponse
<
String
>
result
=
marketUserApiService
.
BindGicEnterprise
(
Long
.
valueOf
(
enterpriseId
),
null
,
null
,
null
);
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
config
.
getHost
()
+
"/market/gic"
+
"?loginKey="
+
result
.
getResult
()
Config
config
=
ConfigService
.
getConfig
(
"COMMON.4.0-gic-properties"
);
String
url
=
config
.
getProperty
(
"service_host"
,
""
).
replace
(
"gic"
,
""
);
return
RestResponse
.
success
(
url
+
"/market/gic"
+
"?loginKey="
+
result
.
getResult
()
+
"&enterpriseId="
+
enterpriseId
);
}
return
EnterpriseRestResponse
.
failure
(
result
);
...
...
@@ -91,8 +93,10 @@ public class LoginController {
@RequestMapping
(
"login-gic"
)
public
RestResponse
login
(
Integer
enterpriseId
,
String
redirectUrl
)
throws
IOException
{
Config
config
=
ConfigService
.
getConfig
(
"COMMON.4.0-gic-properties"
);
String
url
=
config
.
getProperty
(
"service_host"
,
""
).
replace
(
"gic"
,
""
);
if
(
StringUtils
.
isBlank
(
redirectUrl
))
{
redirectUrl
=
config
.
getHost
()
+
"/damo-system/overview/index"
;
redirectUrl
=
url
+
"/damo-system/overview/index"
;
// redirectUrl = "https://four.gicdev.com/cost-center/billing-center/overview";
}
String
token
;
...
...
@@ -168,7 +172,7 @@ public class LoginController {
//塞缓存
token
=
UserDetailUtils
.
setUserDetail
(
userDetail
);
String
SSO_LOGIN_URL
=
config
.
getHost
()
+
"/gic-auth-web/login-for-operation"
;
String
SSO_LOGIN_URL
=
url
+
"/gic-auth-web/login-for-operation"
;
return
RestResponse
.
success
(
SSO_LOGIN_URL
+
"?token="
+
token
+
"&redirectUrl="
+
redirectUrl
);
}
return
RestResponse
.
success
();
...
...
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