| | |
| | | package com.java110.web.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.cache.CommonCache; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.factory.AuthenticationFactory; |
| | | import com.java110.core.factory.ValidateCodeFactory; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * 登录信息实现类 |
| | | * Created by wuxw on 2019/3/20. |
| | |
| | | public class LoginServiceSMOImpl extends BaseComponentSMO implements ILoginServiceSMO { |
| | | private final static Logger logger = LoggerFactory.getLogger(LoginServiceSMOImpl.class); |
| | | |
| | | |
| | | private static char[] chs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".toCharArray(); |
| | | private static final int NUMBER_OF_CHS = 4; |
| | | private static final int IMG_WIDTH = 65; |
| | | private static final int IMG_HEIGHT = 25; |
| | | private static Random r = new Random(); |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | |
| | | } |
| | | |
| | | 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); |
| | | responseEntity = this.callCenterService(restTemplate,pd,loginInfo.toJSONString(), "http://api.java110.com:8008/api/user.service.login",HttpMethod.POST); |
| | | if(responseEntity.getStatusCode() == HttpStatus.OK){ |
| | | pd.setToken(JSONObject.parseObject(responseEntity.getBody()).getString("token")); |
| | | } |