| | |
| | | @RestController |
| | | public class CallComponentController extends BaseController { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(LoginServiceSMOImpl.class); |
| | | private final static Logger logger = LoggerFactory.getLogger(CallComponentController.class); |
| | | |
| | | /** |
| | | * 调用组件方法 |
| | |
| | | loginInfo.put("passwd", AuthenticationFactory.passwdMd5(loginInfo.getString("passwd"))); |
| | | responseEntity = this.callCenterService(restTemplate,pd,loginInfo.toJSONString(),ServiceConstant.SERVICE_API_URL+"/api/user.service.login",HttpMethod.POST); |
| | | if(responseEntity.getStatusCode() == HttpStatus.OK){ |
| | | pd.setToken(responseEntity.getBody()); |
| | | pd.setToken(JSONObject.parseObject(responseEntity.getBody()).getString("token")); |
| | | } |
| | | return responseEntity; |
| | | } |
| | |
| | | header.add(CommonConstant.HTTP_APP_ID.toLowerCase(), CommonConstant.HC_WEB_APP_ID); |
| | | header.add(CommonConstant.HTTP_USER_ID.toLowerCase(), CommonConstant.ORDER_DEFAULT_USER_ID); |
| | | header.add(CommonConstant.HTTP_TRANSACTION_ID.toLowerCase(), pd.getTransactionId()); |
| | | header.add(CommonConstant.HTTP_REQ_TIME.toLowerCase(), pd.getReqData()); |
| | | header.add(CommonConstant.HTTP_REQ_TIME.toLowerCase(), pd.getRequestTime()); |
| | | header.add(CommonConstant.HTTP_SIGN.toLowerCase(), ""); |
| | | HttpEntity<String> httpEntity = new HttpEntity<String>(param, header); |
| | | try{ |
| | |
| | | |
| | | public String getResponseTime(); |
| | | |
| | | public String getRequestTime(); |
| | | |
| | | |
| | | public ResponseEntity getResponseEntity(); |
| | | |
| New file |
| | |
| | | package com.java110.core.factory; |
| | | |
| | | import org.junit.Test; |
| | | |
| | | import static org.junit.Assert.*; |
| | | |
| | | /** |
| | | * Created by wuxw on 2019/3/20. |
| | | */ |
| | | public class AuthenticationFactoryTest { |
| | | @Test |
| | | public void passwdMd5() throws Exception { |
| | | System.out.println(AuthenticationFactory.passwdMd5("admin")); |
| | | } |
| | | |
| | | } |
| | |
| | | public FilterRegistrationBean jwtFilter() { |
| | | final FilterRegistrationBean registrationBean = new FilterRegistrationBean(); |
| | | registrationBean.setFilter(new JwtFilter()); |
| | | //registrationBean.addUrlPatterns("/"); |
| | | registrationBean.addUrlPatterns("/"); |
| | | registrationBean.addUrlPatterns("/console/*"); |
| | | |
| | | return registrationBean; |