add verification check and support

This commit is contained in:
AceDataCloud committed 2023-02-11 12:18:53 +08:00
1 parent 538dfd283e
commit 91c6792c5c
10 files changed
+90 -16

No files matched your search

+13 -1
View File
@@ -85,7 +85,7 @@ import {
serviceOperator
} from '@/operators';
import { defineComponent } from 'vue';
import { ERROR_CODE_DUPLICATION } from '@/constants';
import { ERROR_CODE_DUPLICATION, ERROR_CODE_UNVERIFIED } from '@/constants';
import { ElMessage } from 'element-plus';
import { apiOperator } from '@/operators/api/operator';
import { IApi, IApiListResponse } from '@/operators/api/models';
@@ -94,6 +94,7 @@ import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
import { ROUTE_CONSOLE_APPLICATION_LIST } from '@/router';
import { ElCol, ElRow, ElButton, ElCard, ElDivider, ElSkeleton, ElSkeletonItem } from 'element-plus';
import ApiInfo from '@/components/api/Info.vue';
import { getVerificationUrl } from '@/utils';
interface IData {
service: IService | undefined;
@@ -191,6 +192,17 @@ export default defineComponent({
});
}, 2000);
}
if (error?.response?.data?.code === ERROR_CODE_UNVERIFIED) {
ElMessage({
dangerouslyUseHTMLString: true,
duration: 0,
showClose: true,
message: `${this.$t(
'application.message.unverified'
)} <a class="underline" href="${getVerificationUrl()}">${this.$t('application.message.goVerify')}</a>`,
type: 'warning'
});
}
});
}
}