@@ -16,6 +16,10 @@ public class JsonResult<T> implements Serializable { | |||
* 成功 | |||
*/ | |||
public static final int SUCCESS = 0; | |||
/** | |||
* 专用 | |||
*/ | |||
public static final int OIDC_ERROR = -2; | |||
/** | |||
* 失败 |
@@ -43,6 +43,7 @@ public class SecurityUserUtils { | |||
public static String token() { | |||
// header中获取用户token | |||
check(); | |||
String token = ServletUtils.getRequest().getHeader("th-token"); | |||
if (StringUtils.isEmpty(token)) { | |||
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "token不能为空"); | |||
@@ -57,6 +58,7 @@ public class SecurityUserUtils { | |||
*/ | |||
public static String username() { | |||
// header中获取用户token | |||
check(); | |||
String oUserJson = ServletUtils.getRequest().getHeader("o-user-json"); | |||
if (StringUtils.isEmpty(oUserJson)) { | |||
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "oUserJson不能为空"); | |||
@@ -67,4 +69,20 @@ public class SecurityUserUtils { | |||
return username; | |||
} | |||
public static void check() { | |||
String oUserJson = ServletUtils.getRequest().getHeader("o-user-json"); | |||
String json = EncryptUtil.decodeUTF8StringBase64(oUserJson); | |||
JSONObject jsonObject = JSON.parseObject(json); | |||
Integer isAble = jsonObject.getInteger("isAble"); | |||
Integer isExpire = jsonObject.getInteger("isExpire"); | |||
if (StringUtils.isNotNull(isAble) && StringUtils.isNotNull(isExpire)) { | |||
if (0 == isAble) { | |||
throw new ServiceException(JsonResult.OIDC_ERROR, "该账号已被禁用,请联系系统管理员"); | |||
} | |||
if (0 == isExpire) { | |||
throw new ServiceException(JsonResult.OIDC_ERROR, "系统有效期已过,请联系系统管理员"); | |||
} | |||
} | |||
} | |||
} |
@@ -22,37 +22,37 @@ public interface SystemConstant { | |||
/** | |||
* 机场平台:获取机场列表接口 | |||
*/ | |||
String API_AIRPORT_LIST = "/api/airportInterface/airportList"; | |||
String API_AIRPORT_LIST = "/airportInterface/airportList"; | |||
/** | |||
* 机场平台:获取机场路线列表接口 | |||
*/ | |||
String API_AIRPORT_LINE_LIST = "/api/airportInterface/taskByDroneId"; | |||
String API_AIRPORT_LINE_LIST = "/airportInterface/taskByDroneId"; | |||
/** | |||
* 机场平台:执行接口 | |||
*/ | |||
String API_AIRPORT_EXECUTE_TASK = "/api/airportInterface/executeTaskAnsy"; | |||
String API_AIRPORT_EXECUTE_TASK = "/airportInterface/executeTaskAnsy"; | |||
/** | |||
* 机场平台:定点飞行 | |||
*/ | |||
String API_AIRPORT_POINT_FLIGH = "/api/airportInterface/createPointLine"; | |||
String API_AIRPORT_POINT_FLIGH = "/airportInterface/createPointLine"; | |||
/** | |||
* 机场平台:获取天气 | |||
*/ | |||
String API_AIRPORT_GET_WEATHER = "/api/airportInterface/getWeather"; | |||
String API_AIRPORT_GET_WEATHER = "/airportInterface/getWeather"; | |||
/** | |||
* 机场平台:控制无人机 | |||
*/ | |||
String API_AIRPORT_DRONE_CONTROL = "/api/airportInterface/droneCommand"; | |||
String API_AIRPORT_DRONE_CONTROL = "/airportInterface/droneCommand"; | |||
/** | |||
* 机场平台:获取机场状态 | |||
*/ | |||
String API_AIRPORT_STATUS_BY_AIRPORT_ID = "/api/airportInterface/getAirportStatusByAirportId"; | |||
String API_AIRPORT_STATUS_BY_AIRPORT_ID = "/airportInterface/getAirportStatusByAirportId"; | |||
// 飞手平台不同接口url | |||
/** |
@@ -144,8 +144,7 @@ tuoheng: | |||
#飞手平台地址 | |||
pilot-url: http://192.168.11.11:7011/pilot/web/ | |||
#airport配置地址 | |||
#airport-url: http://192.168.11.22:9060 | |||
airport-url: https://airport-test.t-aaron.com | |||
airport-url: http://192.168.11.22:9060/api | |||
# 文件配置 | |||
uploads: | |||
#上传的服务器上的映射文件夹 |
@@ -150,7 +150,7 @@ tuoheng: | |||
#飞手平台地址 | |||
pilot-url: http://192.168.11.241:7011/pilot/web/ | |||
#airport配置地址 | |||
airport-url: http://192.168.11.22:9060 | |||
airport-url: http://192.168.11.22:9060/api | |||
# 文件配置 | |||
uploads: | |||
#上传的服务器上的映射文件夹 |
@@ -145,7 +145,7 @@ tuoheng: | |||
#飞手平台地址 | |||
pilot-url: https://pilot.t-aaron.com/pilot/web/ | |||
#airport配置地址 | |||
airport-url: https://airport.t-aaron.com | |||
airport-url: https://airport.t-aaron.com/api | |||
# 文件配置 | |||
uploads: | |||
#上传的服务器上的映射文件夹 |
@@ -145,7 +145,7 @@ tuoheng: | |||
#飞手平台地址 | |||
pilot-url: http://172.15.1.11:7011/pilot/web/ | |||
#airport配置地址 | |||
airport-url: https://airport-test.t-aaron.com | |||
airport-url: https://airport-test.t-aaron.com/airport/admin | |||
# 文件配置 | |||
uploads: | |||
#上传的服务器上的映射文件夹 |