🚑 Fix request was not imported

This commit is contained in:
LittleSheep 2024-02-19 19:44:56 +08:00
parent 65ee99c213
commit 4101043d65
19 changed files with 21 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import { createSignal, Show } from "solid-js";
import styles from "./NameCard.module.css"; import styles from "./NameCard.module.css";
import { getAtk } from "../stores/userinfo.tsx"; import { getAtk } from "../stores/userinfo.tsx";
import { request } from "../scripts/request.ts";
export default function NameCard(props: { accountId: string, onError: (messasge: string | null) => void }) { export default function NameCard(props: { accountId: string, onError: (messasge: string | null) => void }) {
const [info, setInfo] = createSignal<any>(null); const [info, setInfo] = createSignal<any>(null);

View File

@ -1,6 +1,7 @@
import { closeModel, openModel } from "../../scripts/modals.ts"; import { closeModel, openModel } from "../../scripts/modals.ts";
import { createSignal, For, Match, Show, Switch } from "solid-js"; import { createSignal, For, Match, Show, Switch } from "solid-js";
import { getAtk, useUserinfo } from "../../stores/userinfo.tsx"; import { getAtk, useUserinfo } from "../../stores/userinfo.tsx";
import { request } from "../../scripts/request.ts";
import styles from "./PostPublish.module.css"; import styles from "./PostPublish.module.css";

View File

@ -3,6 +3,7 @@ import { createEffect, createMemo, createSignal, For, onMount, Show } from "soli
import Cherry from "cherry-markdown"; import Cherry from "cherry-markdown";
import "cherry-markdown/dist/cherry-markdown.min.css"; import "cherry-markdown/dist/cherry-markdown.min.css";
import { getAtk } from "../../stores/userinfo.tsx"; import { getAtk } from "../../stores/userinfo.tsx";
import { request } from "../../scripts/request.ts";
import PostEditActions from "./PostEditActions.tsx"; import PostEditActions from "./PostEditActions.tsx";
export default function PostEditor(props: { export default function PostEditor(props: {

View File

@ -1,5 +1,6 @@
import { createSignal, For, Show } from "solid-js"; import { createSignal, For, Show } from "solid-js";
import { getAtk, useUserinfo } from "../../stores/userinfo.tsx"; import { getAtk, useUserinfo } from "../../stores/userinfo.tsx";
import { request } from "../../scripts/request.ts";
import PostAttachments from "./PostAttachments.tsx"; import PostAttachments from "./PostAttachments.tsx";
import * as marked from "marked"; import * as marked from "marked";
import DOMPurify from "dompurify"; import DOMPurify from "dompurify";

View File

@ -4,6 +4,7 @@ import styles from "./PostList.module.css";
import PostItem from "./PostItem.tsx"; import PostItem from "./PostItem.tsx";
import LoadingAnimation from "../LoadingAnimation.tsx"; import LoadingAnimation from "../LoadingAnimation.tsx";
import { getAtk } from "../../stores/userinfo.tsx"; import { getAtk } from "../../stores/userinfo.tsx";
import { request } from "../../scripts/request.ts";
export default function PostList(props: { export default function PostList(props: {
noRelated?: boolean, noRelated?: boolean,

View File

@ -1,5 +1,6 @@
import { createEffect, createSignal, Show } from "solid-js"; import { createEffect, createSignal, Show } from "solid-js";
import { getAtk, useUserinfo } from "../../stores/userinfo.tsx"; import { getAtk, useUserinfo } from "../../stores/userinfo.tsx";
import { request } from "../../scripts/request.ts";
import styles from "./PostPublish.module.css"; import styles from "./PostPublish.module.css";
import PostEditActions from "./PostEditActions.tsx"; import PostEditActions from "./PostEditActions.tsx";

View File

@ -3,6 +3,7 @@ import { useParams } from "@solidjs/router";
import { useSearchParams } from "@solidjs/router"; import { useSearchParams } from "@solidjs/router";
import { createStore } from "solid-js/store"; import { createStore } from "solid-js/store";
import { closeModel, openModel } from "../scripts/modals.ts"; import { closeModel, openModel } from "../scripts/modals.ts";
import { request } from "../scripts/request.ts";
import PostList from "../components/posts/PostList.tsx"; import PostList from "../components/posts/PostList.tsx";
import NameCard from "../components/NameCard.tsx"; import NameCard from "../components/NameCard.tsx";

View File

@ -2,6 +2,7 @@ import { createSignal, Show } from "solid-js";
import { readProfiles } from "../../stores/userinfo.tsx"; import { readProfiles } from "../../stores/userinfo.tsx";
import { useNavigate } from "@solidjs/router"; import { useNavigate } from "@solidjs/router";
import Cookie from "universal-cookie"; import Cookie from "universal-cookie";
import { request } from "../../scripts/request.ts";
export default function AuthCallback() { export default function AuthCallback() {
const [error, setError] = createSignal<string | null>(null); const [error, setError] = createSignal<string | null>(null);

View File

@ -1,4 +1,5 @@
import { createSignal, Show } from "solid-js"; import { createSignal, Show } from "solid-js";
import { request } from "../../scripts/request.ts";
export default function AuthCallout() { export default function AuthCallout() {
const [error, setError] = createSignal<string | null>(null); const [error, setError] = createSignal<string | null>(null);

View File

@ -2,6 +2,7 @@ import PostEdit from "../../components/posts/PostEditor.tsx";
import { useNavigate, useParams } from "@solidjs/router"; import { useNavigate, useParams } from "@solidjs/router";
import { createSignal, Show } from "solid-js"; import { createSignal, Show } from "solid-js";
import { getAtk } from "../../stores/userinfo.tsx"; import { getAtk } from "../../stores/userinfo.tsx";
import { request } from "../../scripts/request.ts";
export default function PublishPost() { export default function PublishPost() {
const navigate = useNavigate(); const navigate = useNavigate();

View File

@ -2,6 +2,7 @@ import { createMemo, createSignal, For, Show } from "solid-js";
import { getAtk } from "../../stores/userinfo.tsx"; import { getAtk } from "../../stores/userinfo.tsx";
import LoadingAnimation from "../../components/LoadingAnimation.tsx"; import LoadingAnimation from "../../components/LoadingAnimation.tsx";
import styles from "../../components/posts/PostList.module.css"; import styles from "../../components/posts/PostList.module.css";
import { request } from "../../scripts/request.ts";
export default function CreatorHub() { export default function CreatorHub() {
const [error, setError] = createSignal<string | null>(null); const [error, setError] = createSignal<string | null>(null);

View File

@ -1,6 +1,7 @@
import { createEffect, createSignal, Show } from "solid-js"; import { createEffect, createSignal, Show } from "solid-js";
import { createStore } from "solid-js/store"; import { createStore } from "solid-js/store";
import { useSearchParams } from "@solidjs/router"; import { useSearchParams } from "@solidjs/router";
import { request } from "../scripts/request.ts";
import PostList from "../components/posts/PostList.tsx"; import PostList from "../components/posts/PostList.tsx";
import PostPublish from "../components/posts/PostPublish.tsx"; import PostPublish from "../components/posts/PostPublish.tsx";

View File

@ -2,10 +2,11 @@ import { createSignal, Show } from "solid-js";
import { useNavigate, useParams, useSearchParams } from "@solidjs/router"; import { useNavigate, useParams, useSearchParams } from "@solidjs/router";
import { createStore } from "solid-js/store"; import { createStore } from "solid-js/store";
import { closeModel, openModel } from "../scripts/modals.ts"; import { closeModel, openModel } from "../scripts/modals.ts";
import { getAtk } from "../stores/userinfo.tsx";
import { request } from "../scripts/request.ts";
import PostPublish from "../components/posts/PostPublish.tsx"; import PostPublish from "../components/posts/PostPublish.tsx";
import PostList from "../components/posts/PostList.tsx"; import PostList from "../components/posts/PostList.tsx";
import PostItem from "../components/posts/PostItem.tsx"; import PostItem from "../components/posts/PostItem.tsx";
import { getAtk } from "../stores/userinfo.tsx";
export default function PostPage() { export default function PostPage() {
const [error, setError] = createSignal<string | null>(null); const [error, setError] = createSignal<string | null>(null);

View File

@ -1,6 +1,7 @@
import { createSignal, For, Show } from "solid-js"; import { createSignal, For, Show } from "solid-js";
import { closeModel, openModel } from "../../scripts/modals.ts"; import { closeModel, openModel } from "../../scripts/modals.ts";
import { getAtk } from "../../stores/userinfo.tsx"; import { getAtk } from "../../stores/userinfo.tsx";
import { request } from "../../scripts/request.ts";
export default function RealmDirectoryPage() { export default function RealmDirectoryPage() {
const [error, setError] = createSignal<string | null>(null); const [error, setError] = createSignal<string | null>(null);

View File

@ -1,6 +1,7 @@
import { createSignal, Show } from "solid-js"; import { createSignal, Show } from "solid-js";
import { createStore } from "solid-js/store"; import { createStore } from "solid-js/store";
import { useNavigate, useParams } from "@solidjs/router"; import { useNavigate, useParams } from "@solidjs/router";
import { request } from "../../scripts/request.ts";
import PostList from "../../components/posts/PostList.tsx"; import PostList from "../../components/posts/PostList.tsx";
import PostPublish from "../../components/posts/PostPublish.tsx"; import PostPublish from "../../components/posts/PostPublish.tsx";

View File

@ -1,9 +1,10 @@
import { useNavigate, useSearchParams } from "@solidjs/router"; import { useNavigate, useSearchParams } from "@solidjs/router";
import { createSignal, Show } from "solid-js"; import { createSignal, Show } from "solid-js";
import { createStore } from "solid-js/store"; import { createStore } from "solid-js/store";
import { closeModel, openModel } from "../scripts/modals.ts";
import { request } from "../scripts/request.ts";
import PostPublish from "../components/posts/PostPublish.tsx"; import PostPublish from "../components/posts/PostPublish.tsx";
import PostList from "../components/posts/PostList.tsx"; import PostList from "../components/posts/PostList.tsx";
import { closeModel, openModel } from "../scripts/modals.ts";
export default function SearchPage() { export default function SearchPage() {
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();

View File

@ -1,4 +1,4 @@
async function request(input: string, init?: RequestInit) { export async function request(input: string, init?: RequestInit) {
const prefix = window.__LAUNCHPAD_TARGET__ ?? ""; const prefix = window.__LAUNCHPAD_TARGET__ ?? "";
return await fetch(prefix + input, init) return await fetch(prefix + input, init)
} }

View File

@ -1,6 +1,7 @@
import Cookie from "universal-cookie"; import Cookie from "universal-cookie";
import {createContext, useContext} from "solid-js"; import {createContext, useContext} from "solid-js";
import {createStore} from "solid-js/store"; import {createStore} from "solid-js/store";
import { request } from "../scripts/request.ts";
export interface Userinfo { export interface Userinfo {
isLoggedIn: boolean, isLoggedIn: boolean,

View File

@ -1,5 +1,6 @@
import { createContext, useContext } from "solid-js"; import { createContext, useContext } from "solid-js";
import { createStore } from "solid-js/store"; import { createStore } from "solid-js/store";
import { request } from "../scripts/request.ts";
const WellKnownContext = createContext<any>(); const WellKnownContext = createContext<any>();