Browse Source

1、账号过期后再次登录将状态变成锁定
2、查询条件点击时统一设定当前页1页数量10

xusl 1 năm trước cách đây
mục cha
commit
ba1ee57ac4

+ 1 - 0
backend/pom.xml

@@ -221,6 +221,7 @@
         </dependency>
     </dependencies>
     <build>
+        <finalName>ssi</finalName>
         <plugins>
             <!--跳过test类-->
             <plugin>

+ 30 - 3
backend/src/main/java/com/jiayue/ssi/filter/JwtAuthenticationTokenFilter.java

@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.jiayue.ssi.constant.CacheConstants;
 import com.jiayue.ssi.entity.SysUser;
+import com.jiayue.ssi.service.SysUserService;
 import com.jiayue.ssi.service.impl.UserServiceImpl;
 import com.jiayue.ssi.util.DateUtils;
 import com.jiayue.ssi.util.ResponseInfo;
@@ -38,10 +39,12 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
 
     UserServiceImpl userServiceImpl;
     JwtTokenUtil jwtTokenUtil;
+    SysUserService sysUserService;
 
-    public JwtAuthenticationTokenFilter(UserServiceImpl userServiceImpl, JwtTokenUtil jwtTokenUtil) {
+    public JwtAuthenticationTokenFilter(UserServiceImpl userServiceImpl, JwtTokenUtil jwtTokenUtil,SysUserService sysUserService) {
         this.userServiceImpl = userServiceImpl;
         this.jwtTokenUtil = jwtTokenUtil;
+        this.sysUserService = sysUserService;
     }
 
     @Override
@@ -76,7 +79,19 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
                     // 判断账号截止日期
                     Date lastDate = DateUtils.getDayLastTime(user.getExpDate());
                     if (new Date().after(lastDate)) {
-                        ResponseInfo.doResponse(response, "账号有效期已失效,请联系管理员!", 403);
+                        if ("0".equals(user.getStatus())){
+                            // 将正常状态变为锁定
+                            user.setLockTime(System.currentTimeMillis());
+                            user.setStatus("1");
+                            Boolean bo = sysUserService.updateUser(user);
+                            if (!bo){
+                                log.info(user.getUsername()+"账号已过有效期被锁定失败");
+                            }
+                            else{
+                                log.info(user.getUsername()+"账号已过有效期被锁定成功");
+                            }
+                        }
+                        ResponseInfo.doResponse(response, "账号已过有效期被锁定,请联系管理员!", 403);
                         return;
                     }
                 }
@@ -103,7 +118,19 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
                         // 判断账号截止日期
                         Date lastDate = DateUtils.getDayLastTime(user.getExpDate());
                         if (new Date().after(lastDate)) {
-                            ResponseInfo.doResponse(response, "账号有效期已失效,请联系管理员!", 403);
+                            if ("0".equals(user.getStatus())){
+                                // 将正常状态变为锁定
+                                user.setLockTime(System.currentTimeMillis());
+                                user.setStatus("1");
+                                Boolean bo = sysUserService.updateUser(user);
+                                if (!bo){
+                                    log.info(user.getUsername()+"账号已过有效期被锁定失败");
+                                }
+                                else{
+                                    log.info(user.getUsername()+"账号已过有效期被锁定成功");
+                                }
+                            }
+                            ResponseInfo.doResponse(response, "账号已过有效期被锁定,请联系管理员!", 403);
                             return;
                         }
                     }

+ 2 - 0
ui/src/views/auditManager/logininfo/index.vue

@@ -243,6 +243,8 @@ export default {
     },1000),
     /** 搜索按钮操作 */
     handleQuery() {
+      this.currentPage = 1
+      this.pageSize = 10
       this.getList();
     },
     /** 重置按钮操作 */

+ 2 - 0
ui/src/views/auditManager/operlog/index.vue

@@ -404,6 +404,8 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      this.currentPage = 1
+      this.pageSize = 10
       this.getList();
     },
     /** 重置按钮操作 */

+ 2 - 0
ui/src/views/bizManager/forecastPowerShortTerm/index.vue

@@ -226,6 +226,8 @@ export default {
       this.queryStartTime = this.startTime
       this.queryEndTime = this.endTime
       this.getDraw(this.queryStartTime,this.queryEndTime)
+      this.currentPage = 1
+      this.pageSize = 10
       this.getTable()
     },1000),
     Byresize(tab){

+ 2 - 0
ui/src/views/bizManager/nwp/index.vue

@@ -232,6 +232,8 @@ export default {
       this.queryStartTime = this.startTime
       this.queryEndTime = this.endTime
       this.getDraw(this.queryStartTime,this.queryEndTime)
+      this.currentPage = 1
+      this.pageSize = 10
       this.getTable()
     },1000),
     Byresize(tab){

+ 2 - 0
ui/src/views/examineManager/sysApprove/index.vue

@@ -230,6 +230,8 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery: debounce(function () {
+      this.currentPage = 1
+      this.pageSize = 10
       this.getList()
     }, 1000),
     handleApprove(row, val) {

+ 2 - 0
ui/src/views/sysManager/ipBlacklist/index.vue

@@ -182,6 +182,8 @@ export default {
           return
         }
       }
+      this.currentPage = 1
+      this.pageSize = 10
       this.getList();
     },1000),
     /** 重置按钮操作 */

+ 3 - 1
ui/src/views/sysManager/roleManager/index.vue

@@ -476,7 +476,9 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery: debounce(function () {
-      this.queryParams.pageNum = 1;
+      this.currentPage = 1
+      this.pageSize = 10
+      // this.queryParams.pageNum = 1;
       this.getList();
     }, 1000),
     /** 重置按钮操作 */

+ 2 - 0
ui/src/views/sysManager/sysParameter/index.vue

@@ -161,6 +161,8 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery:debounce(function(){
+      this.currentPage = 1
+      this.pageSize = 10
       this.getList()
     },1000),
     async getList(){

+ 2 - 0
ui/src/views/sysManager/userManager/index.vue

@@ -391,6 +391,8 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery: debounce(function () {
+      this.currentPage = 1
+      this.pageSize = 10
       this.getList()
     }, 1000),
     /** 查询用户列表 */