增加删除用户时也删除缓存中的授权信息

This commit is contained in:
dushixiang 2021-01-26 22:11:11 +08:00
parent d771ad6ab6
commit 661435f80a
3 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package api
import (
"github.com/labstack/echo/v4"
"next-terminal/pkg/global"
"next-terminal/pkg/model"
"next-terminal/pkg/utils"
"strconv"
@ -79,6 +80,7 @@ func UserDeleteEndpoint(c echo.Context) error {
}
if loginLogs != nil && len(loginLogs) > 0 {
for j := range loginLogs {
global.Cache.Delete(loginLogs[j].ID)
model.Logout(loginLogs[j].ID)
}
}

View File

@ -127,6 +127,7 @@ class LoginForm extends Component {
</Card>
<Modal title="双因素认证" visible={this.state.totpModalVisible} confirmLoading={this.state.confirmLoading}
maskClosable={false}
onOk={() => {
this.formRef.current
.validateFields()

View File

@ -609,6 +609,7 @@ class User extends Component {
this.state.changePasswordVisible ?
<Modal title="修改密码" visible={this.state.changePasswordVisible}
confirmLoading={this.state.changePasswordConfirmLoading}
maskClosable={false}
onOk={() => {
this.changePasswordFormRef.current
.validateFields()