whyclxw
2025-05-28 e16302f9d475c7cc4dd18c5abf1a23cb5502e362
src/main/java/com/whyc/controller/UserController.java
@@ -91,17 +91,17 @@
    @GetMapping("/searchUNameToUKey")
    @ApiOperation(value = "根据用户名查绑定的Ukey")
    public Response getUserByUserName(@RequestParam String uKeyId){
        UserInf userInf = userService.getUserByUKeyId(uKeyId);
    public Response getUserByUserName(@RequestParam String userName){
        UserInf userInf = userService.getUserByUserName(userName);
        Response response = new Response();
        if (userInf!=null){
            if (StringUtils.isEmpty(userInf.getUkeyId())){
                response.set(0,"该用户没有绑定Ukey");
                response.set(-1,false,"该用户没有绑定Ukey");
            }else {
                response.set(1,userInf);
                response.setII(1,true,userInf,"该用户有绑定Ukey");
            }
        }else{
            response.set(0,"该用户不存在");
            response.set(0,false,"该用户不存在");
        }
        return response;
    }
@@ -159,7 +159,6 @@
        String passwordEncrypt = oldPwd;
        String password = RSAUtil.decryptFront(passwordEncrypt, RSAUtil.fontSeparator)[0];
        String passwordDB = RSAUtil.decrypt(userInf.getUpassword(),RSAUtil.getPrivateKey());
        if(passwordDB.equals(password)){
            return userService.updatePasswordByRSA(userInf,newPwd);
        }else {
@@ -181,6 +180,12 @@
        return userService.updatePasswordByRSA(userInf,password);
    }
    @GetMapping("updatePasswordByValidity")
    @ApiOperation(value = "修改密码-密码失效")
    public Response updatePasswordByValidity(@RequestParam String uname,@RequestParam String oldPwd,@RequestParam String newPwd) throws UnsupportedEncodingException {
        return userService.updatePasswordByValidity(uname,oldPwd,newPwd);
    }
    /**
     * 1.首次登录,请先修改初始化口令
     * 2.超过3个月没有修改口令,请修改口令后重新登录