Browse Source

同步移动端用户头像

huangct 8 years ago
parent
commit
37ad3b74df

+ 4 - 7
jpress-web-front/src/main/java/io/jpress/front/controller/CommentController.java

@@ -166,15 +166,12 @@ public class CommentController extends BaseFrontController {
 
 
 		comment.setUuUserId(uuUserId);
 		comment.setUuUserId(uuUserId);
 		comment.setUuUserAvatar(uuUserAvatar);
 		comment.setUuUserAvatar(uuUserAvatar);
+        //同步移动端用户头像
+        if (uuUserId != null && StringUtils.isNotBlank(uuUserAvatar) && !comment.isImageExist(uuUserAvatar)) {
+            comment.setUuUserAvatar(null);
+        }
 
 
 		if (comment.save()) {
 		if (comment.save()) {
-			//同步移动端用户头像
-			if (uuUserId != null && StringUtils.isNotBlank(uuUserAvatar) && comment.isImageExist(uuUserAvatar)) {
-				CommentQuery.me().updateAvaterById(uuUserId,uuUserAvatar);
-			} else if(StringUtils.isNotBlank(uuUserAvatar) && !comment.isImageExist(uuUserAvatar)){
-				comment.setUuUserAvatar(null);
-				comment.save();
-			}
 			ActionCacheManager.clearCache();
 			ActionCacheManager.clearCache();
 		}
 		}