From 09416c75a442fac8f3c60efd793dd4e855ef4a6d Mon Sep 17 00:00:00 2001 From: "xiaoqi.cxq" Date: Wed, 27 Jul 2022 17:32:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0gitea=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E5=A1=AB=E5=85=A5Gitea=20URL=E6=97=B6=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=96=87=E6=A1=88=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modals/providers/GiteaAccountModal.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/modals/providers/GiteaAccountModal.vue b/src/components/modals/providers/GiteaAccountModal.vue index 1610504a..c0e980c7 100644 --- a/src/components/modals/providers/GiteaAccountModal.vue +++ b/src/components/modals/providers/GiteaAccountModal.vue @@ -10,6 +10,9 @@
例如: https://gitea.example.com/ + + ,非https的URL,请跳转到 HTTP链接 添加Gitea。 +
@@ -38,6 +41,7 @@ import constants from '../../../data/constants'; export default modalTemplate({ data: () => ({ + redirectUrl: constants.oauth2RedirectUri, }), computedLocalSettings: { serverUrl: 'giteaServerUrl', @@ -45,12 +49,11 @@ export default modalTemplate({ applicationSecret: 'giteaApplicationSecret', }, computed: { - redirectUrl() { - let url = constants.oauth2RedirectUri; - if (this.serverUrl && this.serverUrl.indexOf('http://') === 0) { - url = url.replace('https://', 'http://'); + httpAppUrl() { + if (constants.origin.indexOf('https://') === 0 && this.serverUrl.indexOf('http://') === 0) { + return `${constants.origin.replace('https://', 'http://')}/app`; } - return url; + return null; }, }, methods: {