wzy
2022-10-09 99091a8cbb8e098575c75a7c640b568addbcc29d
zq-erp/src/main/java/com/matrix/system/common/init/UserCacheManager.java
@@ -7,11 +7,13 @@
 */
package com.matrix.system.common.init;
import com.alibaba.fastjson.TypeReference;
import com.matrix.core.constance.SystemErrorCode;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.UUIDUtil;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.hive.bean.SysVipInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@@ -44,7 +46,7 @@
    public boolean isUserLogin() {
        String token = getUserToken();
        if (StringUtils.isNotBlank(token)) {
            return LocalCache.get(token) != null;
            return LocalCache.get(token,new TypeReference<String>(){}) != null;
        } else {
            return false;
        }
@@ -92,7 +94,7 @@
    public <T> T getLoginUser() {
        String userToken = getUserToken();
        if (userToken != null) {
            T user = LocalCache.get(userToken);
            T user = LocalCache.get(userToken,new TypeReference<SysVipInfo>(){});
            if (Objects.nonNull(user)) {
                //重新设置key过期时间
                LocalCache.resetExpire(userToken);