diff --git a/dbm-ui/frontend/src/views/temporary-paassword-modify/index/Index.vue b/dbm-ui/frontend/src/views/temporary-paassword-modify/index/Index.vue
index c7dfcafa65..49184491f1 100644
--- a/dbm-ui/frontend/src/views/temporary-paassword-modify/index/Index.vue
+++ b/dbm-ui/frontend/src/views/temporary-paassword-modify/index/Index.vue
@@ -16,12 +16,22 @@
+
+ {{ t('查看详情') }}
+
{{ t('密码正在修改中,请稍等') }}
@@ -136,33 +146,34 @@
},
);
- const currentScope = getCurrentScope();
const rootId = ref('');
- const modifyResult = ref
();
+ const modifyResult = ref('');
- const { run: queryAsyncModifyResultRun, loading: queryLoading } = useRequest(queryAsyncModifyResult, {
+ // 轮询
+ const { isActive, resume, pause } = useTimeoutPoll(() => {
+ queryAsyncModifyResultRun({
+ root_id: rootId.value,
+ });
+ }, 2000);
+
+ const { run: queryAsyncModifyResultRun } = useRequest(queryAsyncModifyResult, {
manual: true,
onSuccess({ data, status }) {
- modifyResult.value = data;
- // 设置轮询
- if (currentScope?.active) {
- !isActive.value && ['PENDING', 'RUNNING', 'FINISHED'].includes(status) && resume();
- } else {
+ /**
+ * 设置轮询
+ * FINISHED: 完成态
+ * FAILED: 失败态
+ * REVOKED: 取消态
+ */
+ if (['FINISHED', 'FAILED', 'REVOKED'].includes(status)) {
+ modifyResult.value = data;
pause();
+ return;
}
- },
- onError() {
- modifyResult.value = {} as ModifyAdminPassword;
+ !isActive.value && resume();
},
});
- // 轮询
- const { isActive, resume, pause } = useTimeoutPoll(() => {
- queryAsyncModifyResultRun({
- root_id: rootId.value,
- });
- }, 10000);
-
const { run: modifyAdminPasswordRun, loading: submitting } = useRequest(modifyAdminPassword, {
manual: true,
onSuccess(data) {
@@ -238,17 +249,20 @@
border-radius: 2px;
.submitting-mask {
+ display: flex;
padding: 90px 0 138px;
- text-align: center;
+ flex-direction: column;
+ align-items: center;
.submitting-icon {
+ margin-bottom: 18px;
font-size: 64px;
color: @primary-color;
animation: rotate 2s linear infinite;
}
.submitting-text {
- margin-top: 36px;
+ margin-top: 18px;
font-size: 24px;
color: #313238;
}