Skip to content

使用token+username作为key把当前时间戳也存入redis #1

@xm5646

Description

@xm5646

使用token+username作为key把当前时间戳也存入redis
这一步主要用来判断用户登录的token是否快要过期了, 如果直接使用redis的查看剩余时间的API, 就不需要这么做了吧?

/**
* 根据指定key 查看剩余存活时间
* @param key
* @return
*/
public Long getFreeTime(String key) { return redisTemplate.getExpire(key);}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions