Browse Source

Merge remote-tracking branch 'origin/dev' into dev2

wangmh 7 years ago
parent
commit
afdebff726

+ 4 - 3
sso-server/src/main/java/com/uas/sso/service/impl/UserServiceImpl.java

@@ -554,7 +554,7 @@ public class UserServiceImpl implements UserService {
         final boolean hasQuestion = !CollectionUtils.isEmpty(user.getQuestions());
         try {
             // 同步信息到im
-            String imId = syncUserToIm(user, noEncryPwd);
+            String imId = syncUserToIm(user, noEncryPwd, msg);
             user.setImId(imId);
             user = userDao.save(user);
         } catch (Exception e) {
@@ -590,7 +590,7 @@ public class UserServiceImpl implements UserService {
         return user;
     }
 
-    private String syncUserToIm(User user, String noEncryPwd) throws Exception {
+    private String syncUserToIm(User user, String noEncryPwd, String msg) throws Exception {
         String appId = "im";
         App app = appService.findOne(appId);
         if (!StringUtils.isEmpty(app.getBackUserUrl())) {
@@ -606,7 +606,8 @@ public class UserServiceImpl implements UserService {
             formData.put("dialectUID", user.getImId());
             res = HttpUtil.doPost(url, formData, 10000);
             if (!res.isSuccess()) {
-               throw new Exception(res.getContent());
+                syncLog.error(appId, msg + ",同步用户信息失败", formData.toString(), res.getContent());
+                throw new Exception(res.getContent());
             } else {
                 JSONObject obj = JSON.parseObject(res.getContent());
                 return String.valueOf(obj.get("dialectUID"));