mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 07:06:36 +08:00
fix
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# 前端 URL
|
||||
LINUX_DO_CREDIT_FRONTEND_URL=http://localhost:3000
|
||||
WAVELET_FRONTEND_URL=http://localhost:3000
|
||||
|
||||
# 后端 URL
|
||||
LINUX_DO_CREDIT_BACKEND_URL=http://localhost:8000
|
||||
WAVELET_BACKEND_URL=http://localhost:8000
|
||||
|
||||
# Session Cookie
|
||||
LINUX_DO_CREDIT_SESSION_COOKIE_NAME=linux_do_credit_session_id
|
||||
WAVELET_SESSION_COOKIE_NAME=wavelet_session_id
|
||||
|
||||
# 环境
|
||||
NODE_ENV=production
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# Linux Do Credit Frontend
|
||||
# Wavelet Frontend
|
||||
|
||||
Modern frontend application for the Linux Do Credit system.
|
||||
Modern frontend application for the Wavelet scaffold framework.
|
||||
|
||||
[中文](./README_zh.md) | English
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Linux Do Credit Frontend
|
||||
# Wavelet Frontend
|
||||
|
||||
Linux Do Credit 系统的现代化前端应用。
|
||||
Wavelet 脚手架系统的现代化前端应用。
|
||||
|
||||
[English](./README.md) | 中文
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
import { LegalPageLayout } from "@/components/common/docs/legal-page-layout";
|
||||
import { apiSections, DOCS_LAST_UPDATED } from "@/components/common/docs/api";
|
||||
import {LegalPageLayout} from "@/components/common/docs/legal-page-layout";
|
||||
import {apiSections, DOCS_LAST_UPDATED} from "@/components/common/docs/api";
|
||||
|
||||
export default function ApiDocPage() {
|
||||
return (
|
||||
@@ -10,7 +9,7 @@ export default function ApiDocPage() {
|
||||
sections={apiSections}
|
||||
description={
|
||||
<p className="text-muted-foreground text-sm leading-relaxed">
|
||||
LINUX DO Credit 提供简单、强大的 API 接口,支持多种编程语言和开发环境。通过标准化的 HTTP 接口,您可以轻松将积分服务集成到您的应用中。
|
||||
Wavelet 提供简单、强大的 API 接口,支持多种编程语言和开发环境。通过标准化的 RESTful 接口,您可以轻松地与后端服务进行集成与二次开发。
|
||||
</p>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
import { LegalPageLayout } from "@/components/common/docs/legal-page-layout";
|
||||
import { howToUseSections } from "@/components/common/docs/how-to-use";
|
||||
import { DOCS_LAST_UPDATED } from "@/components/common/docs/api";
|
||||
import {LegalPageLayout} from "@/components/common/docs/legal-page-layout";
|
||||
import {howToUseSections} from "@/components/common/docs/how-to-use";
|
||||
import {DOCS_LAST_UPDATED} from "@/components/common/docs/api";
|
||||
|
||||
export default function HowToUsePage() {
|
||||
return (
|
||||
@@ -11,7 +10,7 @@ export default function HowToUsePage() {
|
||||
sections={howToUseSections}
|
||||
description={
|
||||
<p className="text-muted-foreground text-sm leading-relaxed">
|
||||
欢迎使用 LINUX DO Credit。本文档将引导您快速了解平台的核心功能、角色定义及使用流程,帮助您更好地使用我们的服务。
|
||||
欢迎使用 Wavelet 脚手架系统。本文档将引导您快速了解平台的核心组件、角色权限设计及二次开发流程,帮助您快速上手开发。
|
||||
</p>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -1,40 +1,16 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import { useState, useMemo } from "react"
|
||||
import { motion, AnimatePresence } from "motion/react"
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
CardDescription
|
||||
} from "@/components/ui/card"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Progress } from "@/components/ui/progress"
|
||||
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"
|
||||
import {
|
||||
Coins,
|
||||
Gift,
|
||||
Layers,
|
||||
Shield,
|
||||
Info,
|
||||
ArrowRight,
|
||||
Activity,
|
||||
User,
|
||||
Code2,
|
||||
Copy,
|
||||
Check
|
||||
} from "lucide-react"
|
||||
import {
|
||||
Area,
|
||||
AreaChart,
|
||||
XAxis,
|
||||
ResponsiveContainer,
|
||||
Tooltip as RechartsTooltip
|
||||
} from "recharts"
|
||||
import { toast } from "sonner"
|
||||
import {useMemo, useState} from "react"
|
||||
import {AnimatePresence, motion} from "motion/react"
|
||||
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from "@/components/ui/card"
|
||||
import {Badge} from "@/components/ui/badge"
|
||||
import {Button} from "@/components/ui/button"
|
||||
import {Progress} from "@/components/ui/progress"
|
||||
import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs"
|
||||
import {Activity, ArrowRight, Check, Code2, Coins, Copy, Gift, Info, Layers, Shield, User} from "lucide-react"
|
||||
import {Area, AreaChart, ResponsiveContainer, Tooltip as RechartsTooltip, XAxis} from "recharts"
|
||||
import {toast} from "sonner"
|
||||
|
||||
// ==========================================
|
||||
// 1. 卡片类组件 (Cards)
|
||||
@@ -650,7 +626,7 @@ export function MockTradeTabs() {
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<FeatureCard
|
||||
title="接入官方 API 接口"
|
||||
description="使用官方 API 接口(兼容易支付),快速接入积分服务,支持异步通知和同步跳转。"
|
||||
description="使用系统内置的 API 接口,支持快速接入、异步通知和同步跳转等标准流程。"
|
||||
linkText="查看文档"
|
||||
href="/docs/api"
|
||||
/>
|
||||
@@ -662,7 +638,7 @@ export function MockTradeTabs() {
|
||||
/>
|
||||
<FeatureCard
|
||||
title="面对面服务"
|
||||
description="通过 LINUX DO Credit 提供的面对面服务功能,扩展您的积分收益渠道,处理面对面服务场景。"
|
||||
description="通过系统支持的离线与面对面服务接口,扩展应用功能,处理各种场景下的交互需求。"
|
||||
linkText="功能开发中,敬请期待"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ interface LogEntry {
|
||||
}
|
||||
|
||||
function getApiBaseUrl(): string {
|
||||
return process.env.NEXT_PUBLIC_LINUX_DO_CREDIT_BACKEND_URL || ""
|
||||
return process.env.NEXT_PUBLIC_WAVELET_BACKEND_URL || ""
|
||||
}
|
||||
|
||||
function buildWsUrl(): string {
|
||||
|
||||
@@ -54,7 +54,6 @@ export const FooterSection = React.memo(function FooterSection({ className }: Fo
|
||||
<ul className="space-y-4 text-sm text-muted-foreground">
|
||||
<li><FooterLink href="https://github.com/Rain-kl/Wavelet/issues">GitHub Issues</FooterLink></li>
|
||||
<li><FooterLink href="https://github.com/Rain-kl/Wavelet/discussions">讨论</FooterLink></li>
|
||||
<li><FooterLink href="https://linux.do/">LINUX DO</FooterLink></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as React from "react"
|
||||
import { motion } from "motion/react"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { FileTextIcon } from "lucide-react"
|
||||
import {motion} from "motion/react"
|
||||
import {Badge} from "@/components/ui/badge"
|
||||
import {cn} from "@/lib/utils"
|
||||
import {FileTextIcon} from "lucide-react"
|
||||
|
||||
/**
|
||||
* 加载页面组件
|
||||
*
|
||||
*
|
||||
* 用于统一显示加载状态
|
||||
* @example
|
||||
* ```tsx
|
||||
@@ -74,7 +74,7 @@ function LoadingCard() {
|
||||
</div>
|
||||
|
||||
<div className="font-serif italic text-xl font-bold tracking-widest text-white drop-shadow-md">
|
||||
Credit
|
||||
Wavelet
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -114,7 +114,7 @@ function LoadingCard() {
|
||||
|
||||
/**
|
||||
* 加载页面组件
|
||||
*
|
||||
*
|
||||
* 用于统一显示加载状态
|
||||
*/
|
||||
export function LoadingPage({ text = "系统", badgeText = "系统" }: { text?: string, badgeText?: string }) {
|
||||
@@ -130,8 +130,7 @@ export function LoadingPage({ text = "系统", badgeText = "系统" }: { text?:
|
||||
transition={{ delay: 0.2 }}
|
||||
className="relative flex items-center justify-center gap-2"
|
||||
>
|
||||
<span className="text-3xl font-bold tracking-tight text-foreground">LINUX DO</span>
|
||||
<span className="text-4xl font-serif font-bold italic text-primary">Credit</span>
|
||||
<span className="text-3xl font-bold tracking-tight text-foreground">Wavelet</span>
|
||||
|
||||
{badgeText && (
|
||||
<div className="absolute left-full top-1/3 -translate-y-1/2 ml-2">
|
||||
|
||||
@@ -31,9 +31,9 @@ replace_placeholder() {
|
||||
fi
|
||||
}
|
||||
|
||||
replace_placeholder "https://build-placeholder.invalid" "$NEXT_PUBLIC_LINUX_DO_CREDIT_BACKEND_URL"
|
||||
replace_placeholder "https://build-placeholder-2.invalid" "$LINUX_DO_CREDIT_BACKEND_URL"
|
||||
replace_placeholder "__LINUX_DO_CREDIT_SESSION_COOKIE_NAME__" "$LINUX_DO_CREDIT_SESSION_COOKIE_NAME"
|
||||
replace_placeholder "__LINUX_DO_CREDIT_RATE_LIMIT_ENABLED__" "$LINUX_DO_CREDIT_RATE_LIMIT_ENABLED"
|
||||
replace_placeholder "https://build-placeholder.invalid" "$NEXT_PUBLIC_WAVELET_BACKEND_URL"
|
||||
replace_placeholder "https://build-placeholder-2.invalid" "$WAVELET_BACKEND_URL"
|
||||
replace_placeholder "__WAVELET_SESSION_COOKIE_NAME__" "$WAVELET_SESSION_COOKIE_NAME"
|
||||
replace_placeholder "__WAVELET_RATE_LIMIT_ENABLED__" "$WAVELET_RATE_LIMIT_ENABLED"
|
||||
|
||||
exec "$@"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @returns API 基础 URL
|
||||
*/
|
||||
export function getApiBaseUrl(): string {
|
||||
return process.env.NEXT_PUBLIC_LINUX_DO_CREDIT_BACKEND_URL || '';
|
||||
return process.env.NEXT_PUBLIC_WAVELET_BACKEND_URL || '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ const nextConfig: NextConfig = {
|
||||
},
|
||||
...(isExport ? { output: 'export' } : {
|
||||
async rewrites() {
|
||||
const backendUrl = process.env.LINUX_DO_CREDIT_BACKEND_URL || 'http://localhost:8000';
|
||||
const backendUrl = process.env.WAVELET_BACKEND_URL || 'http://localhost:8000';
|
||||
return [
|
||||
// 易支付兼容接口 - 创建订单
|
||||
{
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import type { NextRequest } from 'next/server'
|
||||
import type {NextRequest} from 'next/server'
|
||||
import {NextResponse} from 'next/server'
|
||||
|
||||
/**
|
||||
* Next.js 16 代理层
|
||||
@@ -78,12 +78,12 @@ if (typeof setInterval !== 'undefined') {
|
||||
|
||||
export function proxy(request: NextRequest) {
|
||||
const { pathname, search } = request.nextUrl
|
||||
const sessionCookieName = process.env.LINUX_DO_CREDIT_SESSION_COOKIE_NAME || 'linux_do_credit_session_id'
|
||||
const sessionCookieName = process.env.WAVELET_SESSION_COOKIE_NAME || 'wavelet_session_id'
|
||||
const sessionCookie = request.cookies.get(sessionCookieName)
|
||||
|
||||
/* API 请求:速率限制后放行 */
|
||||
if (pathname.startsWith('/api/')) {
|
||||
const rateLimitEnabled = process.env.LINUX_DO_CREDIT_RATE_LIMIT_ENABLED === 'true'
|
||||
const rateLimitEnabled = process.env.WAVELET_RATE_LIMIT_ENABLED === 'true'
|
||||
|
||||
if (rateLimitEnabled && shouldRateLimit(pathname)) {
|
||||
const identifier = sessionCookie?.value ||
|
||||
|
||||
Reference in New Issue
Block a user