文件名从 src/main/java/com/lf/server/service/data/TokenService.java 修改 |
| | |
| | | package com.lf.server.service.data; |
| | | package com.lf.server.service.sys; |
| | | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.data.LoginEntity; |
| | | import com.lf.server.entity.data.TokenEntity; |
| | | import com.lf.server.entity.data.UsersEntity; |
| | | import com.lf.server.entity.sys.RedisCacheKey; |
| | | import com.lf.server.entity.sys.LoginEntity; |
| | | import com.lf.server.entity.sys.TokenEntity; |
| | | import com.lf.server.entity.sys.UsersEntity; |
| | | import com.lf.server.entity.all.RedisCacheKey; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.mapper.data.TokenMapper; |
| | | import com.lf.server.service.sys.RedisService; |
| | | import com.lf.server.mapper.sys.TokenMapper; |
| | | import com.lf.server.service.all.RedisService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | |
| | | } |
| | | |
| | | // 娓呴櫎Cookie WebHelper.saveCookie(StaticData.TOKEN_COOKIE_KEY, "", 60, res) |
| | | WebHelper.deleteCookie(StaticData.TOKEN_COOKIE_KEY, req, res); |
| | | WebHelper.deleteAll(req, res); |
| | | |
| | | // 鑾峰彇褰撳墠鐢ㄦ埛 |
| | | UsersEntity ue = getCurrentUser(req); |
| | |
| | | redisService.put(tokenKey, te, te.getDuration(), TimeUnit.MINUTES); |
| | | |
| | | String userKey = RedisCacheKey.signUserKey(te.getToken()); |
| | | ue.setBak(StringHelper.YMDHMS_FORMAT.format(new Date())); |
| | | redisService.put(userKey, ue, te.getDuration(), TimeUnit.MINUTES); |
| | | } |
| | | |