mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-21 01:36:37 +08:00
fix: update user quote (close #161)
This commit is contained in:
parent
87919b032d
commit
5ce8e6dab6
@ -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
|
||||||
|
@ -223,13 +223,6 @@ const EditUser = (props) => {
|
|||||||
placeholder='此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
|
placeholder='此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
<Input
|
|
||||||
name='telegram_id'
|
|
||||||
value={telegram_id}
|
|
||||||
autoComplete='new-password'
|
|
||||||
placeholder='此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
|
|
||||||
readonly
|
|
||||||
/>
|
|
||||||
<div style={{ marginTop: 20 }}>
|
<div style={{ marginTop: 20 }}>
|
||||||
<Typography.Text>已绑定的邮箱账户</Typography.Text>
|
<Typography.Text>已绑定的邮箱账户</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
@ -240,6 +233,16 @@ const EditUser = (props) => {
|
|||||||
placeholder='此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
|
placeholder='此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
|
<div style={{ marginTop: 20 }}>
|
||||||
|
<Typography.Text>已绑定的Telegram账户</Typography.Text>
|
||||||
|
</div>
|
||||||
|
<Input
|
||||||
|
name='telegram_id'
|
||||||
|
value={telegram_id}
|
||||||
|
autoComplete='new-password'
|
||||||
|
placeholder='此项只读,需要用户通过个人设置页面的相关绑定按钮进行绑定,不可直接修改'
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
</Spin>
|
</Spin>
|
||||||
</SideSheet>
|
</SideSheet>
|
||||||
</>
|
</>
|
||||||
|
Loading…
Reference in New Issue
Block a user