Compare commits
2 Commits
49ca1fac60
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| b4ad37a3b0 | |||
| e63dc09213 |
@@ -1,7 +1,11 @@
|
||||
<template>
|
||||
<Header />
|
||||
<main :class='[
|
||||
<<<<<<< HEAD
|
||||
"w-full", "h-full", "px-3",
|
||||
=======
|
||||
"w-full", "h-full",
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
"flex", "justify-center", "flex-1",
|
||||
"bg-neutral-100", "dark:bg-zinc-800",
|
||||
"text-black", "dark:text-white",
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="flex w-fit border rounded-lg p-2">
|
||||
<img
|
||||
:src="meData.user_icon"
|
||||
:alt="`${meData.username}さんのアイコン`"
|
||||
class="w-30 h-30 rounded-full"
|
||||
/>
|
||||
<div class="flex flex-col ml-2">
|
||||
<span class="text-2xl font-bold">{{ meData.username }}</span>
|
||||
<span>@{{ meData.userid }}@{{ hostname }}</span>
|
||||
|
||||
<textarea
|
||||
class="resize-none h-full"
|
||||
v-html="meData.profile"
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
defineProps<{
|
||||
meData: any;
|
||||
hostname: string;
|
||||
}>();
|
||||
</script>
|
||||
@@ -1,6 +1,10 @@
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
<<<<<<< HEAD
|
||||
max-height: fit-content;
|
||||
=======
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@@ -11,5 +15,8 @@ html {
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
min-height: 100vh;
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
}
|
||||
@@ -4,10 +4,14 @@ export async function isSignin(db: Database) {
|
||||
const origin = await getByIndex(db.server, "name", "origin");
|
||||
const token = await getByIndex(db.server, "name", "token");
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (!origin || !token) {
|
||||
=======
|
||||
if (
|
||||
origin === undefined ||
|
||||
token === undefined
|
||||
) {
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,117 @@
|
||||
<template>
|
||||
<<<<<<< HEAD
|
||||
<div
|
||||
v-if="processStatus === true"
|
||||
:class='[
|
||||
"fixed","inset-0", "flex", "flex-col", "z-49",
|
||||
"wrap-break-word", "items-center", "justify-center", "text-center",
|
||||
]'
|
||||
>
|
||||
<Progress />
|
||||
</div>
|
||||
|
||||
<div
|
||||
:class='[
|
||||
"flex", "flex-col", "items-center",
|
||||
"w-full", "h-full", "mt-2", "gap-3",
|
||||
]'
|
||||
v-else
|
||||
>
|
||||
<h1 class="text-2xl font-bold">こんにちは、{{ me.username }}さん</h1>
|
||||
|
||||
<div
|
||||
class="flex flex-wrap gap-3"
|
||||
id="followers"
|
||||
>
|
||||
<User
|
||||
v-for="follower in followers"
|
||||
:key="follower.id"
|
||||
:meData="follower"
|
||||
:hostname="hostname"
|
||||
class="grow"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Progress v-if='processStatus === "async"' />
|
||||
</div>
|
||||
=======
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useHead } from "@vueuse/head";
|
||||
<<<<<<< HEAD
|
||||
import Database, { getByIndex } from "@/lib/db";
|
||||
import useAPI from "@/lib/api";
|
||||
import { isSignin } from "@/lib/account";
|
||||
import { useRouter } from "vue-router";
|
||||
import { ref } from "vue";
|
||||
import Progress from "@/components/Progress.vue";
|
||||
import User from "@/components/User.vue";
|
||||
=======
|
||||
import Database from "@/lib/db";
|
||||
import { isSignin } from "@/lib/account";
|
||||
import { useRouter } from "vue-router";
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
|
||||
useHead({
|
||||
title: "ホーム | Clean Follow uwuzu",
|
||||
});
|
||||
|
||||
const db = new Database();
|
||||
<<<<<<< HEAD
|
||||
const router = useRouter();
|
||||
|
||||
const me = ref<any>();
|
||||
const followers = ref<any[]>([]);
|
||||
const processStatus = ref<boolean | "async">(false);
|
||||
const hostname = ref<string>("");
|
||||
|
||||
(async () => {
|
||||
processStatus.value = true;
|
||||
|
||||
if (!await isSignin(db)) {
|
||||
router.replace("/signin");
|
||||
return;
|
||||
}
|
||||
|
||||
const origin = await getByIndex(db.server, "name", "origin");
|
||||
const token = await getByIndex(db.server, "name", "token");
|
||||
if (!origin || !token) {
|
||||
router.replace("/signin");
|
||||
return;
|
||||
}
|
||||
|
||||
hostname.value = new window.URL(origin.value).hostname;
|
||||
|
||||
me.value = await useAPI(origin.value, "/me/", {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: token.value,
|
||||
}),
|
||||
});
|
||||
|
||||
processStatus.value = "async";
|
||||
for (const follower of me.value.follower) {
|
||||
const user = await useAPI(origin.value, "/users/", {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
body: JSON.stringify({
|
||||
token: token.value,
|
||||
userid: follower,
|
||||
}),
|
||||
});
|
||||
|
||||
followers.value.push(user);
|
||||
}
|
||||
|
||||
processStatus.value = false;
|
||||
}) ();
|
||||
=======
|
||||
|
||||
if (!await isSignin(db)) {
|
||||
useRouter().replace("/signin");
|
||||
}
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
</script>
|
||||
@@ -21,6 +21,12 @@
|
||||
]'
|
||||
>
|
||||
<h1 class="text-3xl font-bold">確認</h1>
|
||||
<<<<<<< HEAD
|
||||
<User
|
||||
:meData="meData"
|
||||
:hostname="hostname"
|
||||
/>
|
||||
=======
|
||||
<div class="flex w-full border rounded-lg p-2">
|
||||
<img
|
||||
:src="meData.user_icon"
|
||||
@@ -38,6 +44,7 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
<p>あなたは{{ meData.username }}ですか?</p>
|
||||
|
||||
<div class="flex gap-6">
|
||||
@@ -82,7 +89,12 @@ import useAPI from "@/lib/api";
|
||||
import Database from "@/lib/db";
|
||||
import Progress from "@/components/Progress.vue";
|
||||
import Button from "@/components/Button.vue";
|
||||
<<<<<<< HEAD
|
||||
import { ref } from "vue";import User from "@/components/User.vue";
|
||||
|
||||
=======
|
||||
import { ref } from "vue";
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
|
||||
const db = new Database();
|
||||
const query = useRoute().query;
|
||||
@@ -97,9 +109,14 @@ useHead({
|
||||
title: "サインイン処理 | Clean Follow uwuzu",
|
||||
});
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (await isSignin(db))
|
||||
useRouter().replace("/");
|
||||
=======
|
||||
if (await isSignin(db)) {
|
||||
useRouter().replace("/");
|
||||
}
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
|
||||
const stageDetails = {
|
||||
redirect: "リダイレクトしています",
|
||||
|
||||
@@ -93,9 +93,14 @@ useHead({
|
||||
title: "サインイン | Clean Follow uwuzu",
|
||||
});
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (await isSignin(new Database()))
|
||||
useRouter().replace("/");
|
||||
=======
|
||||
if (await isSignin(new Database())) {
|
||||
useRouter().replace("/");
|
||||
}
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
|
||||
const emit = defineEmits(["failed"]);
|
||||
const sprtVer = __CONFIG.uwuzu.supportedVersion;
|
||||
|
||||
@@ -17,7 +17,11 @@ export default defineConfig({
|
||||
min: "1.6.5",
|
||||
max: "1.6.10",
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
requiredScopes: ["read:me", "read:users"]
|
||||
=======
|
||||
requiredScopes: ["read:me"]
|
||||
>>>>>>> 49ca1fac60aecb94a7d76865c14a673f1ca1eccf
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user