소스 검색

更新portal相关功能

master
梁超 2 주 전
부모
커밋
018ea8f523

+ 15
- 0
zhywpt-service-ias/src/main/java/cn/com/taiji/ias/config/RestTemplateConfig.java 파일 보기

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
- 0
zhywpt-service-ias/src/main/java/cn/com/taiji/ias/manager/MyCommHandleManager.java 파일 보기

import cn.com.taiji.core.model.comm.protocol.ias.IasServiceSystem; import cn.com.taiji.core.model.comm.protocol.ias.IasServiceSystem;
import cn.com.taiji.core.model.comm.protocol.ias.IasServiceType; 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.BillServiceHandler;
import cn.com.taiji.ias.manager.handler.PortalServiceHandler;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;


public class MyCommHandleManager extends AbstractCommHandleManager { public class MyCommHandleManager extends AbstractCommHandleManager {
@Autowired @Autowired
private BillServiceHandler billServiceHandler; private BillServiceHandler billServiceHandler;
@Autowired
private PortalServiceHandler portalServiceHandler;


public MyCommHandleManager() { public MyCommHandleManager() {
super(IasServiceSystem.ISSUES); super(IasServiceSystem.ISSUES);
@PostConstruct @PostConstruct
public void init() { public void init() {
registerJsonService(billServiceHandler); registerJsonService(billServiceHandler);
registerJsonService(portalServiceHandler);
} }


@Override @Override

+ 1
- 1
zhywpt-service-ias/src/main/java/cn/com/taiji/ias/manager/portal/LoginConfirmManager.java 파일 보기

if (!hasText(openId)) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("code已失效"); if (!hasText(openId)) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("code已失效");
AccountInfo accountInfo = accountInfoRepo.findByOpenId(openId); AccountInfo accountInfo = accountInfoRepo.findByOpenId(openId);
if (accountInfo == null) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("账号不存在"); 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)); accountInfoRepo.save(handleAccountInfo(accountInfo, request));
String accessToken = UUID.randomUUID().toString().replaceAll("-", ""); String accessToken = UUID.randomUUID().toString().replaceAll("-", "");
setTokenCache(accountInfo, accessToken); setTokenCache(accountInfo, accessToken);

Loading…
취소
저장