|
|
@@ -116,7 +116,8 @@ public enum KymCache {
|
|
|
* @return
|
|
|
*/
|
|
|
public String getParkingQrCodeUrlByStationId(String stationId) {
|
|
|
- return KymCacheInjector.redisTemplate.opsForValue().get(RedisKeys.STATION_ID_TO_PARKING_QR_CODE_URL + stationId);
|
|
|
+ var url = KymCacheInjector.redisTemplate.opsForValue().get(RedisKeys.STATION_ID_TO_PARKING_QR_CODE_URL + stationId);
|
|
|
+ return cleanNullBytes(url);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -223,7 +224,20 @@ public enum KymCache {
|
|
|
}
|
|
|
|
|
|
public String getParkingCouponUrl(String code) {
|
|
|
- return KymCacheInjector.redisTemplate.opsForValue().get(RedisKeys.PARKING_COUPON_CODE + code);
|
|
|
+ var url = KymCacheInjector.redisTemplate.opsForValue().get(RedisKeys.PARKING_COUPON_CODE + code);
|
|
|
+ return cleanNullBytes(url);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static String cleanNullBytes(String value) {
|
|
|
+ if (value == null || value.isEmpty()) {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ // 移除 NULL 字节及其之前的所有垃圾数据,只保留有效 URL
|
|
|
+ int idx = value.indexOf("http");
|
|
|
+ if (idx > 0) {
|
|
|
+ return value.substring(idx);
|
|
|
+ }
|
|
|
+ return value;
|
|
|
}
|
|
|
|
|
|
|