This commit is contained in:
qingjiao 2026-04-18 17:54:13 +08:00
parent 1eeca994ab
commit 34a9cadc02
7 changed files with 59 additions and 5 deletions

1
git Normal file
View File

@ -0,0 +1 @@
git commit -m "20260418" --no-verify

View File

@ -109,7 +109,7 @@
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
"pre-commit": ""
}
},
"repository": {

View File

@ -193,7 +193,9 @@ export default {
httpPort: 'HTTP Port',
webPort: 'Web Port',
rtspPort: 'RTSP Port',
rtpPort: 'RTP Port'
rtpPort: 'RTP Port',
portConflict: ' Conflict',
PortNumbersCannotBeTheSame: 'The ports cannot be the same'
},
theme: {
change: 'Change Theme',

View File

@ -193,7 +193,9 @@ export default {
httpPort: 'Porta HTTP',
webPort: 'Porta WEB',
rtspPort: 'Porta RTSP',
rtpPort: 'Porta RTP'
rtpPort: 'Porta RTP',
portConflict: ' Conflito',
PortNumbersCannotBeTheSame: 'As portas não podem ser iguais'
},
theme: {
change: 'Mudar Tema',

View File

@ -185,7 +185,9 @@ export default {
httpPort: 'http端口',
webPort: 'Web端口',
rtspPort: 'RTSP端口',
rtpPort: 'RTP端口'
rtpPort: 'RTP端口',
portConflict: ' 冲突',
PortNumbersCannotBeTheSame: '端口号不能相同'
},
theme: {
change: '换肤',

View File

@ -423,6 +423,53 @@ export default {
const portRegex = /^(1\d{4}|[2-4]\d{4}|49999)$/
const portRegex2 = /^(?:[2-9]\d{0,3}|1\d{0,3}|9999)$/
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
const ports = [
this.formHTTPData.webPort,
this.formHTTPData.httpPort,
this.formONVIFData.onvifPort,
this.formONVIFData.rtspPort,
this.formONVIFData.rtpPort
]
console.log('ports', ports)
// 使 HashMap - O(n)
const portNames = ['webPort', 'httpPort', 'onvifPort', 'rtspPort', 'rtpPort']
const portMap = new Map()
const conflicts = []
for (let i = 0; i < ports.length; i++) {
const portValue = Number(ports[i])
//
if (ports[i] === '' || ports[i] === null || ports[i] === undefined || isNaN(portValue)) {
continue
}
//
if (portMap.has(portValue)) {
const existingPort = portMap.get(portValue)
conflicts.push({
port1: { name: existingPort.name, value: existingPort.value, index: existingPort.index },
port2: { name: portNames[i], value: ports[i], index: i }
})
} else {
// Map
portMap.set(portValue, { name: portNames[i], value: ports[i], index: i })
}
}
//
if (conflicts.length > 0) {
const conflictMessages = conflicts.map(item =>
`${item.port1.name}(${item.port1.value}) & ${item.port2.name}(${item.port2.value})`
)
this.$message({
type: 'warning',
message: this.$i18n.t('table.PortNumbersCannotBeTheSame') + ' : ' + conflictMessages.join(', ')
})
return
}
if (this.selectIndex === '0') {
param = {
...this.formUDPData

View File

@ -87,7 +87,7 @@ module.exports = {
// before: require('./mock/mock-server.js'),
proxy: {
'/dev-api': {
target: 'http://127.0.0.1:8080', // http://127.0.0.1:8080
target: 'http://192.168.1.190:8080', // http://127.0.0.1:8080
secure: true, // 如果是https接口需要配置这个参数
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
pathRewrite: { '^/dev-api': '' }