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 +7,7 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Card } from '@/components/ui/card';
import { Skeleton } from '@/components/ui/skeleton';
import { API_BASE } from '@/lib/config';
export default function EditContentPage() {
const params = useParams();
@@ -17,7 +18,7 @@ export default function EditContentPage() {
useEffect(() => { loadContent(); }, [params.id]);
const base = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000';
const base = API_BASE;
function token() { return localStorage.getItem('adminToken'); }
function headers() {
const t = token();
@@ -26,7 +27,7 @@ export default function EditContentPage() {
async function loadContent() {
try {
const res = await fetch(`${base}/api/v1/contents/${params.id}`, { headers: headers() });
const res = await fetch(`${base}/contents/${params.id}`, { headers: headers() });
if (res.ok) {
const data = await res.json();
setForm({ title: data.title || '', summary: data.summary || '', content: data.content || '', cover: data.cover || '', contentType: data.contentType || 'article' });
@@ -40,7 +41,7 @@ export default function EditContentPage() {
if (!form.title.trim() || !form.content.trim()) return;
setSubmitting(true);
try {
const res = await fetch(`${base}/api/v1/contents/${params.id}`, {
const res = await fetch(`${base}/contents/${params.id}`, {
method: 'PUT', headers: headers(), body: JSON.stringify(form),
});
if (res.ok) router.push('/admin/contents');