diff --git a/src/actions/coupon.ts b/src/actions/coupon.ts index c41f276..7198091 100644 --- a/src/actions/coupon.ts +++ b/src/actions/coupon.ts @@ -7,22 +7,28 @@ export async function getPagCoupon(params: { page: number; size: number }) { } export async function createCoupon(data: { - code: string + name: string amount: number - remark?: string - min_amount?: number + count: number + status: number + min_amount: number expire_at?: Date + expire_in?: number + expire_type: number }) { return callByUser("/api/admin/coupon/create", data) } export async function updateCoupon(data: { - code: string + id: number + name: string amount: number - remark?: string - min_amount?: number + min_amount: number + count: number + status: number + expire_type: number expire_at?: Date - status?: number + expire_in?: number }) { return callByUser("/api/admin/coupon/update", data) } @@ -32,3 +38,10 @@ export async function deleteCoupon(id: number) { id, }) } + +export async function issueCoupon(data: { + coupon_id: number + user_id: number +}) { + return callByUser("/api/admin/coupon/update/assign", data) +} diff --git a/src/actions/env.ts b/src/actions/env.ts new file mode 100644 index 0000000..5ae38de --- /dev/null +++ b/src/actions/env.ts @@ -0,0 +1,10 @@ +import { toast } from "sonner" + +const NODE_ENV = process.env.NODE_ENV + +export async function getNodeEnv() { + if (!NODE_ENV) { + toast.error(`接口请求错误:NODE_ENV为空`) + } + return NODE_ENV +} diff --git a/src/app/(root)/navigation.tsx b/src/app/(root)/_navigation/index.tsx similarity index 93% rename from src/app/(root)/navigation.tsx rename to src/app/(root)/_navigation/index.tsx index d44e3ae..f48a74d 100644 --- a/src/app/(root)/navigation.tsx +++ b/src/app/(root)/_navigation/index.tsx @@ -54,6 +54,7 @@ import { ScopeUserReadNotBind, ScopeUserReadOne, } from "@/lib/scopes" +import Logo from "./logo" // Navigation Context interface NavigationContextType { @@ -255,7 +256,7 @@ const menuSections: { title: string; items: NavItemProps[] }[] = [ href: "/gateway", icon: DoorClosedIcon, label: "网关列表", - requiredScope:ScopeProxyRead + requiredScope: ScopeProxyRead, }, { href: "/admin", @@ -301,22 +302,13 @@ export default function Navigation() {