添加gitea账号填入Gitea URL时提示文案调整

This commit is contained in:
xiaoqi.cxq 2022-07-27 17:32:20 +08:00
parent 492958702a
commit 09416c75a4

View File

@ -10,6 +10,9 @@
<input v-else slot="field" class="textfield" type="text" v-model.trim="serverUrl" @keydown.enter="resolve()"> <input v-else slot="field" class="textfield" type="text" v-model.trim="serverUrl" @keydown.enter="resolve()">
<div class="form-entry__info"> <div class="form-entry__info">
<b>例如:</b> https://gitea.example.com/ <b>例如:</b> https://gitea.example.com/
<span v-if="httpAppUrl">
非https的URL请跳转到 <a :href="httpAppUrl" target="_blank">HTTP链接</a> 添加Gitea
</span>
</div> </div>
</form-entry> </form-entry>
<form-entry label="Application ID" error="applicationId"> <form-entry label="Application ID" error="applicationId">
@ -38,6 +41,7 @@ import constants from '../../../data/constants';
export default modalTemplate({ export default modalTemplate({
data: () => ({ data: () => ({
redirectUrl: constants.oauth2RedirectUri,
}), }),
computedLocalSettings: { computedLocalSettings: {
serverUrl: 'giteaServerUrl', serverUrl: 'giteaServerUrl',
@ -45,12 +49,11 @@ export default modalTemplate({
applicationSecret: 'giteaApplicationSecret', applicationSecret: 'giteaApplicationSecret',
}, },
computed: { computed: {
redirectUrl() { httpAppUrl() {
let url = constants.oauth2RedirectUri; if (constants.origin.indexOf('https://') === 0 && this.serverUrl.indexOf('http://') === 0) {
if (this.serverUrl && this.serverUrl.indexOf('http://') === 0) { return `${constants.origin.replace('https://', 'http://')}/app`;
url = url.replace('https://', 'http://');
} }
return url; return null;
}, },
}, },
methods: { methods: {