Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
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
Commit
c9064de6
authored
Sep 20, 2024
by
liuzhifei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ratio must gte 0
parent
05db6660
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
common/group-ratio.go
+1
-1
web/src/pages/Setting/Operation/SettingsMagnification.js
+5
-3
No files found.
common/group-ratio.go
View file @
c9064de6
...
@@ -35,7 +35,7 @@ func GetGroupRatio(name string) float64 {
...
@@ -35,7 +35,7 @@ func GetGroupRatio(name string) float64 {
func
CheckGroupRatio
(
jsonStr
string
)
error
{
func
CheckGroupRatio
(
jsonStr
string
)
error
{
checkGroupRatio
:=
make
(
map
[
string
]
float64
)
checkGroupRatio
:=
make
(
map
[
string
]
float64
)
err
:=
json
.
Unmarshal
([]
byte
(
jsonStr
),
&
GroupRatio
)
err
:=
json
.
Unmarshal
([]
byte
(
jsonStr
),
&
check
GroupRatio
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
web/src/pages/Setting/Operation/SettingsMagnification.js
View file @
c9064de6
...
@@ -51,14 +51,16 @@ export default function SettingsMagnification(props) {
...
@@ -51,14 +51,16 @@ export default function SettingsMagnification(props) {
return
showError
(
'部分保存失败,请重试'
);
return
showError
(
'部分保存失败,请重试'
);
}
}
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
if
(
!
res
[
i
].
success
)
{
if
(
!
res
[
i
].
data
.
success
)
{
return
showError
(
res
[
i
].
message
)
return
showError
(
res
[
i
].
data
.
message
)
}
}
}
}
showSuccess
(
'保存成功'
);
showSuccess
(
'保存成功'
);
props
.
refresh
();
props
.
refresh
();
})
})
.
catch
(()
=>
{
.
catch
(
error
=>
{
console
.
error
(
'Unexpected error in Promise.all:'
,
error
);
showError
(
'保存失败,请重试'
);
showError
(
'保存失败,请重试'
);
})
})
.
finally
(()
=>
{
.
finally
(()
=>
{
...
...
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