{"record":{"id":"9ec456c47992d59a","repo":"jeecgboot/JeecgBoot","slug":"error-9ec456","errorCode":null,"errorMessage":"账号已被锁定,请联系管理员!","messagePattern":"账号已被锁定,请联系管理员!","errorType":"exception","errorClass":"JeecgBoot401Exception","httpStatus":401,"severity":"error","filePath":"jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/TokenUtils.java","lineNumber":120,"sourceCode":"        if (StringUtils.isBlank(token)) {\n            throw new JeecgBoot401Exception(\"token不能为空!\");\n        }\n\n        // 解密获得username，用于和数据库进行对比\n        String username = JwtUtil.getUsername(token);\n        if (username == null) {\n            throw new JeecgBoot401Exception(\"token非法无效!\");\n        }\n\n        // 查询用户信息\n        LoginUser user = TokenUtils.getLoginUser(username, commonApi, redisUtil);\n        //LoginUser user = commonApi.getUserByName(username);\n        if (user == null) {\n            throw new JeecgBoot401Exception(\"用户不存在!\");\n        }\n        // 判断用户状态\n        if (user.getStatus() != 1) {\n            throw new JeecgBoot401Exception(\"账号已被锁定,请联系管理员!\");\n        }\n        // 校验token是否超时失效 & 或者账号密码是否错误\n        if (!jwtTokenRefresh(token, username, user.getPassword(), redisUtil)) {\n            // 用户登录Token过期提示信息\n            String userLoginTokenErrorMsg = oConvertUtils.getString(redisUtil.get(CommonConstant.PREFIX_USER_TOKEN_ERROR_MSG + token));\n            throw new JeecgBoot401Exception(oConvertUtils.isEmpty(userLoginTokenErrorMsg)? CommonConstant.TOKEN_IS_INVALID_MSG: userLoginTokenErrorMsg);\n        }\n        return true;\n    }\n\n    /**\n     * 刷新token（保证用户在线操作不掉线）\n     * @param token\n     * @param userName\n     * @param passWord\n     * @param redisUtil\n     * @return\n     */","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/TokenUtils.java#L102-L138","documentation":"Thrown by TokenUtils.verifyToken when the looked-up user's status field is not 1. In JeecgBoot sys_user.status: 1 = normal, 2 = disabled/locked by an admin. Returns HTTP 401. It intentionally rejects still-valid JWTs when the account has been administratively frozen.","triggerScenarios":"An admin set the user's status to 2 (frozen) in the user-management screen; the user exceeded failed-login attempts and was auto-locked; or a compliance action disabled the account while the user held an active token.","commonSituations":"Security lockout after repeated wrong passwords; offboarding disabled the account but the user's tab is still open; manual DB update of status without notifying the user.","solutions":["An administrator must re-enable the account (set sys_user.status back to 1) in the user management UI.","If a failed-login lockout policy caused it, wait the configured lock window or have an admin unlock.","Clear the client token so it stops hammering the API with a now-invalid credential.","Audit why the account was locked to rule out a compromise."],"exampleFix":"-- before: account locked\nUPDATE sys_user SET status = 2 WHERE username = 'jdoe';\n\n-- after: admin re-enables\nUPDATE sys_user SET status = 1 WHERE username = 'jdoe';","handlingStrategy":"try-catch","validationCode":"// admin-only check before relying on a token\nLoginUser u = TokenUtils.getLoginUser(username, commonApi, redisUtil);\nif (u == null || u.getStatus() != 1) { /* locked: stop and prompt contact-admin */ }","typeGuard":"public static boolean accountActive(LoginUser u){ return u != null && Integer.valueOf(1).equals(u.getStatus()); }","tryCatchPattern":"try { TokenUtils.verifyToken(token, ...); }\ncatch (JeecgBoot401Exception e) { if (e.getMessage().contains(\"锁定\")) showLockedNotice(); }","preventionTips":["Build an admin unlock flow paired with the lock policy.","Notify users when their account is administratively disabled.","Audit status changes."],"tags":["authentication","authorization","account-management","jeecg-boot","http-401"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}