perf: 支持主动修改绑定url地址

This commit is contained in:
xiaojunnuo
2026-04-24 00:11:55 +08:00
parent 71cfcad2a1
commit 11b7cfe5cb
3 changed files with 9 additions and 7 deletions
@@ -289,7 +289,7 @@ export const useSettingStore = defineStore({
} }
}, },
openBindUrlModal() { openBindUrlModal(opts: { closable?: boolean } = { closable: false }) {
const event: any = { ModalRef: null }; const event: any = { ModalRef: null };
mitter.emit("getModal", event); mitter.emit("getModal", event);
const Modal = event.ModalRef; const Modal = event.ModalRef;
@@ -302,10 +302,12 @@ export const useSettingStore = defineStore({
modalRef.destroy(); modalRef.destroy();
} }
}; };
const { closable = false } = opts;
const modalRef: any = Modal.warning({ const modalRef: any = Modal.warning({
title: "URL地址未绑定,是否绑定此地址?", title: "URL地址未绑定,是否绑定此地址?",
width: 500, width: 500,
keyboard: false, keyboard: false,
closable,
content: () => { content: () => {
return ( return (
<div class="p-4"> <div class="p-4">
@@ -338,10 +340,10 @@ export const useSettingStore = defineStore({
danger: true, danger: true,
}, },
okText: "不,回到原来的地址", okText: "不,回到原来的地址",
cancelText: "不,回到原来的地址", // cancelText: "不,回到原来的地址",
onCancel: () => { // onOk: () => {
window.location.href = bindUrl; // window.location.href = bindUrl;
}, // },
}); });
}, },
async loadProductInfo() { async loadProductInfo() {
@@ -26,7 +26,7 @@
</a-form-item> </a-form-item>
<a-form-item :label="t('certd.sys.setting.bindUrl')"> <a-form-item :label="t('certd.sys.setting.bindUrl')">
<a-button class="ml-2" size="small" type="primary" @click="settingsStore.openBindUrlModal()">{{ t("certd.sys.setting.bindUrl") }}</a-button> <a-button class="ml-2" type="primary" @click="settingsStore.openBindUrlModal({ closable: true })">{{ t("certd.sys.setting.bindUrl") }}</a-button>
</a-form-item> </a-form-item>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }"> <a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
@@ -8,7 +8,7 @@
</div> </div>
<pre class="helper pre">{{ t("certd.sys.setting.passkeyEnabledHelper", [bindDomain]) }}</pre> <pre class="helper pre">{{ t("certd.sys.setting.passkeyEnabledHelper", [bindDomain]) }}</pre>
<div v-if="!bindDomainIsSame" class="text-red-500 text-sm mt-2"> <div v-if="!bindDomainIsSame" class="text-red-500 text-sm mt-2">
{{ t("certd.sys.setting.passkeyHostnameNotSame") }} <a-button class="ml-2" size="small" type="primary" @click="settingsStore.openBindUrlModal()">{{ t("certd.sys.setting.bindUrl") }}</a-button> {{ t("certd.sys.setting.passkeyHostnameNotSame") }} <a-button class="ml-2" size="small" type="primary" @click="settingsStore.openBindUrlModal({ closable: true })">{{ t("certd.sys.setting.bindUrl") }}</a-button>
</div> </div>
</a-form-item> </a-form-item>
<a-form-item :label="t('certd.sys.setting.enableOauth')" :name="['public', 'oauthEnabled']"> <a-form-item :label="t('certd.sys.setting.enableOauth')" :name="['public', 'oauthEnabled']">