获取角色
This commit is contained in:
@@ -11,6 +11,8 @@ public interface LogInfo {
|
||||
|
||||
String UNKNOWN_USER = "unknown user";
|
||||
|
||||
String UNKNOWN_ROLE = "unknown role";
|
||||
|
||||
String UNKNOWN_IP = "unknown IP";
|
||||
|
||||
String UNKNOWN_CLIENT = "unknown client";
|
||||
|
||||
@@ -217,6 +217,18 @@ public class RequestUtil {
|
||||
}
|
||||
return userIndex;
|
||||
}
|
||||
/**
|
||||
* HttpServletRequest获取在网关中存储的用户角色
|
||||
*/
|
||||
public static String getUserRole() {
|
||||
String userIndex = LogInfo.UNKNOWN_ROLE;
|
||||
JSONObject jwtPayload = getJwtPayload();
|
||||
if (Objects.nonNull(jwtPayload)) {
|
||||
userIndex = jwtPayload.getString(SecurityConstants.JWT_AUTHORITIES_KEY);
|
||||
}
|
||||
return userIndex;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HttpServletRequest获取在网关中存储的部门索引
|
||||
|
||||
@@ -82,7 +82,7 @@ public class CommonServiceImpl implements CommonService {
|
||||
.or("line_id",lineIds)
|
||||
.eq("phasic_type",phasic)
|
||||
.between("time", startTime, endTime)
|
||||
.eq("value_type",dataType).groupBy("line_id");
|
||||
.eq("value_type",dataType);
|
||||
return commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user