| | |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.mapper.sys.TokenMapper; |
| | | import com.lf.server.service.all.PermsService; |
| | | import com.lf.server.service.all.RedisService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | LoginService loginService; |
| | | |
| | | @Autowired |
| | | public RedisService redisService; |
| | | |
| | | @Autowired |
| | | public PermsService permsService; |
| | | RedisService redisService; |
| | | |
| | | @Override |
| | | public Integer selectCount(String name, Integer type) { |
| | |
| | | /** |
| | | * 获取新的令牌实体类 |
| | | */ |
| | | public TokenEntity getNewToken(int userid, HttpServletRequest req) { |
| | | public TokenEntity getNewToken(UserEntity ue, HttpServletRequest req) { |
| | | TokenEntity te = new TokenEntity(); |
| | | te.setToken(WebHelper.getGuid()); |
| | | te.setDuration(SettingData.TOKEN_EXPIRE); |
| | | te.setExpire(WebHelper.getTimestamp(SettingData.TOKEN_EXPIRE)); |
| | | te.setType(0); |
| | | te.setIp(WebHelper.getIpAddress(req)); |
| | | te.setCreateUser(userid); |
| | | te.setCreateUser(ue.getId()); |
| | | te.setUname(ue.getUname()); |
| | | |
| | | return te; |
| | | } |