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 b95d8bf commit c5e2763
Show file tree
Hide file tree
Showing 23 changed files with 129 additions and 126 deletions.
3 changes: 1 addition & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ useHead({
meta: [
{
name: "description",
content:
"ZeroCat是新一代开源编程社区!",
content: "ZeroCat是新一代开源编程社区!",
},
{
name: "keywords",
Expand Down
12 changes: 9 additions & 3 deletions src/pages/account/callback.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<v-container>
<v-card class="mx-auto" rel="noopener" target="_blank" border>
<template v-slot:title>
<span>您正在登录一个账户</span> </template
<template v-slot:title> <span>您正在登录一个账户</span> </template
><template v-slot:subtitle>
<span
>其他页面传来了一个登录请求,正常情况下它会被自动处理</span
Expand Down Expand Up @@ -32,7 +31,11 @@ export default {
BASE_API: import.meta.env.VITE_APP_BASE_API,
};
},
setup() {
useHead({
title: "ZeroCat - 确认账户登录",
});
},
async created() {
if (this.$route.query.token) {
try {
Expand All @@ -46,6 +49,9 @@ export default {
this.user = error;
}
} else {
useHead({
title: "ZeroCat - 账户登录失败",
});
console.log("无token");
}
},
Expand Down
16 changes: 8 additions & 8 deletions src/pages/account/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
size="large"
append-icon="mdi-arrow-right"
to="/account/register"
></v-btn> <v-btn
></v-btn>
<v-btn
class="text-none"
color="white"
rounded="xl"
Expand Down Expand Up @@ -128,15 +129,11 @@ import {
getResponse,
resetCaptcha,
} from "../../stores/useRecaptcha";
import { useHead } from '@unhead/vue'
import { useHead } from "@unhead/vue";
export default {
components: { LoadingDialog },
setup() {
useHead({
title: '登录',
});
},
data() {
return {
BASE_API: import.meta.env.VITE_APP_BASE_API,
Expand Down Expand Up @@ -174,9 +171,12 @@ export default {
if (localuser.islogin.value == true) {
this.$router.push("/");
}
initRecaptcha("recaptcha-div", "float");
},
setup() {
initRecaptcha("recaptcha-div", "float");
useHead({
title: "登录",
});
},
methods: {
async login() {
Expand Down
3 changes: 1 addition & 2 deletions src/pages/account/magiclink/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ export default {
this.$router.push("/");
}
useHead({
title: '魔术链接',
title: "魔术链接",
});
},
setup() {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/account/magiclink/validate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export default {
this.$router.push("/");
}
},
async created() {useHead({
title: '魔术链接登录',
async created() {
useHead({
title: "魔术链接登录",
});
if (this.$route.query.token) {
try {
Expand Down
13 changes: 6 additions & 7 deletions src/pages/account/register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,11 @@ import {
getResponse,
resetCaptcha,
} from "../../stores/useRecaptcha";
import { useHead } from '@unhead/vue'
import { useHead } from "@unhead/vue";
export default {
components: { LoadingDialog },
setup() {
useHead({
title: '注册',
});
},
data() {
return {
BASE_API: import.meta.env.VITE_APP_BASE_API,
Expand Down Expand Up @@ -280,9 +276,12 @@ export default {
if (localuser.islogin.value == true) {
this.$router.push("/");
}
initRecaptcha("recaptcha-div", "float");
},
setup() {
initRecaptcha("recaptcha-div", "float");
useHead({
title: "注册",
});
},
methods: {
async register() {
Expand Down
11 changes: 5 additions & 6 deletions 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'
import { useHead } from "@unhead/vue";
export default {
components: { LoadingDialog },
data() {
Expand Down Expand Up @@ -148,13 +148,12 @@ export default {
if (localuser.islogin.value == true) {
this.$router.push("/");
}
useHead({
title: '找回密码',
});
initRecaptcha("recaptcha-div", "float");
},
setup() {
initRecaptcha("recaptcha-div", "float");
useHead({
title: "找回密码",
});
},
methods: {
async login() {
Expand Down
11 changes: 5 additions & 6 deletions 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'
import { useHead } from "@unhead/vue";
export default {
components: { LoadingDialog },
data() {
Expand Down Expand Up @@ -164,13 +164,12 @@ export default {
if (localuser.islogin.value == true) {
this.$router.push("/");
}
useHead({
title: '重设密码',
});
initRecaptcha("recaptcha-div", "float");
},
setup() {
initRecaptcha("recaptcha-div", "float");
useHead({
title: "重设密码",
});
},
methods: {
async login() {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/account/totp/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ export default {
qrCodeUrl: "",
errorMessage: "",
};
},setup() {
},
setup() {
useHead({
title: '创建验证器',
title: "创建验证器",
});
},
methods: {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/account/totp/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ export default {
},
],
};
},setup() {
},
setup() {
useHead({
title: '验证器',
title: "验证器",
});
},
methods: {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/algolia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@

<script>
import { liteClient as algoliasearch } from "algoliasearch/lite";
import { useHead } from '@unhead/vue'
import { useHead } from "@unhead/vue";
export default {
setup() {
useHead({
title: 'Algolia Search',
title: "Algolia Search",
});
},
data() {
Expand Down
9 changes: 3 additions & 6 deletions src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,12 @@ import request from "../axios/axios";
import $vuetify from "@/plugins/vuetify";
import { localuser } from "../stores/user";
import Typewriter from "../components/Typewriter.vue";
import { useHead } from '@unhead/vue'
import { useHead } from "@unhead/vue";
export default {
components: { Typewriter },
setup() {
useHead({
});
useHead({});
},
data() {
return {
Expand Down Expand Up @@ -273,8 +271,7 @@ export default {
{
title: "加入我们/合作/拉赞助",
subtitle:
"欢迎",
subtitle: "欢迎",
avatar: "https://langs.ink/jacopo-logo.webp",
link: "https://langsteam.feishu.cn/share/base/form/shrcn5jhvy96A93Gx9JWaEAofac",
},
Expand Down
28 changes: 7 additions & 21 deletions src/pages/projectlist/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default {
data() {
return {
localuser: localuser,
projectlist: {
status: "1",
message: "加载中",
Expand Down Expand Up @@ -81,25 +82,11 @@ export default {
title: "ZeroCat - 列表",
});
},
async created() {
init({
el: "#waline",
serverURL: "https://zerocat-waline.190823.xyz",
path: "projectlist-" + 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,
});
if (this.localuser.islogin == false) {
this.$router.push("/account/login");
}
},
methods: {
async getprojectlist() {
Expand All @@ -113,9 +100,8 @@ export default {
this.$router.push("/404");
}
useHead({
title: '' + this.projectlist.title,
});
title: "" + this.projectlist.title,
});
console.log(this.projectlist);
},
},
Expand Down
15 changes: 10 additions & 5 deletions src/pages/projectlist/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,28 @@ export default {
data() {
return {
localuser: localuser,
userinfo: localuser.user,
editlistid: 0,
EditProjectListConfigDialog: false,
NewProjectListDialog: false,
lists: [],
};
},setup() {
},
setup() {
useHead({
title: '列表',
title: "列表",
});
},
async created() {
if (this.localuser.islogin == false) {
this.$router.push("/account/login");
}
},
methods: {
async getProjectList() {
this.lists = (
await request({
url: "/projectlist/user/" + this.userinfo.userid,
url: "/projectlist/user/" + this.localuser.user.userid,
method: "get",
})
).data;
Expand Down
11 changes: 6 additions & 5 deletions src/pages/projects/[id]/fork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ export default {
},
async created() {
if (this.localuser.islogin == false) {
this.$router.push("/account/login");
}
await this.getproject();
},
setup() {
useHead({
title: '分叉',
title: "分叉",
});
},
methods: {
Expand All @@ -134,9 +136,8 @@ export default {
method: "get",
});
useHead({
title: '分叉'+this.project.title,
});
title: "分叉" + this.project.title,
});
console.log(this.project);
},
async forkproject(id) {
Expand Down
Loading

0 comments on commit c5e2763

Please sign in to comment.