Browse Source

添加用户认证状态的筛选

huxz 7 years ago
parent
commit
46993177fc

+ 2 - 2
sso-manage-console-web/config/index.js

@@ -17,11 +17,11 @@ module.exports = {
     proxyTable: {
       // proxy all backend requests to backend server
       '/api': {
-        target: 'http://localhost:8090',
+        target: 'http://localhost:8082',
         changeOrigin: true
       },
       '/login': {
-        target: 'http://localhost:8090',
+        target: 'http://localhost:8082',
         changeOrigin: true
       }
     },

+ 1 - 1
sso-manage-console-web/index.html

@@ -3,7 +3,7 @@
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <title>sso-manage-console-web</title>
+    <title>账户中心管理后台</title>
   </head>
   <body>
     <div id="app"></div>

+ 14 - 0
sso-manage-console-web/src/components/accounts/users/UserHome.vue

@@ -21,6 +21,17 @@
           </el-option>
         </el-select>
 
+        <!-- 身份认证状态 -->
+        <label>用户认证状态</label>
+        <el-select v-model="pageParams.identityValidCode" clearable placeholder="不限" @change="handleRefreshData">
+          <el-option
+            v-for="item in identityValidCodeOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+
         <!-- 手机认证状态 -->
         <label>手机认证状态</label>
         <el-select v-model="pageParams.mobileValidCode" clearable placeholder="不限" @change="handleRefreshData">
@@ -191,12 +202,14 @@
           size: 8,
           fromApp: null,
           mobileValidCode: null,
+          identityValidCode: null,
           key: 'vipName',
           keyword: null
         },
         pageContent: [],
         total: 0,
         mobileValidCodeOptions: ValidCode,
+        identityValidCodeOptions: ValidCode,
         searchKeys: searchKeys,
         isAddNewUser: false,
         newUserInfo: {}
@@ -240,6 +253,7 @@
         this.fetchData()
       },
       handleRefreshData () {
+        console.log('我要刷新数据')
         console.log(this.pageParams)
         this.fetchData()
       },

+ 2 - 1
sso-manage-console/src/main/java/com/uas/sso/sso/backend/api/UserManageController.java

@@ -39,11 +39,12 @@ public class UserManageController {
     public ResultBean<org.springframework.data.domain.Page<User>> showUserByPagination(Pageable page,
             @RequestParam(required = false) String fromApp,
             @RequestParam(required = false) Short mobileValidCode,
+            @RequestParam(required = false) Short identityValidCode,
             @RequestParam(required = false) String key,
             @RequestParam(required = false) String keyword) {
         // Controller中的Pageable类型参数默认根据查询参数 page 和 size 注入并实例化
         return new ResultBean<>(
-                userBackendService.showUserByPagination(page, fromApp, mobileValidCode, key, keyword));
+                userBackendService.showUserByPagination(page, fromApp, mobileValidCode, identityValidCode, key, keyword));
     }
 
     @RequestMapping(method = RequestMethod.GET, path = "//showEnUserByPagination",

+ 4 - 3
sso-manage-console/src/main/java/com/uas/sso/sso/backend/service/UserBackendService.java

@@ -21,13 +21,14 @@ public interface UserBackendService {
      *
      * @param page  分页参数
      * @param fromApp   注册来源
-     * @param mobileValidCode   收集认证状态
+     * @param identityValidCode 用户认证状态
+     * @param mobileValidCode   手机认证状态
      * @param key   搜索字段
      * @param keyword   搜索关键字
      * @return  获取用户分页数据
      */
-    Page<User> showUserByPagination(Pageable page, String fromApp, Short mobileValidCode, String key,
-            String keyword);
+    Page<User> showUserByPagination(Pageable page, String fromApp, Short mobileValidCode, Short identityValidCode, String key,
+                                    String keyword);
 
     /**
      * 分页获取企业用户信息.

+ 7 - 2
sso-manage-console/src/main/java/com/uas/sso/sso/backend/service/impl/UserBackendServiceImpl.java

@@ -65,8 +65,8 @@ public class UserBackendServiceImpl implements UserBackendService {
     }
 
     @Override
-    public Page<User> showUserByPagination(Pageable page, String fromApp, Short mobileValidCode,
-            String key, String keyword) {
+    public Page<User> showUserByPagination(Pageable page, String fromApp, Short mobileValidCode, Short identityValidCode,
+                                           String key, String keyword) {
 
         return userDao.findAll(new Specification<User>() {
             @Override
@@ -83,6 +83,11 @@ public class UserBackendServiceImpl implements UserBackendService {
                     predicates.add(predicate);
                 }
 
+                if (identityValidCode != null) {
+                    Predicate predicate = builder.equal(root.get("identityValidCode"), identityValidCode);
+                    predicates.add(predicate);
+                }
+
                 if ("userUU".equals(key) && !StringUtils.isEmpty(keyword)) {
                     Predicate predicate = builder.equal(root.get(key), keyword);
                     predicates.add(predicate);