Compare commits

..

1 Commits

Author SHA1 Message Date
樊冲
5a4cc57b1b
Pre Merge pull request !42 from 樊冲/fix-bug-fanchong 2025-11-20 09:29:24 +00:00
19 changed files with 45 additions and 368 deletions

View File

@ -138,7 +138,7 @@ public class SIPCommanderForPlatform implements ISIPCommanderForPlatform {
@Override
public String keepalive(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws SipException, InvalidArgumentException, ParseException {
log.info("[国标级联] 发送心跳, 上级平台 {}/{}", parentPlatform.getName(), parentPlatform.getServerGBId());
log.info("[国标级联] 发送心跳, 上级平台编号 {}", parentPlatform.getServerGBId());
String characterSet = parentPlatform.getCharacterSet();
StringBuffer keepaliveXml = new StringBuffer(200);
keepaliveXml.append("<?xml version=\"1.0\" encoding=\"")

View File

@ -55,11 +55,7 @@ public class CachedBodyHttpServletRequest extends HttpServletRequestWrapper {
return "";
}
}
if (cachedBody != null) {
cachedBodyString = new String(cachedBody, StandardCharsets.UTF_8);
} else {
cachedBodyString = "";
}
cachedBodyString = new String(cachedBody, StandardCharsets.UTF_8);
}
return cachedBodyString;
}
@ -76,7 +72,7 @@ public class CachedBodyHttpServletRequest extends HttpServletRequestWrapper {
return new byte[0];
}
}
return cachedBody != null ? cachedBody : new byte[0];
return cachedBody;
}
private void cacheInputStream() throws IOException {
@ -90,9 +86,6 @@ public class CachedBodyHttpServletRequest extends HttpServletRequestWrapper {
}
cachedBody = baos.toByteArray();
log.debug("成功缓存请求体,长度: {}", cachedBody.length);
} catch (Exception e) {
log.error("缓存请求体时发生异常: ", e);
cachedBody = new byte[0];
}
}
@ -103,8 +96,7 @@ public class CachedBodyHttpServletRequest extends HttpServletRequestWrapper {
private final ByteArrayInputStream inputStream;
public CachedBodyServletInputStream(byte[] body) {
// 处理null值情况
this.inputStream = new ByteArrayInputStream(body != null ? body : new byte[0]);
this.inputStream = new ByteArrayInputStream(body);
}
@Override
@ -127,4 +119,7 @@ public class CachedBodyHttpServletRequest extends HttpServletRequestWrapper {
return inputStream.read();
}
}
}
}

View File

@ -66,9 +66,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
out.close();
return;
}
// 添加空值检查
if (SyTokenManager.INSTANCE.appMap == null || SyTokenManager.INSTANCE.appMap.get(appKey) == null) {
if (SyTokenManager.INSTANCE.appMap.get(appKey) == null) {
log.info("[SY-接口验签] appKey {} 对应的 secret 不存在, 请求地址: {} ", appKey, requestURI);
response.setStatus(Response.OK);
PrintWriter out = response.getWriter();
@ -88,16 +86,11 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
if (paramKey.equals("sign")) {
continue;
}
// 添加数组长度检查
String[] values = parameterMap.get(paramKey);
if (values != null && values.length > 0) {
beforeSign.append(paramKey).append(values[0]);
}
beforeSign.append(paramKey).append(parameterMap.get(paramKey)[0]);
}
// 如果是post请求的json消息拼接body字符串
if (request.getContentLength() > 0
&& request.getMethod().equalsIgnoreCase("POST")
&& request.getContentType() != null
&& request.getContentType().equalsIgnoreCase(MediaType.APPLICATION_JSON_VALUE)) {
// 读取body内容 - 使用自定义缓存机制
String requestBody = request.getCachedBody();
@ -108,19 +101,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
log.warn("[SY-接口验签] 请求体内容为空");
}
}
// 添加空值检查
String secret = SyTokenManager.INSTANCE.appMap.get(appKey);
if (secret == null) {
log.info("[SY-接口验签] 无法获取appKey {} 对应的 secret, 请求地址: {} ", appKey, requestURI);
response.setStatus(Response.OK);
PrintWriter out = response.getWriter();
out.println(getErrorResult(1, "参数非法"));
out.close();
return;
}
beforeSign.append(secret);
beforeSign.append(SyTokenManager.INSTANCE.appMap.get(appKey));
// 生成签名
String buildSign = SmUtil.sm3(beforeSign.toString());
if (!buildSign.equals(sign)) {
@ -134,15 +115,6 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
// 验证请求时间戳
long timestamp = Long.parseLong(timestampStr);
long currentTimeMillis = System.currentTimeMillis();
// 添加空值检查
if (SyTokenManager.INSTANCE.expires == null) {
log.info("[SY-接口验签] expires配置为空, 请求地址: {} ", requestURI);
response.setStatus(Response.OK);
PrintWriter out = response.getWriter();
out.println(getErrorResult(2, "签名错误"));
out.close();
return;
}
if (currentTimeMillis > SyTokenManager.INSTANCE.expires * 60 * 1000 + timestamp ) {
log.info("[SY-接口验签] 时间戳已经过期, 请求时间戳:{} 当前时间: {}, 过期时间: {}, 请求地址: {} ", timestamp, currentTimeMillis, timestamp + SyTokenManager.INSTANCE.expires * 60 * 1000, requestURI);
response.setStatus(Response.OK);
@ -152,29 +124,11 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
return;
}
// accessToken校验
// 添加空值检查
if (SyTokenManager.INSTANCE.adminToken == null) {
log.info("[SY-接口验签] adminToken配置为空, 请求地址: {} ", requestURI);
response.setStatus(Response.OK);
PrintWriter out = response.getWriter();
out.println(getErrorResult(2, "签名错误"));
out.close();
return;
}
if (accessToken.equals(SyTokenManager.INSTANCE.adminToken)) {
log.info("[SY-接口验签] adminToken已经默认放行, 请求地址: {} ", requestURI);
chain.doFilter(request, response);
return;
}else {
// 添加空值检查
if (SyTokenManager.INSTANCE.sm4Key == null) {
log.info("[SY-接口验签] sm4Key配置为空, 请求地址: {} ", requestURI);
response.setStatus(Response.OK);
PrintWriter out = response.getWriter();
out.println(getErrorResult(2, "签名错误"));
out.close();
return;
}
// 对token进行解密
SM4 sm4 = SmUtil.sm4(HexUtil.decodeHex(SyTokenManager.INSTANCE.sm4Key));
String decryptStr = sm4.decryptStr(accessToken, CharsetUtil.CHARSET_UTF_8);
@ -188,7 +142,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
}
JSONObject jsonObject = JSON.parseObject(decryptStr);
Long expirationTime = jsonObject.getLong("expirationTime");
if (expirationTime == null || expirationTime < System.currentTimeMillis()) {
if (expirationTime < System.currentTimeMillis()) {
log.info("[SY-接口验签] accessToken 已经过期, 请求地址: {} ", requestURI);
response.setStatus(Response.OK);
PrintWriter out = response.getWriter();
@ -197,17 +151,8 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
return;
}
}
}catch (NumberFormatException e) {
log.info("[SY-接口验签] 时间戳格式错误, 请求地址: {} ", requestURI);
response.setStatus(Response.OK);
if (!response.isCommitted()) {
PrintWriter out = response.getWriter();
out.println(getErrorResult(2, "签名错误"));
out.close();
}
return;
}catch (Exception e) {
log.info("[SY-接口验签] 读取body失败, 请求地址: {} ", requestURI, e);
log.info("[SY-接口验签] 读取body失败, 请求地址: {} ", requestURI, e);
response.setStatus(Response.OK);
if (!response.isCommitted()) {
PrintWriter out = response.getWriter();
@ -226,4 +171,4 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
return JSON.toJSONString(wvpResult);
}
}
}

View File

@ -316,15 +316,7 @@ export default {
setTimeout(() => {
this.initData()
}, 1000)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
}).finally(() => {
itemData.playLoading = false
})
},

View File

@ -333,15 +333,7 @@ export default {
message: '保存成功'
})
this.$emit('submitSuccess')
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
}).finally(() => {
this.loading = false
})
} else {
@ -354,15 +346,7 @@ export default {
if (this.saveSuccess) {
this.saveSuccess()
}
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
}).finally(() => {
this.loading = false
})
}
@ -387,15 +371,9 @@ export default {
message: '重置成功 已保存'
})
this.getCommonChannel(this.form.gbId)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
}).catch((error) => {
console.error(error)
}).finally(() => {
this.loading = false
})
}).catch(() => {
@ -415,13 +393,6 @@ export default {
this.getPaths()
this.getRegionPaths()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.loading = false
})

View File

@ -373,13 +373,6 @@ export default {
node.parent.expand()
this.$emit('onChannelChange', node.data.deviceId)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
},
addChannelFormDevice: function(id, node) {
this.$refs.gbDeviceSelect.openDialog((rows) => {
@ -400,15 +393,7 @@ export default {
this.$emit('onChannelChange', node.data.deviceId)
node.loaded = false
node.expand()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
}).finally(() => {
this.loading = false
})
})
@ -428,15 +413,7 @@ export default {
this.$emit('onChannelChange', node.data.deviceId)
node.loaded = false
node.expand()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
}).finally(() => {
this.loading = false
})
})

View File

@ -73,13 +73,6 @@ export default {
}
this.initMap()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
},
initMap(){
let center = fromLonLat([116.41020, 39.915119])

View File

@ -119,6 +119,7 @@ import VueEasyTree from '@wchbrad/vue-easy-tree'
import regionEdit from './../dialog/regionEdit'
import gbDeviceSelect from './../dialog/GbDeviceSelect'
import GbChannelSelect from '../dialog/GbChannelSelect.vue'
import chooseCivilCode from '@/views/dialog/chooseCivilCode.vue'
export default {
name: 'DeviceTree',
@ -198,7 +199,6 @@ export default {
})
},
loadNode: function(node, resolve) {
console.log(22222)
if (node.level === 0) {
resolve([{
treeId: '',
@ -364,13 +364,8 @@ export default {
this.$emit('onChannelChange', node.data.deviceId)
node.parent.loaded = false
node.parent.expand()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
}).catch(function(error) {
console.log(error)
})
},
addChannelFormDevice: function(id, node) {

View File

@ -602,13 +602,6 @@ export default {
this.startBroadcast(streamInfo.rtc)
}
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
} else if (this.broadcastStatus === 1) {
this.broadcastStatus = -1
this.broadcastRtc.close()
@ -697,13 +690,6 @@ export default {
this.broadcastRtc.close()
this.broadcastStatus = -1
this.$store.dispatch('play/broadcastStop', [this.channelId])
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
}
}
}

View File

@ -236,13 +236,7 @@ export default {
}).then((data) => {
this.total = data.total
this.deviceList = data.list
}).catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
}).finally(() => {
}).finally(() => {
this.getDeviceListLoading = false
})
},
@ -262,13 +256,6 @@ export default {
.then((data) => {
this.getDeviceList()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
})
},
showChannelList: function(row) {
@ -297,15 +284,7 @@ export default {
this.$refs.syncChannelProgress.openDialog(itemData.deviceId, () => {
this.getDeviceList()
})
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
}).finally(() => {
this.getDeviceList()
})
},

View File

@ -63,12 +63,8 @@ export default {
})
this.jtChannel = data
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
.catch(function(error) {
console.log(error)
})
} else {
this.$store.dispatch('jtDevice/addChannel', this.jtChannel)
@ -80,12 +76,8 @@ export default {
})
this.jtChannel = data
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
.catch(function(error) {
console.log(error)
})
}
},

View File

@ -234,12 +234,8 @@ export default {
this.initData()
}, 1000)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
.catch(err => {
console.error(err)
})
.finally(() => {
this.isLoging = false
@ -270,12 +266,8 @@ export default {
.then((data) => {
this.initData()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
.catch(function(error) {
console.error(error)
})
},
getSnap: function(row) {
@ -310,12 +302,8 @@ export default {
},
updateChannel: function(row) {
this.$store.dispatch('jtDevice/updateChannel', row)
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
.catch((e) => {
console.log(e)
})
},
refresh: function() {

View File

@ -256,13 +256,6 @@ export default {
.then(data => {
this.getList()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
}).catch(() => {
})
@ -337,13 +330,6 @@ export default {
this.serverId = data.addOn.serverId
this.$refs.configInfo.openDialog(data, 'jt1078Config')
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
},
queryAttribute: function(itemData) {
this.$store.dispatch('jtDevice/queryAttribute', itemData.phoneNumber)

View File

@ -116,16 +116,9 @@ export default {
this.$store.dispatch('user/login', this.loginForm).then((re) => {
this.$router.push({ path: this.redirect || '/' })
this.loading = false
}).catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.loading = false
})
}).catch(() => {
this.loading = false
})
} else {
console.log('error submit!!')
return false

View File

@ -242,13 +242,6 @@ export default {
.then(data => {
this.play(data)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
}
},
{
@ -260,13 +253,6 @@ export default {
.then(data => {
this.editPosition(data)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
}
},
{
@ -278,13 +264,6 @@ export default {
.then(data => {
this.edit(data)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
}
}
]
@ -366,15 +345,7 @@ export default {
streamInfo: data,
hasAudio: channel.hasAudio
})
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
}).finally(() => {
loading.close()
})
},
@ -473,13 +444,6 @@ export default {
this.$refs.deviceTree.refresh('channel' + channel.gbId)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
},
showDrawThinBox: function(show){
this.showDrawThin = show
@ -489,13 +453,6 @@ export default {
if (this.drawThinId !== null) {
//
this.$store.dispatch('commonChanel/clearThin', this.drawThinId)
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
this.drawThinId = null
}
if (this.drawThinLayer !== null) {
@ -539,13 +496,6 @@ export default {
this.showDrawThinLayer(drawThinId)
})
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.quicklyDrawThinLoading = false
})
@ -606,13 +556,6 @@ export default {
this.showDrawThinLayer(drawThinId)
})
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.boxDrawThinLoading = false
})
@ -647,13 +590,6 @@ export default {
})
this.showDrawThinBox(false)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.saveDrawThinLoading = false
})
@ -671,13 +607,6 @@ export default {
message: '数据还原成功'
})
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
})
}
}

View File

@ -158,11 +158,7 @@ export default {
this.initData()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
console.error(error)
})
}).catch(() => {

View File

@ -243,11 +243,7 @@ export default {
})
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
console.log(error)
})
.finally(() => {
row.playLoading = false
@ -262,11 +258,7 @@ export default {
})
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
console.log(error)
})
},
queryCloudRecords: function(row) {
@ -286,13 +278,6 @@ export default {
})
this.initData()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
}).catch(() => {
})
},

View File

@ -244,13 +244,6 @@ export default {
hasAudio: true
})
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
row.playLoading = false
})
@ -270,13 +263,6 @@ export default {
})
this.initData()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
}).catch(() => {
})
@ -313,13 +299,6 @@ export default {
this.initData()
this.$refs.pushListTable.clearSelection()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
}).catch(() => {
})

View File

@ -145,11 +145,7 @@ export default {
this.getUserList()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
console.error(error)
})
}).catch(() => {