Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Nov 24, 2024
1 parent f06dc16 commit f898873
Show file tree
Hide file tree
Showing 28 changed files with 145 additions and 60 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ZeroCatNext - Preview</title>
<title>ZeroCat社区</title>
</head>

<body>
Expand Down
16 changes: 16 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@

<script setup>
import Toast from "primevue/toast";
import { useHead } from "@unhead/vue";
useHead({
titleTemplate: (title) => (!title ? "ZeroCat社区" : `${title} - ZeroCat社区`),
meta: [
{
name: "description",
content:
"ZeroCat是新一代开源编程社区!坚信每一行代码都可以改变世界,我们致力于提供优质的开源编程社区,让开源编程更加容易。",
},
{
name: "keywords",
content:
"scratch编程,scratch社区,python编程,python社区,在线编程,编程社区,开源,自托管,开源编程社区,代码,阿尔法营,有道小图灵,别针社区,clipcc,蝾螈池,zerocat",
},
],
});
</script>

<style scoped>
Expand Down
1 change: 1 addition & 0 deletions src/pages/account/callback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<script>
import { jwtDecode } from "jwt-decode";
import { localuser } from "@/stores/user";
import { useHead } from "@unhead/vue";
import request from "../../axios/axios";
export default {
Expand Down
7 changes: 5 additions & 2 deletions src/pages/account/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ import request from "../../axios/axios";
import { localuser } from "@/stores/user";
import "https://static.geetest.com/v4/gt4.js";
import Compressor from "compressorjs";
import { useHead } from "@unhead/vue";
import {
initRecaptcha,
getResponse,
Expand Down Expand Up @@ -325,7 +325,10 @@ export default {
};
},
setup() {
//initRecaptcha('recaptcha-div1');
useHead({
title: '账户',
});
},
async created() {
if (this.localuser.islogin == false) {
Expand Down
6 changes: 1 addition & 5 deletions src/pages/account/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,7 @@ export default {
components: { LoadingDialog },
setup() {
useHead({
title: 'ZeroCat - Login',
meta: [
{ name: 'description', content: 'Login to your ZeroCat account.' },
{ name: 'keywords', content: 'ZeroCat, login, account' }
]
title: '登录',
});
},
data() {
Expand Down
6 changes: 6 additions & 0 deletions src/pages/account/logout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<script>
import { localuser } from "@/stores/user";
import { useHead } from "@unhead/vue";
export default {
data() {
Expand All @@ -20,7 +21,12 @@ export default {
logs: "",
};
},
setup() {
useHead({
title: '退出',
});
},
async created() {
this.log("正在退出账户");
Expand Down
6 changes: 5 additions & 1 deletion src/pages/account/magiclink/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ import {
getResponse,
resetCaptcha,
} from "../../../stores/useRecaptcha";
import { useHead } from "@unhead/vue";
export default {
components: { LoadingDialog },
data() {
Expand Down Expand Up @@ -159,6 +159,10 @@ export default {
if (localuser.islogin.value == true) {
this.$router.push("/");
}
useHead({
title: '魔术链接',
});
},
setup() {
initRecaptcha("recaptcha-div", "float");
Expand Down
6 changes: 5 additions & 1 deletion src/pages/account/magiclink/validate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { jwtDecode } from "jwt-decode";
import { localuser } from "@/stores/user";
import request from "../../../axios/axios";
import { useHead } from "@unhead/vue";
export default {
data() {
return {
Expand All @@ -45,7 +46,10 @@ export default {
this.$router.push("/");
}
},
async created() {
async created() {useHead({
title: '魔术链接登录',
});
if (this.$route.query.token) {
try {
await request({
Expand Down
6 changes: 1 addition & 5 deletions src/pages/account/register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,7 @@ export default {
components: { LoadingDialog },
setup() {
useHead({
title: 'ZeroCat - Register',
meta: [
{ name: 'description', content: 'Create a new ZeroCat account.' },
{ name: 'keywords', content: 'ZeroCat, register, account' }
]
title: '注册',
});
},
data() {
Expand Down
6 changes: 5 additions & 1 deletion src/pages/account/retrieve.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ import {
getResponse,
resetCaptcha,
} from "../../stores/useRecaptcha";
import { useHead } from '@unhead/vue'
export default {
components: { LoadingDialog },
data() {
Expand Down Expand Up @@ -148,6 +148,10 @@ export default {
if (localuser.islogin.value == true) {
this.$router.push("/");
}
useHead({
title: '找回密码',
});
},
setup() {
initRecaptcha("recaptcha-div", "float");
Expand Down
6 changes: 5 additions & 1 deletion src/pages/account/retrievecallback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ import {
getResponse,
resetCaptcha,
} from "../../stores/useRecaptcha";
import { useHead } from '@unhead/vue'
export default {
components: { LoadingDialog },
data() {
Expand Down Expand Up @@ -164,6 +164,10 @@ export default {
if (localuser.islogin.value == true) {
this.$router.push("/");
}
useHead({
title: '重设密码',
});
},
setup() {
initRecaptcha("recaptcha-div", "float");
Expand Down
7 changes: 6 additions & 1 deletion src/pages/account/totp/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<script>
import QRCode from "qrcode";
import request from "@/axios/axios";
import { useHead } from "@unhead/vue";
export default {
name: "TotpGenerator",
data() {
Expand All @@ -75,6 +75,11 @@ export default {
qrCodeUrl: "",
errorMessage: "",
};
},setup() {
useHead({
title: '创建验证器',
});
},
methods: {
// 请求 TOTP 生成 URL
Expand Down
7 changes: 6 additions & 1 deletion src/pages/account/totp/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<script>
import request from "@/axios/axios";
import { useHead } from "@unhead/vue";
export default {
data() {
return {
Expand All @@ -81,6 +81,11 @@ export default {
},
],
};
},setup() {
useHead({
title: '验证器',
});
},
methods: {
// 获取TOTP列表
Expand Down
6 changes: 1 addition & 5 deletions src/pages/algolia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@ import { useHead } from '@unhead/vue'
export default {
setup() {
useHead({
title: 'ZeroCat - Algolia Search',
meta: [
{ name: 'description', content: 'Search projects using Algolia on ZeroCat.' },
{ name: 'keywords', content: 'ZeroCat, Algolia, search, projects' }
]
title: 'Algolia Search',
});
},
data() {
Expand Down
6 changes: 1 addition & 5 deletions src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,7 @@ export default {
components: { Typewriter },
setup() {
useHead({
title: 'ZeroCat - Home',
meta: [
{ name: 'description', content: 'ZeroCat is a new generation open-source programming community.' },
{ name: 'keywords', content: 'ZeroCat, open-source, programming, community' }
]
});
},
data() {
Expand Down
19 changes: 14 additions & 5 deletions src/pages/projectlist/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@

<v-card-text class="bg-surface-light pt-4">
{{ projectlist.description }}
</v-card-text> </v-card
>
<br/> <ProjectsCards :projects="projectlist.data"></ProjectsCards><br/>
</v-card-text>
</v-card>
<br />
<ProjectsCards :projects="projectlist.data"></ProjectsCards><br />

<Comment
:url="'projectlist-' + this.$route.params.id"
Expand All @@ -47,7 +48,7 @@ import Comment from "../../components/Comment.vue";
import request from "../../axios/axios";
import { localuser } from "@/stores/user";
import ProjectsCards from "../../components/ProjectsCards.vue";
import { useHead } from "@unhead/vue";
export default {
components: { ProjectsCards, Comment },
Expand Down Expand Up @@ -75,7 +76,11 @@ export default {
Loading: true,
};
},
setup() {
useHead({
title: "ZeroCat - 列表",
});
},
async created() {
init({
el: "#waline",
Expand Down Expand Up @@ -107,6 +112,10 @@ export default {
} else {
this.$router.push("/404");
}
useHead({
title: '' + this.projectlist.title,
});
console.log(this.projectlist);
},
},
Expand Down
6 changes: 6 additions & 0 deletions src/pages/projectlist/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import NewProjectList from "@/components/NewProjectList.vue";
import EditProjectListConfig from "@/components/EditProjectListConfig.vue";
import { localuser } from "@/stores/user";
import request from "../../axios/axios";
import { useHead } from "@unhead/vue";
export default {
components: { NewProjectList, EditProjectListConfig },
Expand All @@ -65,6 +66,11 @@ export default {
NewProjectListDialog: false,
lists: [],
};
},setup() {
useHead({
title: '列表',
});
},
methods: {
async getProjectList() {
Expand Down
10 changes: 10 additions & 0 deletions src/pages/projects/[id]/fork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import openEditor from "../../../stores/openEdit";
import request from "../../../axios/axios";
import { localuser } from "@/stores/user";
import { useHead } from "@unhead/vue";
export default {
data() {
return {
Expand Down Expand Up @@ -120,13 +121,22 @@ export default {
async created() {
await this.getproject();
},
setup() {
useHead({
title: '分叉',
});
},
methods: {
async getproject() {
this.project = await request({
url: "/project/" + this.$route.params.id,
method: "get",
});
useHead({
title: '分叉'+this.project.title,
});
console.log(this.project);
},
async forkproject(id) {
Expand Down
12 changes: 12 additions & 0 deletions src/pages/projects/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ import { localuser } from "@/stores/user";
import AddTolist from "../../../components/AddTolist.vue";
import Comment from "../../../components/Comment.vue";
import TimeAgo from "@/components/TimeAgo.vue";
import { useHead } from "@unhead/vue";
export default {
components: { ProjectRunner, TimeAgo, Comment, AddTolist },
data() {
Expand Down Expand Up @@ -134,7 +137,12 @@ export default {
localuser: localuser,
};
},
setup() {
useHead({
title: '项目',
});
},
async created() {
await this.getproject();
//init({ el: "#waline", serverURL: "https://zerocat-waline.190823.xyz", path: "scratchproject-" + this.$route.params.id, copyright: false, reaction: true, pageview: true, locale: { reactionTitle: "这个作品怎么样?", }, emoji: [ "//unpkg.com/@waline/[email protected]/weibo", "//unpkg.com/@waline/[email protected]/bilibili", ], dark: window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches, });
Expand All @@ -145,6 +153,10 @@ export default {
url: "/project/" + this.$route.params.id,
method: "get",
});
useHead({
title: '' + this.project.title,
});
console.log(this.project);
},
},
Expand Down
Loading

0 comments on commit f898873

Please sign in to comment.