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 };
mitter.emit("getModal", event);
const Modal = event.ModalRef;
@@ -302,10 +302,12 @@ export const useSettingStore = defineStore({
modalRef.destroy();
}
};
const { closable = false } = opts;
const modalRef: any = Modal.warning({
title: "URL地址未绑定,是否绑定此地址?",
width: 500,
keyboard: false,
closable,
content: () => {
return (
<div class="p-4">
@@ -338,10 +340,10 @@ export const useSettingStore = defineStore({
danger: true,
},
okText: "不,回到原来的地址",
cancelText: "不,回到原来的地址",
onCancel: () => {
window.location.href = bindUrl;
},
// cancelText: "不,回到原来的地址",
// onOk: () => {
// window.location.href = bindUrl;
// },
});
},
async loadProductInfo() {
@@ -26,7 +26,7 @@
</a-form-item>
<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 label=" " :colon="false" :wrapper-col="{ span: 8 }">
@@ -8,7 +8,7 @@
</div>
<pre class="helper pre">{{ t("certd.sys.setting.passkeyEnabledHelper", [bindDomain]) }}</pre>
<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>
</a-form-item>
<a-form-item :label="t('certd.sys.setting.enableOauth')" :name="['public', 'oauthEnabled']">