feat: 支付闭环 + 运营助手 Tool Calling + 管理后台完善

- 支付系统:微信支付 mock 自动完成、NATIVE 扫码支付、JSAPI 集成
- 运营助手:Tool Calling 架构,19 个可执行工具,AI 驱动操作
- 角色管理:表格布局 + Dialog 表单 + 权限勾选
- 配置统一:config.ts 单一数据源
- API 审计:补齐 status toggle / comments 端点
- 暗黑模式硬件编码颜色全部替换为 CSS 变量
This commit is contained in:
yuzhiran-dev
2026-05-20 18:29:00 +08:00
parent 728edc59ef
commit 23edb74bce
76 changed files with 1589 additions and 473 deletions
+7 -6
View File
@@ -4,6 +4,7 @@ import { useEffect, useState } from 'react';
import Link from 'next/link';
import { useParams } from 'next/navigation';
import { Skeleton } from '@/components/ui/skeleton';
import { API_BASE } from '@/lib/config';
interface Post {
id: number;
@@ -36,8 +37,8 @@ export default function CircleDetail() {
if (token) headers['Authorization'] = `Bearer ${token}`;
const [circleRes, postsRes] = await Promise.all([
fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'}/api/v1/circles/${circleId}`, { headers }),
fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'}/api/v1/circles/${circleId}/posts`, { headers }),
fetch(`${API_BASE}/circles/${circleId}`, { headers }),
fetch(`${API_BASE}/circles/${circleId}/posts`, { headers }),
]);
if (circleRes.ok) setCircle(await circleRes.json());
@@ -47,7 +48,7 @@ export default function CircleDetail() {
}
if (token) {
const memRes = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'}/api/v1/circles/${circleId}/membership`, {
const memRes = await fetch(`${API_BASE}/circles/${circleId}/membership`, {
headers: { Authorization: `Bearer ${token}` },
});
if (memRes.ok) {
@@ -65,8 +66,8 @@ export default function CircleDetail() {
const method = isMember ? 'POST' : 'POST';
const url = isMember
? `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'}/api/v1/circles/${circleId}/leave`
: `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'}/api/v1/circles/${circleId}/join`;
? `${API_BASE}/circles/${circleId}/leave`
: `${API_BASE}/circles/${circleId}/join`;
try {
const res = await fetch(url, {
@@ -85,7 +86,7 @@ export default function CircleDetail() {
if (!token || !formTitle || !formContent) return;
try {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'}/api/v1/community/posts`, {
const res = await fetch(`${API_BASE}/community/posts`, {
method: 'POST',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ title: formTitle, content: formContent, circleId }),