hjl
2024-06-19 ee0ef084a9750338a118ac577af679e8549444da
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
@@ -493,10 +493,29 @@
        loginUserParent.setName(tUser1.getName());
        loginUserParent.setUserid(tUser1.getId());
        loginUserParent.setPhone(tUser1.getPhone());
        loginUserParent.setLoginTime(new Date().getTime());
        loginUserParent.setLoginTime(System.currentTimeMillis());
        HashMap<String, Object> map = new HashMap<>();
        map.put("token", tokenService.createToken1(loginUserParent));
        // 获取登录token
        map.put("token", tokenService.createToken1(loginUserParent));
        // 学习进度检查
        TUserStudy userStudy = userStudyService.lambdaQuery().eq(TUserStudy::getUserId, tUser1.getId())
                .eq(TUserStudy::getDisabled, 0).one();
        if (null == userStudy) {
            TUserStudy study = new TUserStudy();
            study.setUserId(tUser1.getId());
            study.setWeek(Constants.ONE);
            study.setDay(Constants.ONE);
            study.setTotalStudy(Constants.ZERO);
            study.setTodayStudy(Constants.ZERO);
            study.setWeekStudy(Constants.ZERO);
            study.setMonthStudy(Constants.ZERO);
            study.setListen(Constants.BURDEN_ONE);
            study.setLook(Constants.BURDEN_ONE);
            study.setInduction(Constants.BURDEN_ONE);
            study.setAnswer(Constants.BURDEN_ONE);
            study.setPair(Constants.BURDEN_ONE);
            userStudyService.save(study);
        }
        return R.ok(map);
    }