feat:初始化业务目录

This commit is contained in:
2026-05-09 10:36:20 +08:00
parent 881506655d
commit 56951c0383
60 changed files with 6955 additions and 184 deletions

View File

@@ -0,0 +1,25 @@
import { create } from "zustand";
import { setAdminBearerToken } from "@/lib/admin-auth";
type AdminSessionState = {
/** 已与 `Authorization: Bearer …` 同步的原始片段(不带 `Bearer ` 前缀) */
bearerToken: string | null;
setBearerToken: (token: string | null) => void;
clearBearerToken: () => void;
};
export const useAdminSessionStore = create<AdminSessionState>((set) => ({
bearerToken: null,
setBearerToken: (token) => {
const normalized = token?.trim() ? token.trim() : null;
setAdminBearerToken(normalized);
set({ bearerToken: normalized });
},
clearBearerToken: () => {
setAdminBearerToken(null);
set({ bearerToken: null });
},
}));