chore: 1panel 站点证书更新

This commit is contained in:
xiaojunnuo
2026-02-09 22:46:09 +08:00
parent 79c77ce3a3
commit 519bf3184a
2 changed files with 11 additions and 5 deletions
@@ -103,7 +103,7 @@ import SmsCode from "/@/views/framework/login/sms-code.vue";
import { useI18n } from "/@/locales"; import { useI18n } from "/@/locales";
import { LanguageToggle } from "/@/vben/layouts"; import { LanguageToggle } from "/@/vben/layouts";
import CaptchaInput from "/@/components/captcha/captcha-input.vue"; import CaptchaInput from "/@/components/captcha/captcha-input.vue";
import { useRoute } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import OauthFooter from "/@/views/framework/oauth/oauth-footer.vue"; import OauthFooter from "/@/views/framework/oauth/oauth-footer.vue";
import * as oauthApi from "../oauth/api"; import * as oauthApi from "../oauth/api";
import { notification } from "ant-design-vue"; import { notification } from "ant-design-vue";
@@ -113,6 +113,12 @@ export default defineComponent({
setup() { setup() {
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter();
const userStore = useUserStore();
if (userStore.getToken) {
router.push("/");
return;
}
const queryBindCode = ref(route.query.bindCode as string | undefined); const queryBindCode = ref(route.query.bindCode as string | undefined);
@@ -120,7 +126,7 @@ export default defineComponent({
const urlLoginType = route.query.loginType as string | undefined; const urlLoginType = route.query.loginType as string | undefined;
const verifyCodeInputRef = ref(); const verifyCodeInputRef = ref();
const loading = ref(false); const loading = ref(false);
const userStore = useUserStore();
const settingStore = useSettingStore(); const settingStore = useSettingStore();
const formRef = ref(); const formRef = ref();
let defaultLoginType = settingStore.sysPublic.defaultLoginType || "password"; let defaultLoginType = settingStore.sysPublic.defaultLoginType || "password";
@@ -7,9 +7,9 @@ import { OnePanelClient } from "../client.js";
@IsTaskPlugin({ @IsTaskPlugin({
name: "1PanelDeployToWebsitePlugin", name: "1PanelDeployToWebsitePlugin",
title: "1Panel-更新证书", title: "1Panel-更新站点证书",
icon: "svg:icon-onepanel", icon: "svg:icon-onepanel",
desc: "更新1Panel的证书,包括面板证书和站点证书", desc: "更新1Panel的站点证书",
group: pluginGroups.panel.key, group: pluginGroups.panel.key,
default: { default: {
strategy: { strategy: {
@@ -195,7 +195,7 @@ export class OnePanelDeployToWebsitePlugin extends AbstractTaskPlugin {
currentNode: this.currentNode, currentNode: this.currentNode,
}); });
if (!res?.items) { if (!res?.items) {
throw new Error("没有找到证书,请先在1Panel中手动上传证书,并关联站点或设置面板证书,后续才可以自动更新"); throw new Error("没有找到证书,请先在1Panel中手动上传证书,并关联站点,后续才可以自动更新");
} }
const list = res.items.map(item => { const list = res.items.map(item => {
const domains = item.domains ? [] : item.domains.split(","); const domains = item.domains ? [] : item.domains.split(",");