From bf765893039bc7968b8160a70bda778526dca98c Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期二, 31 十二月 2024 15:28:19 +0800 Subject: [PATCH] 定时任务 --- applet/src/main/java/com/jilongda/applet/utils/LoginInfoUtil.java | 60 +++++++++++++----------------------------------------------- 1 files changed, 13 insertions(+), 47 deletions(-) diff --git a/applet/src/main/java/com/jilongda/applet/utils/LoginInfoUtil.java b/applet/src/main/java/com/jilongda/applet/utils/LoginInfoUtil.java index 78225f4..fc4e046 100644 --- a/applet/src/main/java/com/jilongda/applet/utils/LoginInfoUtil.java +++ b/applet/src/main/java/com/jilongda/applet/utils/LoginInfoUtil.java @@ -1,17 +1,8 @@ package com.jilongda.applet.utils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.jilongda.applet.model.SecUser; -import com.jilongda.applet.service.SecUserService; -import com.jilongda.applet.service.TUserService; -import com.jilongda.common.model.TUser; -import com.jilongda.common.security.JwtTokenUtils; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.jilongda.applet.service.TUserService; -import com.jilongda.common.model.TUser; -import com.jilongda.common.security.JwtTokenUtils; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.jilongda.applet.service.TUserService; +import com.jilongda.applet.model.TAppUser; +import com.jilongda.applet.service.TAppUserService; import com.jilongda.common.model.TUser; import com.jilongda.common.security.JwtTokenUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -21,44 +12,19 @@ public class LoginInfoUtil { @Autowired - private TUserService tUserService; - - @Autowired - private SecUserService secUserService; + private TAppUserService appUserService; - - - - public Long getUserId1(){ - String username = JwtTokenUtils.getUsername(); - TUser userName = tUserService.getOne(new QueryWrapper<TUser>().eq("userName", username).eq("isDelete",0)); - return userName.getId(); - - } - public Long getUserId(){ - String username = JwtTokenUtils.getUsername(); - SecUser userName = secUserService.getOne(new QueryWrapper<SecUser>().eq("phone", username).eq("isDelete",0)); - return userName.getId(); - - } - public SecUser getLoginUserByPhone(){ - String username = JwtTokenUtils.getUsername(); - SecUser tUser = secUserService.getOne(new QueryWrapper<SecUser>().eq("phone", username).eq("isDelete",0)); - return tUser; + public Integer getUserId(){ +// String username = JwtTokenUtils.getUsername(); +// TAppUser appUser = appUserService.getOne(new QueryWrapper<TAppUser>().eq("openId", username).eq("isDelete",0)); + return 1; } - public SecUser getLoginUser(){ + public TAppUser getLoginUser(){ String username = JwtTokenUtils.getUsername(); - SecUser secUser = secUserService.getOne(new QueryWrapper<SecUser>().eq("phone", username).eq("isDelete",0)); - return secUser; - } - - public Integer getUserType(){ - String username = JwtTokenUtils.getUsername(); - SecUser userName = secUserService.getOne(new QueryWrapper<SecUser>().eq("phone", username).eq("isDelete",0)); - return userName.getUserType(); - + TAppUser TAppUser = appUserService.getOne(new QueryWrapper<TAppUser>().eq("openId", username).eq("isDelete",0)); + return TAppUser; } /** @@ -70,13 +36,13 @@ */ public void logoff(){ String username = JwtTokenUtils.getUsername(); - SecUser userName = secUserService.getOne(new QueryWrapper<SecUser>().eq("phone", username).eq("isDelete",0)); + TAppUser userName = appUserService.getOne(new QueryWrapper<TAppUser>().eq("openId", username).eq("isDelete",0)); userName.setIsDelete(true); - secUserService.saveOrUpdate(userName); + appUserService.saveOrUpdate(userName); } public Boolean checkPhoneExits(String phone){ - SecUser userName = secUserService.getOne(new QueryWrapper<SecUser>().eq("phone", phone).eq("isDelete",0)); + TAppUser userName = appUserService.getOne(new QueryWrapper<TAppUser>().eq("openId", phone).eq("isDelete",0)); if(userName!=null){ return true; }else{ -- Gitblit v1.7.1