|
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import com.chelvc.framework.base.util.HttpUtils;
|
|
|
import com.chelvc.framework.common.model.Platform;
|
|
|
import com.chelvc.framework.common.model.Terminal;
|
|
|
+import com.chelvc.framework.common.util.ObjectUtils;
|
|
|
import com.chelvc.framework.common.util.StringUtils;
|
|
|
import com.google.common.collect.Sets;
|
|
|
import lombok.NonNull;
|
|
@@ -37,19 +38,14 @@ public class DefaultSessionFactory implements SessionFactory {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取使用类别
|
|
|
- *
|
|
|
- * @param request Http请求对象
|
|
|
- * @return 使用类别
|
|
|
- */
|
|
|
protected Using getUsing(@NonNull HttpServletRequest request) {
|
|
|
+ Using using = null;
|
|
|
try {
|
|
|
- return StringUtils.ifEmpty(request.getHeader(SessionContextHolder.HEADER_USING), Using::valueOf);
|
|
|
+ using = StringUtils.ifEmpty(request.getHeader(SessionContextHolder.HEADER_USING), Using::valueOf);
|
|
|
} catch (Exception e) {
|
|
|
log.warn("Using convert failed: {}", e.getMessage());
|
|
|
}
|
|
|
- return null;
|
|
|
+ return ObjectUtils.ifNull(using, Using.NORMAL);
|
|
|
}
|
|
|
|
|
|
/**
|