| | |
| | | package com.java110.api.smo.login.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.smo.DefaultAbstractComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.context.PageData; |
| | | import com.java110.core.factory.AuthenticationFactory; |
| | |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.Assert; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | |
| | | * wx登录 |
| | | */ |
| | | @Service("propertyAppLoginSMOImpl") |
| | | public class PropertyAppLoginSMOImpl extends AppAbstractComponentSMO implements IPropertyAppLoginSMO { |
| | | public class PropertyAppLoginSMOImpl extends DefaultAbstractComponentSMO implements IPropertyAppLoginSMO { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(PropertyAppLoginSMOImpl.class); |
| | | |
| | |
| | | JSONObject loginInfo = JSONObject.parseObject(pd.getReqData()); |
| | | |
| | | loginInfo.put("passwd", AuthenticationFactory.passwdMd5(loginInfo.getString("password"))); |
| | | responseEntity = this.callCenterService(restTemplate, pd, loginInfo.toJSONString(), ServiceConstant.SERVICE_API_URL +"/api/user.service.login", HttpMethod.POST); |
| | | responseEntity = this.callCenterService(restTemplate, pd, loginInfo.toJSONString(), "user.service.login", HttpMethod.POST); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return responseEntity; |
| | | } |
| | | |
| | | JSONObject userInfo = JSONObject.parseObject(responseEntity.getBody()); |
| | | |
| | | if (userInfo.containsKey("code") && 0 != userInfo.getIntValue("code")) { |
| | | return responseEntity; |
| | | } |
| | | |
| | | //根据用户查询商户信息 |
| | | String userId = userInfo.getString("userId"); |
| | |
| | | userInfo.put("storeTypeCd", storeInfo.getString("storeTypeCd")); |
| | | JSONObject paramOut = new JSONObject(); |
| | | paramOut.put("result", 0); |
| | | paramOut.put("code", 0); |
| | | paramOut.put("msg", "成功"); |
| | | paramOut.put("userInfo", userInfo); |
| | | paramOut.put("token", userInfo.getString("token")); |
| | | //pd.setToken(JSONObject.parseObject(responseEntity.getBody()).getString("token")); |