perf: 验证码支持测试,登录验证码需要测试通过后才能开启

This commit is contained in:
xiaojunnuo
2025-09-26 01:21:01 +08:00
parent 03f317ffdb
commit 83e6476408
18 changed files with 485 additions and 60 deletions
@@ -45,6 +45,16 @@ export async function DoVerify(id: number) {
});
}
export async function ResetStatus(id: number) {
return await request({
url: apiPrefix + "/resetStatus",
method: "post",
data: {
id,
},
});
}
export async function ParseDomain(fullDomain: string) {
return await request({
url: subDomainApiPrefix + "/parseDomain",
@@ -16,6 +16,9 @@
<a-tooltip v-if="cnameRecord.error" :title="cnameRecord.error">
<fs-icon class="ml-5 color-red" icon="ion:warning-outline"></fs-icon>
</a-tooltip>
<a-tooltip v-if="cnameRecord.status === 'valid'" title="重置校验状态,重新校验">
<fs-icon class="ml-5 color-red" icon="solar:undo-left-square-bold" @click="resetStatus"></fs-icon>
</a-tooltip>
</td>
<td class="center">
<template v-if="cnameRecord.status !== 'valid'">
@@ -71,12 +74,15 @@ function onRecordChange() {
});
}
async function loadRecord() {
cnameRecord.value = await GetByDomain(props.domain);
}
let refreshIntervalId: any = null;
async function doRefresh() {
if (!props.domain) {
return;
}
cnameRecord.value = await GetByDomain(props.domain);
await loadRecord();
onRecordChange();
if (cnameRecord.value.status === "validating") {
@@ -114,6 +120,11 @@ async function doVerify() {
}
await doRefresh();
}
async function resetStatus() {
await api.ResetStatus(cnameRecord.value.id);
await loadRecord();
}
</script>
<style lang="less">