's'调试支付
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
const PB_URL = process.env.POCKETBASE_URL || "https://pocketbase.hackrobot.cn";
|
||||
const COLLECTION = "solan";
|
||||
import { getPocketBaseConfig } from "@/config/services.config";
|
||||
import { getThemeConfig } from "@/config";
|
||||
|
||||
function getOrCreateUserId(): string {
|
||||
return `user${Date.now()}`;
|
||||
@@ -62,13 +61,19 @@ export async function POST(request: NextRequest) {
|
||||
(record as Record<string, string>)["media"] = mediaUrl;
|
||||
}
|
||||
|
||||
const theme = getThemeConfig();
|
||||
const pb = getPocketBaseConfig({
|
||||
joinCollection: theme.services?.pocketbaseJoinCollection,
|
||||
});
|
||||
const collection = pb.joinCollection;
|
||||
|
||||
const doCreate = async (authToken?: string) => {
|
||||
const headers: Record<string, string> = {
|
||||
"Content-Type": "application/json",
|
||||
};
|
||||
if (authToken) headers["Authorization"] = authToken;
|
||||
|
||||
return fetch(`${PB_URL}/api/collections/${COLLECTION}/records`, {
|
||||
return fetch(`${pb.url}/api/collections/${collection}/records`, {
|
||||
method: "POST",
|
||||
headers,
|
||||
body: JSON.stringify(record),
|
||||
|
||||
Reference in New Issue
Block a user