Commit 8408278b by 陶光胜

加日志

parent 3301838e
......@@ -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;
}
}
......@@ -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);
......
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