Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
b5aa9d24
authored
Dec 18, 2024
by
山野羡民
Committed by
Gitee
Dec 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
防御性编程,规避服务端children返回的不是数组时…… update src/utils/tree.ts.
Signed-off-by: 山野羡民 <liyujiang_tk@yeah.net>
parent
e891a4bf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/utils/tree.ts
+3
-0
No files found.
src/utils/tree.ts
View file @
b5aa9d24
...
@@ -376,6 +376,9 @@ export const treeToString = (tree: any[], nodeId) => {
...
@@ -376,6 +376,9 @@ export const treeToString = (tree: any[], nodeId) => {
let
str
=
''
let
str
=
''
function
performAThoroughValidation
(
arr
)
{
function
performAThoroughValidation
(
arr
)
{
if
(
typeof
arr
===
'undefined'
||
!
Array
.
isArray
(
arr
)
||
arr
.
length
===
0
)
{
return
false
}
for
(
const
item
of
arr
)
{
for
(
const
item
of
arr
)
{
if
(
item
.
id
===
nodeId
)
{
if
(
item
.
id
===
nodeId
)
{
str
+=
` /
${
item
.
name
}
`
str
+=
` /
${
item
.
name
}
`
...
...
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