Commit e3288b1c by 陶光胜

日志

parent f7851870
package com.gic.haoban.manage.web.controller;
import java.io.IOException;
import java.util.List;
import com.alibaba.fastjson.JSON;
......@@ -29,6 +30,8 @@ import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.service.ApplicationApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import javax.servlet.http.HttpServletResponse;
@RestController
public class ApplicationController extends WebBaseController{
private static final Logger log = LogManager.getLogger(ApplicationController.class);
......@@ -65,7 +68,6 @@ public class ApplicationController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1);
}
@RequestMapping("has-bind-contract")
@IgnoreLogin
public HaobanResponse hasBindContract(){
LoginVO login = AuthRequestUtil.getSessionUser();
String wxEnterpriseId = login.getWxEnterpriseId();
......@@ -77,7 +79,6 @@ public class ApplicationController extends WebBaseController{
}
@RequestMapping("get-auth-url")
@IgnoreLogin
public HaobanResponse getAuthUrl(){
String suiteId = config.getSuiteId();
log.info("应用ID:{}", suiteId);
......@@ -87,8 +88,7 @@ public class ApplicationController extends WebBaseController{
}
@RequestMapping("callback")
@IgnoreLogin
public HaobanResponse callback(String auth_code){
public void callback(String auth_code, HttpServletResponse response){
String suiteId = config.getSuiteId();
String result = this.qywxSuiteApiService.corpAuth(suiteId, auth_code);
log.info("企业微信回调结果:{}. {}", auth_code, result);
......@@ -106,9 +106,14 @@ public class ApplicationController extends WebBaseController{
this.departmentApiService.initwxDepartment(dto.getCorpid(), suiteId, enterpriseDTO.getWxEnterpriseId());
enterpriseDTO.setContactFlag(1);
wxEnterpriseApiService.update(enterpriseDTO);
return resultResponse(HaoBanErrCode.ERR_1, result);
}
return resultResponse(HaoBanErrCode.ERR_0, dto);
String redirectUri = config.getHost() + "index";
redirectUri = redirectUri.replace("haoban-manage3-web", "haoban-3/#");
try {
response.sendRedirect(redirectUri);
} catch (IOException e) {
e.printStackTrace();
}
}
@RequestMapping("cancal-suite")
......
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