Browse Source

用户视图添加密码强度和是否有密保字段

wangmh 7 years ago
parent
commit
bc3afbca40

+ 26 - 0
sso-common/src/main/java/com/uas/sso/entity/UserView.java

@@ -75,6 +75,16 @@ public class UserView implements Serializable {
      */
     private Short identityValidCode;
 
+    /**
+     * 密码登录
+     */
+    private int passwordLevel;
+
+    /**
+     * 密码登录
+     */
+    private boolean hasQuestion;
+
     /**
      * 用户身份认证状态
      */
@@ -201,6 +211,22 @@ public class UserView implements Serializable {
         this.identityValidCode = identityValidCode;
     }
 
+    public int getPasswordLevel() {
+        return passwordLevel;
+    }
+
+    public void setPasswordLevel(int passwordLevel) {
+        this.passwordLevel = passwordLevel;
+    }
+
+    public boolean isHasQuestion() {
+        return hasQuestion;
+    }
+
+    public void setHasQuestion(boolean hasQuestion) {
+        this.hasQuestion = hasQuestion;
+    }
+
     public Short getLock() {
         return lock;
     }

+ 2 - 1
sso-server/src/main/java/com/uas/sso/service/impl/UserServiceImpl.java

@@ -522,7 +522,7 @@ public class UserServiceImpl implements UserService {
      */
     private User syncUserInfo(User user, String noEncryPwd, final String msg) {
         List<String> apps = appService.findUid();
-
+        final boolean hasQuestion = user.getQuestions() != null;
         try {
             // 同步信息到im
             String imId = syncUserToIm(user, noEncryPwd);
@@ -542,6 +542,7 @@ public class UserServiceImpl implements UserService {
                     String url = tempApp.getBackUserUrl();
                     JSONObject formData = JSON.parseObject(JSON.toJSONString(finalUser));
                     formData.put("password", finalUser.getPassword());
+                    formData.put("hasQuestion", hasQuestion);
                     HttpUtil.ResponseWrap res = null;
                     try {
                         res = HttpUtil.doPost(url, formData, 30000);