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
f18a83c1
authored
Apr 03, 2024
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update user quote (close #161)
parent
a8433823
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
model/user.go
+2
-1
web/src/pages/User/EditUser.js
+8
-5
No files found.
model/user.go
View file @
f18a83c1
...
@@ -225,10 +225,11 @@ func (user *User) Update(updatePassword bool) error {
...
@@ -225,10 +225,11 @@ func (user *User) Update(updatePassword bool) error {
}
}
newUser
:=
*
user
newUser
:=
*
user
DB
.
First
(
&
user
,
user
.
Id
)
DB
.
First
(
&
user
,
user
.
Id
)
err
=
DB
.
Model
(
user
)
.
Updates
(
newUser
)
.
Error
err
=
DB
.
Model
(
user
)
.
Select
(
"*"
)
.
Updates
(
newUser
)
.
Error
if
err
==
nil
{
if
err
==
nil
{
if
common
.
RedisEnabled
{
if
common
.
RedisEnabled
{
_
=
common
.
RedisSet
(
fmt
.
Sprintf
(
"user_group:%d"
,
user
.
Id
),
user
.
Group
,
time
.
Duration
(
UserId2GroupCacheSeconds
)
*
time
.
Second
)
_
=
common
.
RedisSet
(
fmt
.
Sprintf
(
"user_group:%d"
,
user
.
Id
),
user
.
Group
,
time
.
Duration
(
UserId2GroupCacheSeconds
)
*
time
.
Second
)
_
=
common
.
RedisSet
(
fmt
.
Sprintf
(
"user_quota:%d"
,
user
.
Id
),
strconv
.
Itoa
(
user
.
Quota
),
time
.
Duration
(
UserId2QuotaCacheSeconds
)
*
time
.
Second
)
}
}
}
}
return
err
return
err
...
...
web/src/pages/User/EditUser.js
View file @
f18a83c1
...
@@ -223,19 +223,22 @@ const EditUser = (props) => {
...
@@ -223,19 +223,22 @@ const EditUser = (props) => {
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
readonly
readonly
/>
/>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Typography
.
Text
>
已绑定的邮箱账户
<
/Typography.Text
>
<
/div
>
<
Input
<
Input
name
=
'
telegram_id
'
name
=
'
email
'
value
=
{
telegram_id
}
value
=
{
email
}
autoComplete
=
'new-password'
autoComplete
=
'new-password'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
readonly
readonly
/>
/>
<
div
style
=
{{
marginTop
:
20
}}
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Typography
.
Text
>
已绑定的
邮箱
账户
<
/Typography.Text
>
<
Typography
.
Text
>
已绑定的
Telegram
账户
<
/Typography.Text
>
<
/div
>
<
/div
>
<
Input
<
Input
name
=
'
email
'
name
=
'
telegram_id
'
value
=
{
email
}
value
=
{
telegram_id
}
autoComplete
=
'new-password'
autoComplete
=
'new-password'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
placeholder
=
'此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
readonly
readonly
...
...
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