From be76d25b58627f6874698d05ef5e2c5ecd862c11 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 18 Mar 2025 18:07:01 +0800 Subject: [PATCH] fix(appstore): Handle redirection in app store (#8184) --- agent/utils/ssl/client.go | 8 ++++++ frontend/src/components/backup/index.vue | 1 - frontend/src/components/port-jump/index.vue | 7 ++--- frontend/src/global/mimetype.ts | 4 +++ .../src/layout/components/Sidebar/index.vue | 4 +-- frontend/src/routers/index.ts | 8 +++--- frontend/src/utils/util.ts | 20 ++++++++++++++ frontend/src/views/app-store/apps/index.vue | 2 +- .../src/views/app-store/installed/index.vue | 27 +++++++++++-------- .../setting/default-domain/index.vue | 2 +- frontend/src/views/home/index.vue | 20 +++++++------- .../src/views/setting/panel/proxy/index.vue | 1 - .../website/ssl/dns-account/create/index.vue | 6 ++++- 13 files changed, 73 insertions(+), 37 deletions(-) diff --git a/agent/utils/ssl/client.go b/agent/utils/ssl/client.go index af0b948a3..c13f383f1 100644 --- a/agent/utils/ssl/client.go +++ b/agent/utils/ssl/client.go @@ -4,6 +4,7 @@ import ( "crypto" "encoding/json" "github.com/go-acme/lego/v4/providers/dns/clouddns" + "github.com/go-acme/lego/v4/providers/dns/freemyip" "github.com/go-acme/lego/v4/providers/dns/huaweicloud" "github.com/go-acme/lego/v4/providers/dns/rainyun" "github.com/go-acme/lego/v4/providers/dns/volcengine" @@ -80,6 +81,7 @@ const ( RainYun DnsType = "RainYun" Volcengine DnsType = "Volcengine" HuaweiCloud DnsType = "HuaweiCloud" + FreeMyIP DnsType = "FreeMyIP" ) type DNSParam struct { @@ -211,6 +213,12 @@ func (c *AcmeClient) UseDns(dnsType DnsType, params string, websiteSSL model.Web huaweiCloudConfig.PollingInterval = pollingInterval huaweiCloudConfig.TTL = int32(ttl) p, err = huaweicloud.NewDNSProviderConfig(huaweiCloudConfig) + case FreeMyIP: + freeMyIpConfig := freemyip.NewDefaultConfig() + freeMyIpConfig.Token = param.Token + freeMyIpConfig.PropagationTimeout = propagationTimeout + freeMyIpConfig.PollingInterval = pollingInterval + p, err = freemyip.NewDNSProviderConfig(freeMyIpConfig) } if err != nil { return err diff --git a/frontend/src/components/backup/index.vue b/frontend/src/components/backup/index.vue index 09a18b3af..f4ea7ac1c 100644 --- a/frontend/src/components/backup/index.vue +++ b/frontend/src/components/backup/index.vue @@ -162,7 +162,6 @@ const acceptParams = (params: DialogProps): void => { detailName.value = params.detailName; backupVisible.value = true; status.value = params.status; - console.log(type); search(); }; const handleClose = () => { diff --git a/frontend/src/components/port-jump/index.vue b/frontend/src/components/port-jump/index.vue index 7ece8a6c8..3e4d3c813 100644 --- a/frontend/src/components/port-jump/index.vue +++ b/frontend/src/components/port-jump/index.vue @@ -2,7 +2,7 @@
- + {{ $t('firewall.quickJump') }} @@ -19,6 +19,7 @@ import { ref } from 'vue'; import { getSettingInfo } from '@/api/modules/setting'; import i18n from '@/lang'; import { MsgError, MsgWarning } from '@/utils/message'; +import { jumpToPath } from '@/utils/util'; import { useRouter } from 'vue-router'; const router = useRouter(); @@ -56,9 +57,5 @@ const acceptParams = async (params: DialogProps): Promise => { } }; -const goRouter = async (path: string) => { - router.push({ path: path }); -}; - defineExpose({ acceptParams }); diff --git a/frontend/src/global/mimetype.ts b/frontend/src/global/mimetype.ts index 0e00f83e6..e0689a133 100644 --- a/frontend/src/global/mimetype.ts +++ b/frontend/src/global/mimetype.ts @@ -207,6 +207,10 @@ export const DNSTypes = [ label: 'GoDaddy', value: 'Godaddy', }, + { + label: 'FreeMyIP', + value: 'FreeMyIP', + }, { label: i18n.global.t('website.rainyun'), value: 'RainYun', diff --git a/frontend/src/layout/components/Sidebar/index.vue b/frontend/src/layout/components/Sidebar/index.vue index fc0c53c1f..5d8470e41 100644 --- a/frontend/src/layout/components/Sidebar/index.vue +++ b/frontend/src/layout/components/Sidebar/index.vue @@ -251,9 +251,7 @@ const checkTask = async () => { try { const res = await countExecutingTask(); taskCount.value = res.data; - } catch (error) { - console.error(error); - } + } catch (error) {} }; const openTask = () => { diff --git a/frontend/src/routers/index.ts b/frontend/src/routers/index.ts index aac9f68e8..2c278edce 100644 --- a/frontend/src/routers/index.ts +++ b/frontend/src/routers/index.ts @@ -42,9 +42,11 @@ router.beforeEach((to, from, next) => { if (to.path === '/apps/all' && to.query.install != undefined) { return next(); } - // if (to.query.uncached != undefined) { - // return next(); - // } + if (to.query.uncached != undefined) { + const query = { ...to.query }; + delete query.uncached; + return next({ path: to.path, query }); + } const activeMenuKey = 'cachedRoute' + (to.meta.activeMenu || ''); const cachedRoute = localStorage.getItem(activeMenuKey); diff --git a/frontend/src/utils/util.ts b/frontend/src/utils/util.ts index a2215e803..2ac17a817 100644 --- a/frontend/src/utils/util.ts +++ b/frontend/src/utils/util.ts @@ -776,3 +776,23 @@ export async function loadJson(lang: string): Promise { throw new Error(`Language file not found: ${lang}`); } } + +export const jumpToPath = (router: any, path: string) => { + router.push({ path: path, query: { uncached: 'true' } }); +}; + +export const toLink = (link: string) => { + const ipv6Regex = /^https?:\/\/([a-f0-9:]+):(\d+)(\/?.*)?$/i; + try { + if (ipv6Regex.test(link)) { + const match = link.match(ipv6Regex); + if (match) { + const ipv6 = match[1]; + const port = match[2]; + const path = match[3] || ''; + link = `${link.startsWith('https') ? 'https' : 'http'}://[${ipv6}]:${port}${path}`; + } + } + window.open(link, '_blank'); + } catch (e) {} +}; diff --git a/frontend/src/views/app-store/apps/index.vue b/frontend/src/views/app-store/apps/index.vue index ed5b6b123..68b0bf2d8 100644 --- a/frontend/src/views/app-store/apps/index.vue +++ b/frontend/src/views/app-store/apps/index.vue @@ -24,7 +24,7 @@
- + {{ $t('app.installHelper') }} - + {{ $t('firewall.quickJump') }}   @@ -103,6 +108,7 @@