增加删除用户时也删除缓存中的授权信息
This commit is contained in:
parent
d771ad6ab6
commit
661435f80a
@ -2,6 +2,7 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
|
"next-terminal/pkg/global"
|
||||||
"next-terminal/pkg/model"
|
"next-terminal/pkg/model"
|
||||||
"next-terminal/pkg/utils"
|
"next-terminal/pkg/utils"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -79,6 +80,7 @@ func UserDeleteEndpoint(c echo.Context) error {
|
|||||||
}
|
}
|
||||||
if loginLogs != nil && len(loginLogs) > 0 {
|
if loginLogs != nil && len(loginLogs) > 0 {
|
||||||
for j := range loginLogs {
|
for j := range loginLogs {
|
||||||
|
global.Cache.Delete(loginLogs[j].ID)
|
||||||
model.Logout(loginLogs[j].ID)
|
model.Logout(loginLogs[j].ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,6 +127,7 @@ class LoginForm extends Component {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Modal title="双因素认证" visible={this.state.totpModalVisible} confirmLoading={this.state.confirmLoading}
|
<Modal title="双因素认证" visible={this.state.totpModalVisible} confirmLoading={this.state.confirmLoading}
|
||||||
|
maskClosable={false}
|
||||||
onOk={() => {
|
onOk={() => {
|
||||||
this.formRef.current
|
this.formRef.current
|
||||||
.validateFields()
|
.validateFields()
|
||||||
|
@ -609,6 +609,7 @@ class User extends Component {
|
|||||||
this.state.changePasswordVisible ?
|
this.state.changePasswordVisible ?
|
||||||
<Modal title="修改密码" visible={this.state.changePasswordVisible}
|
<Modal title="修改密码" visible={this.state.changePasswordVisible}
|
||||||
confirmLoading={this.state.changePasswordConfirmLoading}
|
confirmLoading={this.state.changePasswordConfirmLoading}
|
||||||
|
maskClosable={false}
|
||||||
onOk={() => {
|
onOk={() => {
|
||||||
this.changePasswordFormRef.current
|
this.changePasswordFormRef.current
|
||||||
.validateFields()
|
.validateFields()
|
||||||
|
Loading…
Reference in New Issue
Block a user