| | |
| | | JSONObject userResult = JSONObject.parseObject(responseEntity.getBody()); |
| | | int total = userResult.getIntValue("total"); |
| | | |
| | | JSONObject userInfo = paramIn.getJSONObject("userInfo"); |
| | | |
| | | if (total == 0) { |
| | | //保存用户信息 |
| | | JSONObject registerInfo = new JSONObject(); |
| | | |
| | | JSONObject userInfo = paramIn.getJSONObject("userInfo"); |
| | | |
| | | //设置默认密码 |
| | | String userDefaultPassword = MappingCache.getValue(MappingConstant.KEY_STAFF_DEFAULT_PASSWORD); |
| | | Assert.hasLength(userDefaultPassword, "映射表中未设置员工默认密码,请检查" + MappingConstant.KEY_STAFF_DEFAULT_PASSWORD); |
| | | userDefaultPassword = AuthenticationFactory.passwdMd5(userDefaultPassword); |
| | | |
| | | /** |
| | | * { |
| | | * "userId": "-1", |
| | | * "name": "张三", |
| | | * "email": "928255095@qq.com", |
| | | * "address": "青海省西宁市城中区129号", |
| | | * "password": "ERCBHDUYFJDNDHDJDNDJDHDUDHDJDDKDK", |
| | | * "locationCd": "001", |
| | | * "age": 19, |
| | | * "sex": "0", |
| | | * "tel": "17797173943", |
| | | * "level_cd": "1", |
| | | * "businessUserAttr": [{ |
| | | * "attrId":"-1", |
| | | * "specCd":"1001", |
| | | * "value":"01" |
| | | * }] |
| | | * } |
| | | */ |
| | | registerInfo.put("userId", "-1"); |
| | | registerInfo.put("email", ""); |
| | | registerInfo.put("address", userInfo.getString("country") + userInfo.getString("province") + userInfo.getString("city")); |
| | |
| | | userResult = JSONObject.parseObject(responseEntity.getBody()); |
| | | } |
| | | |
| | | JSONObject userInfo = userResult.getJSONArray("users").getJSONObject(0); |
| | | JSONObject realUserInfo = userResult.getJSONArray("users").getJSONObject(0); |
| | | userInfo.putAll(realUserInfo); |
| | | userInfo.put("password", ""); |
| | | |
| | | try { |
| | | Map userMap = new HashMap(); |
| | | userMap.put(CommonConstant.LOGIN_USER_ID, userInfo.getString("userId")); |
| | | userMap.put(CommonConstant.LOGIN_USER_NAME, userInfo.getString("name")); |
| | | String token = AuthenticationFactory.createAndSaveToken(userMap); |
| | | JSONObject paramOut = new JSONObject(); |
| | | paramOut.putAll(userInfo); |
| | | paramOut.put("result", 0); |
| | | paramOut.put("userInfo", userInfo); |
| | | paramOut.put("token", token); |
| | | paramOut.put("sessionKey", sessionKey); |
| | | pd.setToken(token); |