@@ -0,0 +1,15 @@ | |||
package cn.com.taiji.ias.config; | |||
import org.springframework.cloud.client.loadbalancer.LoadBalanced; | |||
import org.springframework.context.annotation.Bean; | |||
import org.springframework.context.annotation.Configuration; | |||
import org.springframework.web.client.RestTemplate; | |||
@Configuration | |||
public class RestTemplateConfig { | |||
@Bean | |||
@LoadBalanced | |||
public RestTemplate restTemplate() { | |||
return new RestTemplate(); | |||
} | |||
} |
@@ -4,6 +4,7 @@ import cn.com.taiji.core.manager.comm.AbstractCommHandleManager; | |||
import cn.com.taiji.core.model.comm.protocol.ias.IasServiceSystem; | |||
import cn.com.taiji.core.model.comm.protocol.ias.IasServiceType; | |||
import cn.com.taiji.ias.manager.handler.BillServiceHandler; | |||
import cn.com.taiji.ias.manager.handler.PortalServiceHandler; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -20,6 +21,8 @@ import javax.annotation.PostConstruct; | |||
public class MyCommHandleManager extends AbstractCommHandleManager { | |||
@Autowired | |||
private BillServiceHandler billServiceHandler; | |||
@Autowired | |||
private PortalServiceHandler portalServiceHandler; | |||
public MyCommHandleManager() { | |||
super(IasServiceSystem.ISSUES); | |||
@@ -31,6 +34,7 @@ public class MyCommHandleManager extends AbstractCommHandleManager { | |||
@PostConstruct | |||
public void init() { | |||
registerJsonService(billServiceHandler); | |||
registerJsonService(portalServiceHandler); | |||
} | |||
@Override |
@@ -30,7 +30,7 @@ public class LoginConfirmManager extends AbstractLoginManager { | |||
if (!hasText(openId)) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("code已失效"); | |||
AccountInfo accountInfo = accountInfoRepo.findByOpenId(openId); | |||
if (accountInfo == null) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("账号不存在"); | |||
Staff staff = findAndValidStaff(accountInfo.getMobile(), request.getLoginSource()); | |||
Staff staff = findAndValidStaff(accountInfo.getOpenId(), request.getLoginSource()); | |||
accountInfoRepo.save(handleAccountInfo(accountInfo, request)); | |||
String accessToken = UUID.randomUUID().toString().replaceAll("-", ""); | |||
setTokenCache(accountInfo, accessToken); |