Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Oct 6, 2024
1 parent d0ca341 commit 29efd5d
Show file tree
Hide file tree
Showing 46 changed files with 3,007 additions and 2,031 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
</template>

<script setup>
import Toast from 'primevue/toast';
import Toast from "primevue/toast";
</script>
51 changes: 28 additions & 23 deletions src/axios/axios.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@

import axios from 'axios';
import axios from "axios";
// 基本配置
const instance = axios.create({
baseURL: import.meta.env.VITE_APP_BASE_API, // 根据实际情况修改API地址
// timeout: 5000 // 设置超时时间,单位为ms
// timeout: 5000 // 设置超时时间,单位为ms
});

// 请求拦截器
instance.interceptors.request.use(config => {
config.headers['Authorization'] = localStorage.getItem('token'); // 设置请求头部分,这里举例使用了localStorage存储的token作为身份标识
return config;
}, error => {
console.log(error);
return Promise.reject(error);
});
instance.interceptors.request.use(
(config) => {
config.headers["Authorization"] = localStorage.getItem("token"); // 设置请求头部分,这里举例使用了localStorage存储的token作为身份标识
return config;
},
(error) => {
console.log(error);
return Promise.reject(error);
}
);

// 响应拦截器
instance.interceptors.response.use(response => {
const data = response.data;
//if (data && data.code !== 200) { // 根据接口返回的状态码判断是否有错误
// alert(`Error code ${data.code}: ${data.message}`); // 自定义错误提示
// return Promise.reject(new Error(data.message));
//} else {
return data;
//}
}, error => {
console.log(error);
alert(`Error: ${error.message}`); // 自定义错误提示
return Promise.reject(error);
});
instance.interceptors.response.use(
(response) => {
const data = response.data;
//if (data && data.code !== 200) { // 根据接口返回的状态码判断是否有错误
// alert(`Error code ${data.code}: ${data.message}`); // 自定义错误提示
// return Promise.reject(new Error(data.message));
//} else {
return data;
//}
},
(error) => {
console.log(error);
alert(`Error: ${error.message}`); // 自定义错误提示
return Promise.reject(error);
}
);

export default instance;
71 changes: 46 additions & 25 deletions src/components/AppFooter.vue
Original file line number Diff line number Diff line change
@@ -1,51 +1,72 @@
<template>
<v-footer height="40" app>
<a v-for="item in items" :key="item.title" :href="item.href" :title="item.title"
class="d-inline-block mx-2 social-link" rel="noopener noreferrer" target="_blank">
<a
v-for="item in items"
:key="item.title"
:href="item.href"
:title="item.title"
class="d-inline-block mx-2 social-link"
rel="noopener noreferrer"
target="_blank"
>
<v-icon :icon="item.icon" :size="item.icon === 'mdi-earth' ? 24 : 16" />
</a>

<div class="text-caption text-disabled" style="position: absolute; right: 16px;">
&copy; 2019-{{ (new Date()).getFullYear() }} <span class="d-none d-sm-inline-block">ZeroCat Dev</span>
<div
class="text-caption text-disabled"
style="position: absolute; right: 16px"
>
&copy; 2019-{{ new Date().getFullYear() }}
<span class="d-none d-sm-inline-block">ZeroCat Dev</span>
<a class="text-decoration-none on-surface" href="https://wuyuan.dev" rel="noopener noreferrer" target="_blank">
孙悟元 </a>
<a
class="text-decoration-none on-surface"
href="https://wuyuan.dev"
rel="noopener noreferrer"
target="_blank"
>
孙悟元
</a>
</div>
</v-footer>
</template>

<script setup>
const items = [
{
title: 'ZeroCat',
title: "ZeroCat",
icon: `mdi-earth`,
href: 'https://zerocat.houlangs.com/',
href: "https://zerocat.houlangs.com/",
},
{
title: 'ZeroCat Github',
icon: 'mdi-github',
href: 'https://github.com/zerocatdev',
title: "ZeroCat Github",
icon: "mdi-github",
href: "https://github.com/zerocatdev",
},
{
title: 'ZeroCat X',
icon: ['M2.04875 3.00002L9.77052 13.3248L1.99998 21.7192H3.74882L10.5519 14.3697L16.0486 21.7192H22L13.8437 10.8137L21.0765 3.00002H19.3277L13.0624 9.76874L8.0001 3.00002H2.04875ZM4.62054 4.28821H7.35461L19.4278 20.4308H16.6937L4.62054 4.28821Z'],
href: 'https://x.com/wuyuandev',
title: "ZeroCat X",
icon: [
"M2.04875 3.00002L9.77052 13.3248L1.99998 21.7192H3.74882L10.5519 14.3697L16.0486 21.7192H22L13.8437 10.8137L21.0765 3.00002H19.3277L13.0624 9.76874L8.0001 3.00002H2.04875ZM4.62054 4.28821H7.35461L19.4278 20.4308H16.6937L4.62054 4.28821Z",
],
href: "https://x.com/wuyuandev",
},
{
title: 'ZeroCat Discord',
icon: ['M22,24L16.75,19L17.38,21H4.5A2.5,2.5 0 0,1 2,18.5V3.5A2.5,2.5 0 0,1 4.5,1H19.5A2.5,2.5 0 0,1 22,3.5V24M12,6.8C9.32,6.8 7.44,7.95 7.44,7.95C8.47,7.03 10.27,6.5 10.27,6.5L10.1,6.33C8.41,6.36 6.88,7.53 6.88,7.53C5.16,11.12 5.27,14.22 5.27,14.22C6.67,16.03 8.75,15.9 8.75,15.9L9.46,15C8.21,14.73 7.42,13.62 7.42,13.62C7.42,13.62 9.3,14.9 12,14.9C14.7,14.9 16.58,13.62 16.58,13.62C16.58,13.62 15.79,14.73 14.54,15L15.25,15.9C15.25,15.9 17.33,16.03 18.73,14.22C18.73,14.22 18.84,11.12 17.12,7.53C17.12,7.53 15.59,6.36 13.9,6.33L13.73,6.5C13.73,6.5 15.53,7.03 16.56,7.95C16.56,7.95 14.68,6.8 12,6.8M9.93,10.59C10.58,10.59 11.11,11.16 11.1,11.86C11.1,12.55 10.58,13.13 9.93,13.13C9.29,13.13 8.77,12.55 8.77,11.86C8.77,11.16 9.28,10.59 9.93,10.59M14.1,10.59C14.75,10.59 15.27,11.16 15.27,11.86C15.27,12.55 14.75,13.13 14.1,13.13C13.46,13.13 12.94,12.55 12.94,11.86C12.94,11.16 13.45,10.59 14.1,10.59Z'],
href: '#',
}
]
title: "ZeroCat Discord",
icon: [
"M22,24L16.75,19L17.38,21H4.5A2.5,2.5 0 0,1 2,18.5V3.5A2.5,2.5 0 0,1 4.5,1H19.5A2.5,2.5 0 0,1 22,3.5V24M12,6.8C9.32,6.8 7.44,7.95 7.44,7.95C8.47,7.03 10.27,6.5 10.27,6.5L10.1,6.33C8.41,6.36 6.88,7.53 6.88,7.53C5.16,11.12 5.27,14.22 5.27,14.22C6.67,16.03 8.75,15.9 8.75,15.9L9.46,15C8.21,14.73 7.42,13.62 7.42,13.62C7.42,13.62 9.3,14.9 12,14.9C14.7,14.9 16.58,13.62 16.58,13.62C16.58,13.62 15.79,14.73 14.54,15L15.25,15.9C15.25,15.9 17.33,16.03 18.73,14.22C18.73,14.22 18.84,11.12 17.12,7.53C17.12,7.53 15.59,6.36 13.9,6.33L13.73,6.5C13.73,6.5 15.53,7.03 16.56,7.95C16.56,7.95 14.68,6.8 12,6.8M9.93,10.59C10.58,10.59 11.11,11.16 11.1,11.86C11.1,12.55 10.58,13.13 9.93,13.13C9.29,13.13 8.77,12.55 8.77,11.86C8.77,11.16 9.28,10.59 9.93,10.59M14.1,10.59C14.75,10.59 15.27,11.16 15.27,11.86C15.27,12.55 14.75,13.13 14.1,13.13C13.46,13.13 12.94,12.55 12.94,11.86C12.94,11.16 13.45,10.59 14.1,10.59Z",
],
href: "#",
},
];
</script>

<style scoped lang="sass">
.social-link :deep(.v-icon)
color: rgba(var(--v-theme-on-background), var(--v-disabled-opacity))
text-decoration: none
transition: .2s ease-in-out
.social-link :deep(.v-icon)
color: rgba(var(--v-theme-on-background), var(--v-disabled-opacity))
text-decoration: none
transition: .2s ease-in-out
&:hover
color: rgba(25, 118, 210, 1)
&:hover
color: rgba(25, 118, 210, 1)
</style>
Loading

0 comments on commit 29efd5d

Please sign in to comment.