From 9cb7d597cdcb914ccb89dade9c6dae64468c8c8e Mon Sep 17 00:00:00 2001 From: Eamon <17516219072@163.com> Date: Sat, 18 Apr 2026 17:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BD=91=E5=85=B3=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(root)/gateway/page.tsx | 14 +++++++++----- src/app/(root)/navigation.tsx | 2 ++ src/lib/scopes.ts | 7 ++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/app/(root)/gateway/page.tsx b/src/app/(root)/gateway/page.tsx index 9ef2e2c..549dee1 100644 --- a/src/app/(root)/gateway/page.tsx +++ b/src/app/(root)/gateway/page.tsx @@ -20,6 +20,8 @@ import { Button } from "@/components/ui/button" import type { Gateway } from "@/models/gateway" import CreatePage from "./create" import { format } from "date-fns" +import { ScopeProxyWrite } from "@/lib/scopes" +import { Auth } from "@/components/auth" export default function GatewayPage() { const [loading, setLoading] = useState(false) @@ -28,11 +30,13 @@ export default function GatewayPage() { return ( -
-
- + +
+
+ +
-
+ {...table} @@ -70,7 +74,7 @@ export default function GatewayPage() { header: "操作", cell: ({ row }) => (
- +
), }, diff --git a/src/app/(root)/navigation.tsx b/src/app/(root)/navigation.tsx index 4f6f2fa..d44e3ae 100644 --- a/src/app/(root)/navigation.tsx +++ b/src/app/(root)/navigation.tsx @@ -47,6 +47,7 @@ import { ScopeDiscountRead, ScopePermissionRead, ScopeProductRead, + ScopeProxyRead, ScopeResourceRead, ScopeTradeRead, ScopeUserRead, @@ -254,6 +255,7 @@ const menuSections: { title: string; items: NavItemProps[] }[] = [ href: "/gateway", icon: DoorClosedIcon, label: "网关列表", + requiredScope:ScopeProxyRead }, { href: "/admin", diff --git a/src/lib/scopes.ts b/src/lib/scopes.ts index 538dc0a..be40050 100644 --- a/src/lib/scopes.ts +++ b/src/lib/scopes.ts @@ -73,7 +73,6 @@ export const ScopeTrade = "trade" export const ScopeTradeRead = "trade:read" // 读取交易列表 export const ScopeTradeReadOfUser = "trade:read:of_user" // 读取指定用户的交易列表 export const ScopeTradeWrite = "trade:write" // 写入交易 -export const ScopeTradeWriteComplete = "trade:write:complete" // 完成交易 // 账单 export const ScopeBill = "bill" @@ -85,3 +84,9 @@ export const ScopeBillWrite = "bill:write" // 写入账单 export const ScopeBalanceActivity = "balance_activity" export const ScopeBalanceActivityRead = "balance_activity:read" // 读取余额变动列表 export const ScopeBalanceActivityReadOfUser = "balance_activity:read:of_user" // 读取指定用户的余额变动列表 + +// 代理 +export const ScopeProxy = "proxy" +export const ScopeProxyRead = "proxy:read" // 读取代理列表 +export const ScopeProxyWrite = "proxy:write" // 写入代理 +export const ScopeProxyWriteStatus = "proxy:write:status" // 更改代理状态 \ No newline at end of file