Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
8408278b
Commit
8408278b
authored
Feb 23, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加日志
parent
3301838e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
Config.java
...rc/main/java/com/gic/haoban/manage/web/config/Config.java
+20
-0
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+3
-7
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/config/Config.java
View file @
8408278b
...
...
@@ -12,6 +12,10 @@ import org.springframework.context.annotation.Configuration;
public
class
Config
{
@Value
(
"${corpid}"
)
private
String
corpid
;
@Value
(
"${suiteid}"
)
private
String
suiteId
;
@Value
(
"${host}"
)
private
String
host
;
public
String
getCorpid
()
{
return
corpid
;
...
...
@@ -20,4 +24,20 @@ public class Config {
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
public
String
getSuiteId
()
{
return
suiteId
;
}
public
void
setSuiteId
(
String
suiteId
)
{
this
.
suiteId
=
suiteId
;
}
public
String
getHost
()
{
return
host
;
}
public
void
setHost
(
String
host
)
{
this
.
host
=
host
;
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
8408278b
...
...
@@ -35,8 +35,6 @@ public class ApplicationController extends WebBaseController{
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
Config
config
;
@ApolloConfig
private
com
.
ctrip
.
framework
.
apollo
.
Config
config1
;
@RequestMapping
(
"application-list"
)
public
HaobanResponse
applicationList
()
{
...
...
@@ -49,11 +47,9 @@ public class ApplicationController extends WebBaseController{
@IgnoreLogin
public
HaobanResponse
getAuthUrl
(){
//String suiteId = GlobalVar.ctxPropertiesMap.get("suiteId");
log
.
info
(
"从config中取到的值:{}"
,
config
.
getCorpid
());
log
.
info
(
"111:{}"
,
config1
.
getProperty
(
"corpid"
,
"corpidvalue"
));
String
suiteId
=
"ww7d6566614055cf27"
;
String
suiteId
=
config
.
getSuiteId
();
log
.
info
(
"应用ID:{}"
,
suiteId
);
String
redictUrl
=
"https://www.gicdev.com/haoban-manage3-web/
callback"
;
String
redictUrl
=
config
.
getHost
()
+
"
callback"
;
String
authorizationUrl
=
this
.
qywxSuiteApiService
.
getGrantAuthorizationUrl
(
suiteId
,
redictUrl
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
authorizationUrl
);
}
...
...
@@ -61,7 +57,7 @@ public class ApplicationController extends WebBaseController{
@RequestMapping
(
"callback"
)
@IgnoreLogin
public
HaobanResponse
callback
(
String
auth_code
){
String
suiteId
=
"ww7d6566614055cf27"
;
String
suiteId
=
config
.
getSuiteId
()
;
String
result
=
this
.
qywxSuiteApiService
.
corpAuth
(
suiteId
,
auth_code
);
log
.
info
(
"企业微信回调结果:{}. {}"
,
auth_code
,
result
);
QywxCorpInfoDTO
dto
=
JSON
.
parseObject
(
result
,
QywxCorpInfoDTO
.
class
);
...
...
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