Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-editor
Project
Project
Details
Activity
Releases
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
劳工
zeroing-editor
Commits
aa5b8c8c
Commit
aa5b8c8c
authored
Nov 20, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加服务端列表出错的容错
parent
fa98b350
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
env.js
src/store/modules/env.js
+12
-3
No files found.
src/store/modules/env.js
View file @
aa5b8c8c
...
...
@@ -22,8 +22,8 @@ export const envStore = {
mutations
:
{
updateEnv
(
state
,
env
)
{
Object
.
assign
(
state
,
env
);
parseItem
(
state
.
processes
);
parseItem
(
state
.
scripts
);
state
.
processes
=
parseItem
(
state
.
processes
);
state
.
scripts
=
parseItem
(
state
.
scripts
);
state
.
initialized
=
true
;
},
...
...
@@ -90,7 +90,16 @@ function groupProcesses(processes, filterFunc) {
}
function
parseItem
(
list
)
{
let
hasError
,
result
=
[];
for
(
let
i
=
0
,
li
=
list
.
length
;
i
<
li
;
i
++
)
{
list
[
i
]
=
JSON
.
parse
(
list
[
i
].
data
);
try
{
result
.
push
(
JSON
.
parse
(
list
[
i
].
data
));
}
catch
(
e
)
{
hasError
=
true
;
}
}
if
(
hasError
)
{
console
.
warn
(
'parse env error'
);
}
return
result
;
}
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