Commit 076cda82df4b97db185f1fa5d9a346931dd7a8ff
1 parent
0109100b
edge游览器兼容问题,大客流记录接口和图片放行url
Showing
6 changed files
with
63 additions
and
3 deletions
src/main/java/com/bsth/common/Constants.java
| @@ -48,6 +48,8 @@ public class Constants { | @@ -48,6 +48,8 @@ public class Constants { | ||
| 48 | public static final String OUT_URL = "/out/**"; | 48 | public static final String OUT_URL = "/out/**"; |
| 49 | public static final String DIFYINTER_URL = "/difyinter/**"; | 49 | public static final String DIFYINTER_URL = "/difyinter/**"; |
| 50 | public static final String NOTICE_URL = "/notice/**"; | 50 | public static final String NOTICE_URL = "/notice/**"; |
| 51 | + | ||
| 52 | + public static final String PROFILE = "/profile/**"; | ||
| 51 | /** | 53 | /** |
| 52 | * 解除调度指令和班次的外键约束 | 54 | * 解除调度指令和班次的外键约束 |
| 53 | */ | 55 | */ |
src/main/java/com/bsth/data/zndd/OutEntrance.java
| @@ -13,6 +13,7 @@ import com.bsth.entity.zndd.StationSignsLogger; | @@ -13,6 +13,7 @@ import com.bsth.entity.zndd.StationSignsLogger; | ||
| 13 | import com.bsth.entity.zndd.znddStatus; | 13 | import com.bsth.entity.zndd.znddStatus; |
| 14 | import com.bsth.repository.zndd.ZnddStatusRepository; | 14 | import com.bsth.repository.zndd.ZnddStatusRepository; |
| 15 | import com.bsth.service.DKLInfoService; | 15 | import com.bsth.service.DKLInfoService; |
| 16 | +import com.bsth.util.DateUtils; | ||
| 16 | import com.bsth.util.HttpClientUtils; | 17 | import com.bsth.util.HttpClientUtils; |
| 17 | import com.bsth.util.SignUtils; | 18 | import com.bsth.util.SignUtils; |
| 18 | import com.bsth.websocket.handler.SendUtils; | 19 | import com.bsth.websocket.handler.SendUtils; |
| @@ -367,7 +368,22 @@ public class OutEntrance { | @@ -367,7 +368,22 @@ public class OutEntrance { | ||
| 367 | return rtn; | 368 | return rtn; |
| 368 | } | 369 | } |
| 369 | 370 | ||
| 371 | + @RequestMapping(value="/dklinfoList",method = RequestMethod.GET) | ||
| 372 | + public Map dklinfoList(@RequestBody Map nmap){ | ||
| 370 | 373 | ||
| 374 | + Map m = new HashMap(); | ||
| 375 | + Map map = new HashMap(); | ||
| 376 | + String date = nmap.get("date").toString(); | ||
| 377 | + if(!SignUtils.validation(Long.parseLong(nmap.get("timestamp").toString()),nmap.get("sign").toString())){ | ||
| 378 | + map.put("status", "验证失败"); | ||
| 379 | + return map; | ||
| 380 | + } | ||
| 381 | + m.put("createDate_ge",date); | ||
| 382 | + m.put("createDate_le", DateUtils.yit_date(date)); | ||
| 383 | + map.put("status",ResponseCode.SUCCESS); | ||
| 384 | + map.put("date",(List<DKLInfo>) dklInfoService.list(m)); | ||
| 385 | + return map; | ||
| 386 | + } | ||
| 371 | 387 | ||
| 372 | 388 | ||
| 373 | /** | 389 | /** |
src/main/java/com/bsth/filter/BaseFilter.java
| @@ -20,7 +20,7 @@ public abstract class BaseFilter implements Filter { | @@ -20,7 +20,7 @@ public abstract class BaseFilter implements Filter { | ||
| 20 | Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, | 20 | Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, |
| 21 | Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS, Constants.UP_RFID_URL, | 21 | Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS, Constants.UP_RFID_URL, |
| 22 | Constants.STATION_AND_SECTION_COUNT, Constants.ACTUATOR_MANAGEMENT_HEALTH, Constants.VEHICLE_DATA_SYNC_URL, | 22 | Constants.STATION_AND_SECTION_COUNT, Constants.ACTUATOR_MANAGEMENT_HEALTH, Constants.VEHICLE_DATA_SYNC_URL, |
| 23 | - Constants.FILE_AUTH,Constants.OUT_URL,Constants.NOTICE_URL,Constants.DIFYINTER_URL}; | 23 | + Constants.FILE_AUTH,Constants.OUT_URL,Constants.NOTICE_URL,Constants.DIFYINTER_URL,Constants.PROFILE}; |
| 24 | 24 | ||
| 25 | @Override | 25 | @Override |
| 26 | public void destroy() { | 26 | public void destroy() { |
src/main/java/com/bsth/security/WebSecurityConfig.java
| @@ -38,7 +38,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | @@ -38,7 +38,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 38 | public void configure(WebSecurity web) throws Exception { | 38 | public void configure(WebSecurity web) throws Exception { |
| 39 | // 白名单 | 39 | // 白名单 |
| 40 | web.ignoring().antMatchers(Constants.LOGIN_PAGE, Constants.LOGIN, Constants.ORIGINAL_LOGIN_PAGE, Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.CAPTCHA, | 40 | web.ignoring().antMatchers(Constants.LOGIN_PAGE, Constants.LOGIN, Constants.ORIGINAL_LOGIN_PAGE, Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.CAPTCHA, |
| 41 | - Constants.SERVICE_INTERFACE, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, | 41 | + Constants.PROFILE,Constants.SERVICE_INTERFACE, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, |
| 42 | Constants.UP_RFID_URL, Constants.STATION_AND_SECTION_COUNT, Constants.FILE_AUTH,Constants.OUT_URL,Constants.NOTICE_URL,Constants.DIFYINTER_URL); | 42 | Constants.UP_RFID_URL, Constants.STATION_AND_SECTION_COUNT, Constants.FILE_AUTH,Constants.OUT_URL,Constants.NOTICE_URL,Constants.DIFYINTER_URL); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| @@ -70,6 +70,10 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | @@ -70,6 +70,10 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 70 | .expiredUrl(Constants.LOGIN_PAGE + "?error=true") | 70 | .expiredUrl(Constants.LOGIN_PAGE + "?error=true") |
| 71 | .maxSessionsPreventsLogin(false)//让之前的登录过期 | 71 | .maxSessionsPreventsLogin(false)//让之前的登录过期 |
| 72 | .sessionRegistry(sessionRegistry()); | 72 | .sessionRegistry(sessionRegistry()); |
| 73 | + //edge游览器地图和轨迹播放不行的问题 | ||
| 74 | + http.headers().contentSecurityPolicy( | ||
| 75 | + "script-src 'unsafe-inline' 'unsafe-eval' http: https:; worker-src blob:;" | ||
| 76 | + ); | ||
| 73 | 77 | ||
| 74 | http.addFilterBefore(new LoginInterceptor(), FilterSecurityInterceptor.class); | 78 | http.addFilterBefore(new LoginInterceptor(), FilterSecurityInterceptor.class); |
| 75 | http.addFilter(filterSecurityInterceptor()); | 79 | http.addFilter(filterSecurityInterceptor()); |
src/main/java/com/bsth/security/filter/LoginInterceptor.java
| @@ -35,7 +35,8 @@ public class LoginInterceptor implements Filter { | @@ -35,7 +35,8 @@ public class LoginInterceptor implements Filter { | ||
| 35 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.ORIGINAL_LOGIN_PAGE, Constants.SERVICE_INTERFACE, | 35 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.ORIGINAL_LOGIN_PAGE, Constants.SERVICE_INTERFACE, |
| 36 | Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.LOGIN, | 36 | Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.LOGIN, |
| 37 | Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.UP_RFID_URL, | 37 | Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.UP_RFID_URL, |
| 38 | - Constants.STATION_AND_SECTION_COUNT, Constants.VEHICLE_DATA_SYNC_URL, Constants.FILE_AUTH ,Constants.OUT_URL,Constants.NOTICE_URL,Constants.DIFYINTER_URL}; | 38 | + Constants.STATION_AND_SECTION_COUNT, Constants.VEHICLE_DATA_SYNC_URL, Constants.FILE_AUTH ,Constants.OUT_URL, |
| 39 | + Constants.NOTICE_URL,Constants.DIFYINTER_URL,Constants.PROFILE}; | ||
| 39 | 40 | ||
| 40 | 41 | ||
| 41 | @Override | 42 | @Override |
src/main/java/com/bsth/util/DateUtils.java
| @@ -170,4 +170,41 @@ public class DateUtils { | @@ -170,4 +170,41 @@ public class DateUtils { | ||
| 170 | } | 170 | } |
| 171 | return rq; | 171 | return rq; |
| 172 | } | 172 | } |
| 173 | + | ||
| 174 | + //后一天 | ||
| 175 | + public static String yit_date(String dateStr) { | ||
| 176 | + | ||
| 177 | + // 创建SimpleDateFormat对象,指定日期格式 | ||
| 178 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 179 | + | ||
| 180 | + try { | ||
| 181 | + // 解析日期字符串为Date对象 | ||
| 182 | + Date dateObj = sdf.parse(dateStr); | ||
| 183 | + | ||
| 184 | + // 创建Calendar对象,并将Date对象设置为时间 | ||
| 185 | + Calendar calendar = Calendar.getInstance(); | ||
| 186 | + calendar.setTime(dateObj); | ||
| 187 | + | ||
| 188 | + // 计算下一天的日期 | ||
| 189 | + calendar.add(Calendar.DAY_OF_MONTH, 1); | ||
| 190 | + | ||
| 191 | + // 获取下一天的Date对象 | ||
| 192 | + Date nextDayDate = calendar.getTime(); | ||
| 193 | + | ||
| 194 | + // 将下一天的Date对象格式化为字符串 | ||
| 195 | + String nextDayStr = sdf.format(nextDayDate); | ||
| 196 | + | ||
| 197 | + // 输出结果 | ||
| 198 | + System.out.println("给定日期: " + dateStr); | ||
| 199 | + System.out.println("下一天日期: " + nextDayStr); | ||
| 200 | + | ||
| 201 | + return nextDayStr; | ||
| 202 | + } catch (ParseException e) { | ||
| 203 | + // 解析日期字符串时发生异常 | ||
| 204 | + e.printStackTrace(); | ||
| 205 | + } | ||
| 206 | + return null; | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + | ||
| 173 | } | 210 | } |