| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.app.properties.WechatAuthProperties; |
| | | import com.java110.app.smo.AppAbstractComponentSMO; |
| | | import com.java110.app.smo.wxLogin.IWxLoginSMO; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | |
| | | * wx登录 |
| | | */ |
| | | @Service("wxLoginSMOImpl") |
| | | public class WxLoginSMOImpl extends AbstractComponentSMO implements IWxLoginSMO { |
| | | public class WxLoginSMOImpl extends AppAbstractComponentSMO implements IWxLoginSMO { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(WxLoginSMOImpl.class); |
| | | |
| | |
| | | userResult = JSONObject.parseObject(responseEntity.getBody()); |
| | | } |
| | | |
| | | JSONObject userInfo = userResult.getJSONArray("users").getJSONObject(0); |
| | | userInfo.put("password", ""); |
| | | |
| | | try { |
| | | Map userMap = new HashMap(); |
| | | userMap.put(CommonConstant.LOGIN_USER_ID, userResult.getString("userId")); |
| | | userMap.put(CommonConstant.LOGIN_USER_ID, userInfo.getString("userId")); |
| | | String token = AuthenticationFactory.createAndSaveToken(userMap); |
| | | JSONObject paramOut = new JSONObject(); |
| | | paramOut.putAll(userResult); |
| | | paramOut.putAll(userInfo); |
| | | paramOut.put("token", token); |
| | | paramOut.put("sessionKey", sessionKey); |
| | | pd.setToken(token); |