Commit 4900ccfe by guojuxing

登录数据处理调整

parent 1e68a89e
......@@ -9,6 +9,8 @@ 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.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -37,6 +39,8 @@ import com.gic.open.api.service.market.MarketUserApiService;
@RestController
public class LoginController {
private static final Logger LOGGER = LogManager.getLogger(LoginController.class);
@Autowired
private OperationUserApiService operationUserApiService;
@Autowired
......@@ -93,6 +97,8 @@ public class LoginController {
@RequestMapping("login-gic")
public RestResponse login(Integer enterpriseId, String redirectUrl) throws IOException {
long startTime = System.currentTimeMillis();
Config config = ConfigService.getConfig("COMMON.4.0-gic-properties");
String url = config.getProperty("service_host", "").replace("/gic", "");
if (StringUtils.isBlank(redirectUrl)) {
......@@ -155,7 +161,7 @@ public class LoginController {
}
//查询全部的操作模块
Map<String, MenuInfo> moduleMap = new HashMap<>(16);
ServiceResponse<List<MenuDTO>> allGicMenu = menuApiService.getSuperAdminMenuNotTree(enterpriseId);
ServiceResponse<List<MenuDTO>> allGicMenu = menuApiService.getAllMenuNotTree(enterpriseDTO.getVersionCode());
if (allGicMenu.isSuccess()) {
List<MenuDTO> temp = allGicMenu.getResult();
List<MenuInfo> tempMenuInfoList = EntityUtil.changeEntityListNew(MenuInfo.class, temp);
......@@ -177,6 +183,8 @@ public class LoginController {
//塞缓存
token = UserDetailUtils.setUserDetail(userDetail);
LOGGER.info("单点登录所花时间:{}", System.currentTimeMillis() - startTime);
String SSO_LOGIN_URL = url + "/gic-auth-web/login-for-operation";
return RestResponse.success(SSO_LOGIN_URL + "?token=" + token + "&redirectUrl=" + redirectUrl);
}
......
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