This commit is contained in:
ryan
2026-06-09 08:28:04 +08:00
parent 7579d3865f
commit b0023787c5
22 changed files with 68 additions and 109 deletions
-1
View File
@@ -43,7 +43,6 @@ Thumbs.db
# go workspace # go workspace
go.work go.work
go.work.sum go.work.sum
/credit
main main
# upload # upload
+6 -6
View File
@@ -12,10 +12,10 @@ RUN corepack enable && corepack prepare pnpm@10.10.0 --activate
FROM base AS builder FROM base AS builder
ENV NODE_ENV=production ENV NODE_ENV=production
ENV NEXT_PUBLIC_LINUX_DO_CREDIT_BACKEND_URL=https://build-placeholder.invalid ENV NEXT_PUBLIC_WAVELET_BACKEND_URL=https://build-placeholder.invalid
ENV LINUX_DO_CREDIT_SESSION_COOKIE_NAME=__LINUX_DO_CREDIT_SESSION_COOKIE_NAME__ ENV WAVELET_SESSION_COOKIE_NAME=__WAVELET_SESSION_COOKIE_NAME__
ENV LINUX_DO_CREDIT_RATE_LIMIT_ENABLED=__LINUX_DO_CREDIT_RATE_LIMIT_ENABLED__ ENV WAVELET_RATE_LIMIT_ENABLED=__WAVELET_RATE_LIMIT_ENABLED__
ENV LINUX_DO_CREDIT_BACKEND_URL=https://build-placeholder-2.invalid ENV WAVELET_BACKEND_URL=https://build-placeholder-2.invalid
ARG VERSION="" ARG VERSION=""
ARG BUILD_DATE="" ARG BUILD_DATE=""
@@ -36,8 +36,8 @@ RUN pnpm build
RUN grep -rl \ RUN grep -rl \
-e "https://build-placeholder.invalid" \ -e "https://build-placeholder.invalid" \
-e "https://build-placeholder-2.invalid" \ -e "https://build-placeholder-2.invalid" \
-e "__LINUX_DO_CREDIT_SESSION_COOKIE_NAME__" \ -e "__WAVELET_SESSION_COOKIE_NAME__" \
-e "__LINUX_DO_CREDIT_RATE_LIMIT_ENABLED__" \ -e "__WAVELET_RATE_LIMIT_ENABLED__" \
/app/.next > /app/.replace.files /app/.next > /app/.replace.files
FROM base AS runner FROM base AS runner
+1 -1
View File
@@ -196,7 +196,7 @@ server {
exec_mode: 'cluster', exec_mode: 'cluster',
env: { env: {
NODE_ENV: 'production', NODE_ENV: 'production',
LINUX_DO_CREDIT_BACKEND_URL: 'https://api.yourdomain.com' WAVELET_BACKEND_URL: 'https://api.yourdomain.com'
} }
} }
] ]
+4 -4
View File
@@ -10,8 +10,8 @@ const docTemplate = `{
"description": "{{escape .Description}}", "description": "{{escape .Description}}",
"title": "{{.Title}}", "title": "{{.Title}}",
"contact": { "contact": {
"name": "LINUX DO Credit", "name": "Wavelet",
"url": "https://linux.do" "url": "https://github.com/Rain-kl/Wavelet"
}, },
"license": { "license": {
"name": "Apache 2.0", "name": "Apache 2.0",
@@ -4399,8 +4399,8 @@ var SwaggerInfo = &swag.Spec{
Host: "", Host: "",
BasePath: "/", BasePath: "/",
Schemes: []string{}, Schemes: []string{},
Title: "LINUX DO Credit", Title: "Wavelet API",
Description: "LINUX DO Credit 平台后端 API,提供用户认证、商户 API Key 管理、系统配置等功能。", Description: "Wavelet 平台后端 API,提供用户认证、系统配置、任务调度等通用功能。",
InfoInstanceName: "swagger", InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate, SwaggerTemplate: docTemplate,
LeftDelim: "{{", LeftDelim: "{{",
+4 -4
View File
@@ -1,11 +1,11 @@
{ {
"swagger": "2.0", "swagger": "2.0",
"info": { "info": {
"description": "LINUX DO Credit 平台后端 API,提供用户认证、商户 API Key 管理、系统配置等功能。", "description": "Wavelet 平台后端 API,提供用户认证、系统配置、任务调度等通用功能。",
"title": "LINUX DO Credit", "title": "Wavelet API",
"contact": { "contact": {
"name": "LINUX DO Credit", "name": "Wavelet",
"url": "https://linux.do" "url": "https://github.com/Rain-kl/Wavelet"
}, },
"license": { "license": {
"name": "Apache 2.0", "name": "Apache 2.0",
+4 -4
View File
@@ -788,13 +788,13 @@ definitions:
type: object type: object
info: info:
contact: contact:
name: LINUX DO Credit name: Wavelet
url: https://linux.do url: https://github.com/Rain-kl/Wavelet
description: LINUX DO Credit 平台后端 API,提供用户认证、商户 API Key 管理、系统配置等功能。 description: Wavelet 平台后端 API,提供用户认证、系统配置、任务调度等通用功能。
license: license:
name: Apache 2.0 name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html url: http://www.apache.org/licenses/LICENSE-2.0.html
title: LINUX DO Credit title: Wavelet API
version: 1.0.0 version: 1.0.0
paths: paths:
/api/cap/challenge: /api/cap/challenge:
+3 -3
View File
@@ -1,11 +1,11 @@
# 前端 URL # 前端 URL
LINUX_DO_CREDIT_FRONTEND_URL=http://localhost:3000 WAVELET_FRONTEND_URL=http://localhost:3000
# 后端 URL # 后端 URL
LINUX_DO_CREDIT_BACKEND_URL=http://localhost:8000 WAVELET_BACKEND_URL=http://localhost:8000
# Session Cookie # Session Cookie
LINUX_DO_CREDIT_SESSION_COOKIE_NAME=linux_do_credit_session_id WAVELET_SESSION_COOKIE_NAME=wavelet_session_id
# 环境 # 环境
NODE_ENV=production NODE_ENV=production
+2 -2
View File
@@ -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 [中文](./README_zh.md) | English
+2 -2
View File
@@ -1,6 +1,6 @@
# Linux Do Credit Frontend # Wavelet Frontend
Linux Do Credit 系统的现代化前端应用。 Wavelet 脚手架系统的现代化前端应用。
[English](./README.md) | 中文 [English](./README.md) | 中文
+3 -4
View File
@@ -1,6 +1,5 @@
import {LegalPageLayout} from "@/components/common/docs/legal-page-layout";
import { LegalPageLayout } from "@/components/common/docs/legal-page-layout"; import {apiSections, DOCS_LAST_UPDATED} from "@/components/common/docs/api";
import { apiSections, DOCS_LAST_UPDATED } from "@/components/common/docs/api";
export default function ApiDocPage() { export default function ApiDocPage() {
return ( return (
@@ -10,7 +9,7 @@ export default function ApiDocPage() {
sections={apiSections} sections={apiSections}
description={ description={
<p className="text-muted-foreground text-sm leading-relaxed"> <p className="text-muted-foreground text-sm leading-relaxed">
LINUX DO Credit 提供简单、强大的 API 接口,支持多种编程语言和开发环境。通过标准化的 HTTP 接口,您可以轻松将积分服务集成到您的应用中。 Wavelet 提供简单、强大的 API 接口,支持多种编程语言和开发环境。通过标准化的 RESTful 接口,您可以轻松地与后端服务进行集成与二次开发。
</p> </p>
} }
/> />
+4 -5
View File
@@ -1,7 +1,6 @@
import {LegalPageLayout} from "@/components/common/docs/legal-page-layout";
import { LegalPageLayout } from "@/components/common/docs/legal-page-layout"; import {howToUseSections} from "@/components/common/docs/how-to-use";
import { howToUseSections } from "@/components/common/docs/how-to-use"; import {DOCS_LAST_UPDATED} from "@/components/common/docs/api";
import { DOCS_LAST_UPDATED } from "@/components/common/docs/api";
export default function HowToUsePage() { export default function HowToUsePage() {
return ( return (
@@ -11,7 +10,7 @@ export default function HowToUsePage() {
sections={howToUseSections} sections={howToUseSections}
description={ description={
<p className="text-muted-foreground text-sm leading-relaxed"> <p className="text-muted-foreground text-sm leading-relaxed">
欢迎使用 LINUX DO Credit。本文档将引导您快速了解平台的核心功能、角色定义及使用流程,帮助您更好地使用我们的服务。 欢迎使用 Wavelet 脚手架系统。本文档将引导您快速了解平台的核心组件、角色权限设计及二次开发流程,帮助您快速上手开发。
</p> </p>
} }
/> />
+12 -36
View File
@@ -1,40 +1,16 @@
"use client" "use client"
import * as React from "react" import * as React from "react"
import { useState, useMemo } from "react" import {useMemo, useState} from "react"
import { motion, AnimatePresence } from "motion/react" import {AnimatePresence, motion} from "motion/react"
import { import {Card, CardContent, CardDescription, CardHeader, CardTitle} from "@/components/ui/card"
Card, import {Badge} from "@/components/ui/badge"
CardContent, import {Button} from "@/components/ui/button"
CardHeader, import {Progress} from "@/components/ui/progress"
CardTitle, import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs"
CardDescription import {Activity, ArrowRight, Check, Code2, Coins, Copy, Gift, Info, Layers, Shield, User} from "lucide-react"
} from "@/components/ui/card" import {Area, AreaChart, ResponsiveContainer, Tooltip as RechartsTooltip, XAxis} from "recharts"
import { Badge } from "@/components/ui/badge" import {toast} from "sonner"
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"
// ========================================== // ==========================================
// 1. 卡片类组件 (Cards) // 1. 卡片类组件 (Cards)
@@ -650,7 +626,7 @@ export function MockTradeTabs() {
<div className="grid grid-cols-1 md:grid-cols-3 gap-4"> <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<FeatureCard <FeatureCard
title="接入官方 API 接口" title="接入官方 API 接口"
description="使用官方 API 接口(兼容易支付),快速接入积分服务,支持异步通知和同步跳转。" description="使用系统内置的 API 接口,支持快速接入、异步通知和同步跳转等标准流程。"
linkText="查看文档" linkText="查看文档"
href="/docs/api" href="/docs/api"
/> />
@@ -662,7 +638,7 @@ export function MockTradeTabs() {
/> />
<FeatureCard <FeatureCard
title="面对面服务" title="面对面服务"
description="通过 LINUX DO Credit 提供的面对面服务功能,扩展您的积分收益渠道,处理面对面服务场景。" description="通过系统支持的离线与面对面服务接口,扩展应用功能,处理各种场景下的交互需求。"
linkText="功能开发中,敬请期待" linkText="功能开发中,敬请期待"
/> />
</div> </div>
@@ -16,7 +16,7 @@ interface LogEntry {
} }
function getApiBaseUrl(): string { function getApiBaseUrl(): string {
return process.env.NEXT_PUBLIC_LINUX_DO_CREDIT_BACKEND_URL || "" return process.env.NEXT_PUBLIC_WAVELET_BACKEND_URL || ""
} }
function buildWsUrl(): string { 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"> <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/issues">GitHub Issues</FooterLink></li>
<li><FooterLink href="https://github.com/Rain-kl/Wavelet/discussions">讨论</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> </ul>
</div> </div>
</div> </div>
+6 -7
View File
@@ -1,8 +1,8 @@
import * as React from "react" import * as React from "react"
import { motion } from "motion/react" import {motion} from "motion/react"
import { Badge } from "@/components/ui/badge" import {Badge} from "@/components/ui/badge"
import { cn } from "@/lib/utils" import {cn} from "@/lib/utils"
import { FileTextIcon } from "lucide-react" import {FileTextIcon} from "lucide-react"
/** /**
* 加载页面组件 * 加载页面组件
@@ -74,7 +74,7 @@ function LoadingCard() {
</div> </div>
<div className="font-serif italic text-xl font-bold tracking-widest text-white drop-shadow-md"> <div className="font-serif italic text-xl font-bold tracking-widest text-white drop-shadow-md">
Credit Wavelet
</div> </div>
</div> </div>
</div> </div>
@@ -130,8 +130,7 @@ export function LoadingPage({ text = "系统", badgeText = "系统" }: { text?:
transition={{ delay: 0.2 }} transition={{ delay: 0.2 }}
className="relative flex items-center justify-center gap-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-3xl font-bold tracking-tight text-foreground">Wavelet</span>
<span className="text-4xl font-serif font-bold italic text-primary">Credit</span>
{badgeText && ( {badgeText && (
<div className="absolute left-full top-1/3 -translate-y-1/2 ml-2"> <div className="absolute left-full top-1/3 -translate-y-1/2 ml-2">
+4 -4
View File
@@ -31,9 +31,9 @@ replace_placeholder() {
fi fi
} }
replace_placeholder "https://build-placeholder.invalid" "$NEXT_PUBLIC_LINUX_DO_CREDIT_BACKEND_URL" replace_placeholder "https://build-placeholder.invalid" "$NEXT_PUBLIC_WAVELET_BACKEND_URL"
replace_placeholder "https://build-placeholder-2.invalid" "$LINUX_DO_CREDIT_BACKEND_URL" replace_placeholder "https://build-placeholder-2.invalid" "$WAVELET_BACKEND_URL"
replace_placeholder "__LINUX_DO_CREDIT_SESSION_COOKIE_NAME__" "$LINUX_DO_CREDIT_SESSION_COOKIE_NAME" replace_placeholder "__WAVELET_SESSION_COOKIE_NAME__" "$WAVELET_SESSION_COOKIE_NAME"
replace_placeholder "__LINUX_DO_CREDIT_RATE_LIMIT_ENABLED__" "$LINUX_DO_CREDIT_RATE_LIMIT_ENABLED" replace_placeholder "__WAVELET_RATE_LIMIT_ENABLED__" "$WAVELET_RATE_LIMIT_ENABLED"
exec "$@" exec "$@"
+1 -1
View File
@@ -7,7 +7,7 @@
* @returns API 基础 URL * @returns API 基础 URL
*/ */
export function getApiBaseUrl(): string { export function getApiBaseUrl(): string {
return process.env.NEXT_PUBLIC_LINUX_DO_CREDIT_BACKEND_URL || ''; return process.env.NEXT_PUBLIC_WAVELET_BACKEND_URL || '';
} }
/** /**
+1 -1
View File
@@ -8,7 +8,7 @@ const nextConfig: NextConfig = {
}, },
...(isExport ? { output: 'export' } : { ...(isExport ? { output: 'export' } : {
async rewrites() { 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 [ return [
// 易支付兼容接口 - 创建订单 // 易支付兼容接口 - 创建订单
{ {
+4 -4
View File
@@ -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 代理层 * Next.js 16 代理层
@@ -78,12 +78,12 @@ if (typeof setInterval !== 'undefined') {
export function proxy(request: NextRequest) { export function proxy(request: NextRequest) {
const { pathname, search } = request.nextUrl 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) const sessionCookie = request.cookies.get(sessionCookieName)
/* API 请求:速率限制后放行 */ /* API 请求:速率限制后放行 */
if (pathname.startsWith('/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)) { if (rateLimitEnabled && shouldRateLimit(pathname)) {
const identifier = sessionCookie?.value || const identifier = sessionCookie?.value ||
-5
View File
@@ -16,8 +16,3 @@ limitations under the License.
*/ */
package user package user
const (
// linuxDoAPIRateLimitKey Redis 限流 Key
linuxDoAPIRateLimitKey = "linux_do:api:rate_limit"
)
-7
View File
@@ -16,10 +16,3 @@ limitations under the License.
*/ */
package common package common
const (
// PayTypeLDCPay Linux Do Credit 支付类型标识
PayTypeLDCPay = "ldcpay"
// PayTypeEPay Epay 支付类型
PayTypeEPay = "epay"
)
+4 -4
View File
@@ -19,11 +19,11 @@ package main
import "github.com/Rain-kl/Wavelet/internal/cmd" import "github.com/Rain-kl/Wavelet/internal/cmd"
// @title LINUX DO Credit // @title Wavelet API
// @version 1.0.0 // @version 1.0.0
// @description LINUX DO Credit 平台后端 API,提供用户认证、商户 API Key 管理、系统配置等功能。 // @description Wavelet 平台后端 API,提供用户认证、系统配置、任务调度等通用功能。
// @contact.name LINUX DO Credit // @contact.name Wavelet
// @contact.url https://linux.do // @contact.url https://github.com/Rain-kl/Wavelet
// @license.name Apache 2.0 // @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html // @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @BasePath / // @BasePath /