Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
bc92c32b
Commit
bc92c32b
authored
Jan 03, 2025
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复视频地址设置加密导致的bug
parent
eb47f50e
Pipeline
#95073
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
AddModal.jsx
src/pages/platformCenter/videoManager/AddModal.jsx
+13
-18
No files found.
src/pages/platformCenter/videoManager/AddModal.jsx
View file @
bc92c32b
...
...
@@ -134,14 +134,6 @@ const AddModal = props => {
}
});
};
const
returnVideoListArr
=
(
str
,
serialNum
,
numStr
)
=>
{
let
_arr
=
numStr
.
split
(
','
);
return
_arr
.
map
((
item
,
index
)
=>
{
return
str
.
replace
(
new
RegExp
(
`\/
${
serialNum
}
_\\d_\\d\\.((flv)|(m3u8))`
),
(
match
)
=>
{
return
match
.
replace
(
/_
\d
_/
,
`_
${
item
}
_`
);
})
})
}
const
getVideoUrl
=
()
=>
{
let
_values
=
form
.
getFieldsValue
();
const
{
EquipmentNumber
,
LoginName
,
LoginPwd
,
PassageId
}
=
_values
;
...
...
@@ -156,20 +148,23 @@ const AddModal = props => {
getYSYVideoSource
({
deviceSerial
:
_values
.
EquipmentNumber
,
// 设备序列号
appKey
:
_values
.
LoginName
,
appSecret
:
_values
.
LoginPwd
,
channelNo
:
_
NO
,
protocol
:
'2,4'
// 2是hls,直播流;4是flv,是轻应用
appSecret
:
_values
?.
LoginPwd
?.
length
===
32
?
_values
?.
LoginPwd
:
Decrypt
(
_values
.
LoginPwd
)
,
channelNo
:
_
values
?.
PassageId
,
protocol
:
'2,4'
,
// 2是hls,直播流;4是flv,是轻应用
}).
then
(
res
=>
{
if
(
!
res
?.
getMe
?.
length
)
return
message
.
warning
(
'无法获取视频链接,请前往萤石云确认设备是否在线、配置是否正确有效!'
)
let
flv
Str
=
''
;
let
hls
Str
=
''
;
let
flv
Arr
=
[]
;
let
hls
Arr
=
[]
;
res
.
getMe
.
forEach
((
item
)
=>
{
if
(
item
.
protocol
===
2
)
hlsStr
=
item
?.
liveAddress
?.[
0
];
if
(
item
.
protocol
===
4
)
flvStr
=
item
?.
liveAddress
?.[
0
];
if
(
item
.
protocol
===
2
)
hlsArr
=
item
?.
liveAddress
??
[];
if
(
item
.
protocol
===
4
)
flvArr
=
item
?.
liveAddress
??
[];
});
form
.
setFieldsValue
({
...
obj
,
LoginPwd
:
obj
.
LoginPwd
?
Decrypt
(
obj
.
LoginPwd
)
:
''
,
'VideoPath'
:
flvArr
.
join
(
','
),
'HLSPath'
:
hlsArr
.
join
(
','
)
});
let
_flv
=
returnVideoListArr
(
flvStr
,
EquipmentNumber
,
PassageId
);
let
_hls
=
returnVideoListArr
(
hlsStr
,
EquipmentNumber
,
PassageId
);
form
.
setFieldsValue
({...
obj
,
'VideoPath'
:
_flv
.
join
(
','
),
'HLSPath'
:
_hls
.
join
(
','
)});
}).
catch
(
err
=>
{
if
(
err
.
message
.
includes
(
'Request failed with status code 404'
))
return
message
.
warning
(
'当前平台无法自动获取萤石云视频,如有需要,请联系管理员!'
);
message
.
warning
(
'萤石云网络波动,获取失败。请重试或前往萤石云平台手动获取!'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment