Skip to content

Commit

Permalink
fixed: Fixed an issue where MFA validation would open twice
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoJiSen authored and ibuler committed Jun 25, 2024
1 parent 5b3d209 commit f06d28d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Apps/UserConfirmDialog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default {
this.inputPlaceholder = this.subTypeChoices.filter(item => item.name === val)[0]?.placeholder
this.smsWidth = val === 'sms' ? 6 : 0
},
performConfirm: _.throttle(function({ response, callback, cancel }) {
performConfirm: _.debounce(function({ response, callback, cancel }) {
if (this.processing || this.visible) {
return
}
Expand Down
2 changes: 2 additions & 0 deletions src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ function ifConfirmRequired({ response, error }) {
return new Promise((resolve, reject) => {
const callback = () => resolve()
const cancel = () => reject()

eventBus.$emit('showConfirmDialog', { response, callback, cancel })
})
}
Expand Down Expand Up @@ -158,6 +159,7 @@ service.interceptors.response.use(
const response = error.response

const confirming = ifConfirmRequired({ response, error })

if (confirming) {
return new Promise((resolve, reject) => {
confirming.then(() => {
Expand Down

0 comments on commit f06d28d

Please sign in to comment.