mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 05:56:38 +08:00
fix
This commit is contained in:
@@ -43,7 +43,6 @@ Thumbs.db
|
||||
# go workspace
|
||||
go.work
|
||||
go.work.sum
|
||||
/credit
|
||||
main
|
||||
|
||||
# upload
|
||||
|
||||
@@ -12,10 +12,10 @@ RUN corepack enable && corepack prepare pnpm@10.10.0 --activate
|
||||
FROM base AS builder
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_PUBLIC_LINUX_DO_CREDIT_BACKEND_URL=https://build-placeholder.invalid
|
||||
ENV LINUX_DO_CREDIT_SESSION_COOKIE_NAME=__LINUX_DO_CREDIT_SESSION_COOKIE_NAME__
|
||||
ENV LINUX_DO_CREDIT_RATE_LIMIT_ENABLED=__LINUX_DO_CREDIT_RATE_LIMIT_ENABLED__
|
||||
ENV LINUX_DO_CREDIT_BACKEND_URL=https://build-placeholder-2.invalid
|
||||
ENV NEXT_PUBLIC_WAVELET_BACKEND_URL=https://build-placeholder.invalid
|
||||
ENV WAVELET_SESSION_COOKIE_NAME=__WAVELET_SESSION_COOKIE_NAME__
|
||||
ENV WAVELET_RATE_LIMIT_ENABLED=__WAVELET_RATE_LIMIT_ENABLED__
|
||||
ENV WAVELET_BACKEND_URL=https://build-placeholder-2.invalid
|
||||
|
||||
ARG VERSION=""
|
||||
ARG BUILD_DATE=""
|
||||
@@ -36,8 +36,8 @@ RUN pnpm build
|
||||
RUN grep -rl \
|
||||
-e "https://build-placeholder.invalid" \
|
||||
-e "https://build-placeholder-2.invalid" \
|
||||
-e "__LINUX_DO_CREDIT_SESSION_COOKIE_NAME__" \
|
||||
-e "__LINUX_DO_CREDIT_RATE_LIMIT_ENABLED__" \
|
||||
-e "__WAVELET_SESSION_COOKIE_NAME__" \
|
||||
-e "__WAVELET_RATE_LIMIT_ENABLED__" \
|
||||
/app/.next > /app/.replace.files
|
||||
|
||||
FROM base AS runner
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ server {
|
||||
exec_mode: 'cluster',
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
LINUX_DO_CREDIT_BACKEND_URL: 'https://api.yourdomain.com'
|
||||
WAVELET_BACKEND_URL: 'https://api.yourdomain.com'
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
+4
-4
@@ -10,8 +10,8 @@ const docTemplate = `{
|
||||
"description": "{{escape .Description}}",
|
||||
"title": "{{.Title}}",
|
||||
"contact": {
|
||||
"name": "LINUX DO Credit",
|
||||
"url": "https://linux.do"
|
||||
"name": "Wavelet",
|
||||
"url": "https://github.com/Rain-kl/Wavelet"
|
||||
},
|
||||
"license": {
|
||||
"name": "Apache 2.0",
|
||||
@@ -4399,8 +4399,8 @@ var SwaggerInfo = &swag.Spec{
|
||||
Host: "",
|
||||
BasePath: "/",
|
||||
Schemes: []string{},
|
||||
Title: "LINUX DO Credit",
|
||||
Description: "LINUX DO Credit 平台后端 API,提供用户认证、商户 API Key 管理、系统配置等功能。",
|
||||
Title: "Wavelet API",
|
||||
Description: "Wavelet 平台后端 API,提供用户认证、系统配置、任务调度等通用功能。",
|
||||
InfoInstanceName: "swagger",
|
||||
SwaggerTemplate: docTemplate,
|
||||
LeftDelim: "{{",
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"description": "LINUX DO Credit 平台后端 API,提供用户认证、商户 API Key 管理、系统配置等功能。",
|
||||
"title": "LINUX DO Credit",
|
||||
"description": "Wavelet 平台后端 API,提供用户认证、系统配置、任务调度等通用功能。",
|
||||
"title": "Wavelet API",
|
||||
"contact": {
|
||||
"name": "LINUX DO Credit",
|
||||
"url": "https://linux.do"
|
||||
"name": "Wavelet",
|
||||
"url": "https://github.com/Rain-kl/Wavelet"
|
||||
},
|
||||
"license": {
|
||||
"name": "Apache 2.0",
|
||||
|
||||
+4
-4
@@ -788,13 +788,13 @@ definitions:
|
||||
type: object
|
||||
info:
|
||||
contact:
|
||||
name: LINUX DO Credit
|
||||
url: https://linux.do
|
||||
description: LINUX DO Credit 平台后端 API,提供用户认证、商户 API Key 管理、系统配置等功能。
|
||||
name: Wavelet
|
||||
url: https://github.com/Rain-kl/Wavelet
|
||||
description: Wavelet 平台后端 API,提供用户认证、系统配置、任务调度等通用功能。
|
||||
license:
|
||||
name: Apache 2.0
|
||||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
title: LINUX DO Credit
|
||||
title: Wavelet API
|
||||
version: 1.0.0
|
||||
paths:
|
||||
/api/cap/challenge:
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
@@ -16,8 +16,3 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
package user
|
||||
|
||||
const (
|
||||
// linuxDoAPIRateLimitKey Redis 限流 Key
|
||||
linuxDoAPIRateLimitKey = "linux_do:api:rate_limit"
|
||||
)
|
||||
|
||||
@@ -16,10 +16,3 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
package common
|
||||
|
||||
const (
|
||||
// PayTypeLDCPay Linux Do Credit 支付类型标识
|
||||
PayTypeLDCPay = "ldcpay"
|
||||
// PayTypeEPay Epay 支付类型
|
||||
PayTypeEPay = "epay"
|
||||
)
|
||||
|
||||
@@ -19,11 +19,11 @@ package main
|
||||
|
||||
import "github.com/Rain-kl/Wavelet/internal/cmd"
|
||||
|
||||
// @title LINUX DO Credit
|
||||
// @title Wavelet API
|
||||
// @version 1.0.0
|
||||
// @description LINUX DO Credit 平台后端 API,提供用户认证、商户 API Key 管理、系统配置等功能。
|
||||
// @contact.name LINUX DO Credit
|
||||
// @contact.url https://linux.do
|
||||
// @description Wavelet 平台后端 API,提供用户认证、系统配置、任务调度等通用功能。
|
||||
// @contact.name Wavelet
|
||||
// @contact.url https://github.com/Rain-kl/Wavelet
|
||||
// @license.name Apache 2.0
|
||||
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
// @BasePath /
|
||||
|
||||
Reference in New Issue
Block a user