Skip to content

Commit

Permalink
fix: 修复站点链接问题 imsyy#197
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Sep 18, 2023
1 parent 802cca0 commit 8cb8aba
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/Background.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ const changeBg = (type) => {
} else if (type == 1) {
bgUrl.value = "https://api.dujin.org/bing/1920.php";
} else if (type == 2) {
bgUrl.value = "https://api.btstu.cn/sjbz/api.php?lx=fengjing&format=images";
bgUrl.value = "https://api.aixiaowai.cn/gqapi/gqapi.php";
} else if (type == 3) {
bgUrl.value = "https://api.btstu.cn/sjbz/api.php?lx=dongman&format=images";
bgUrl.value = "https://api.aixiaowai.cn/api/api.php";
}
};
Expand Down
14 changes: 11 additions & 3 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-
</span>
{{ fullYear }}
<a :href="SiteUrl">{{ SiteAnthor }}</a>
<a :href="siteUrl">{{ siteAnthor }}</a>
</span>
<!-- 以下信息请不要修改哦 -->
<span class="hidden">
Expand Down Expand Up @@ -48,8 +48,16 @@ const fullYear = new Date().getFullYear();
// 加载配置数据
const siteStartDate = ref(import.meta.env.VITE_SITE_START);
const siteIcp = ref(import.meta.env.VITE_SITE_ICP);
const SiteAnthor = ref(import.meta.env.VITE_SITE_ANTHOR);
const SiteUrl = ref(import.meta.env.VITE_SITE_URL);
const siteAnthor = ref(import.meta.env.VITE_SITE_ANTHOR);
const siteUrl = computed(() => {
const url = import.meta.env.VITE_SITE_URL;
if (!url) return "https://www.imsyy.top";
// 判断协议前缀
if (!url.startsWith("http://") && !url.startsWith("https://")) {
return "//" + url;
}
return url;
});
</script>
<style lang="scss" scoped>
Expand Down
11 changes: 10 additions & 1 deletion src/components/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ const store = mainStore();
// 主页站点logo
const siteLogo = import.meta.env.VITE_SITE_MAIN_LOGO;
// 站点链接
const siteUrl = import.meta.env.VITE_SITE_URL.split(".");
const siteUrl = computed(() => {
const url = import.meta.env.VITE_SITE_URL;
if (!url) return "imsyy.top".split(".");
// 判断协议前缀
if (url.startsWith("http://") || url.startsWith("https://")) {
const urlFormat = url.replace(/^(https?:\/\/)/, "");
return urlFormat.split(".");
}
return url.split(".");
});
// 简介区域文字
const descriptionText = reactive({
Expand Down
11 changes: 10 additions & 1 deletion src/views/Main/Right.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ import Link from "@/components/Links.vue";
const store = mainStore();
// 站点链接
const siteUrl = import.meta.env.VITE_SITE_URL.split(".");
const siteUrl = computed(() => {
const url = import.meta.env.VITE_SITE_URL;
if (!url) return "imsyy.top".split(".");
// 判断协议前缀
if (url.startsWith("http://") || url.startsWith("https://")) {
const urlFormat = url.replace(/^(https?:\/\/)/, "");
return urlFormat.split(".");
}
return url.split(".");
});
</script>

<style lang="scss" scoped>
Expand Down
11 changes: 10 additions & 1 deletion src/views/MoreSet/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,16 @@ const store = mainStore();
const closeShow = ref(false);
// 站点链接
const siteUrl = import.meta.env.VITE_SITE_URL.split(".");
const siteUrl = computed(() => {
const url = import.meta.env.VITE_SITE_URL;
if (!url) return "imsyy.top".split(".");
// 判断协议前缀
if (url.startsWith("http://") || url.startsWith("https://")) {
const urlFormat = url.replace(/^(https?:\/\/)/, "");
return urlFormat.split(".");
}
return url.split(".");
});
// 更新日志
const upData = reactive({
Expand Down

0 comments on commit 8cb8aba

Please sign in to comment.