import{i as e,n as t,r as n,t as r}from"./client-BTeclN8X.js";async function i(){let e=await t(`/api/v1/admin/dashboard`);return e.code!==0||!e.data?null:e.data}async function a(e=1,n=10){let r=await t(`/api/v1/admin/posts?page=${e}&limit=${n}`);return r.code!==0||!r.data?null:r.data}async function o(e){let n=await t(`/api/v1/admin/posts/${e}`);return n.code!==0||!n.data?null:n.data}async function s(t){let n=await e(`/api/v1/admin/posts`,t);return n.code===0?n.data||{}:{msg:n.msg}}async function c(e,t){let r=await n(`/api/v1/admin/posts/${e}`,t);return r.code===0?{}:{msg:r.msg}}async function l(e){let t=await r(`/api/v1/admin/posts/${e}`);return t.code===0?{}:{msg:t.msg}}async function u(e=1,n=10){let r=await t(`/api/v1/admin/media?page=${e}&limit=${n}`);return r.code!==0||!r.data?null:r.data}async function d(e){let n=await t(`/api/v1/admin/media/${e}`);return n.code!==0||!n.data?null:n.data}async function f(){let e=await t(`/api/v1/admin/media/usage`);return e.code!==0||!e.data?null:e.data}async function p(e,t){let r=await n(`/api/v1/admin/media/${e}`,t);return r.code===0?{data:r.data}:{msg:r.msg}}async function m(e=1,n=10){let r=await t(`/api/v1/admin/tags?page=${e}&limit=${n}`);return r.code!==0||!r.data?null:r.data}async function h(t){let n=await e(`/api/v1/admin/tags`,t);return n.code===0?n.data||{}:{msg:n.msg}}async function g(e,t){let r=await n(`/api/v1/admin/tags/${e}`,t);return r.code===0?{}:{msg:r.msg}}async function _(e){let t=await r(`/api/v1/admin/tags/${e}`);return t.code===0?{}:{msg:t.msg}}async function v(){let e=await t(`/api/v1/settings/auth`);return e.code!==0||!e.data?null:e.data}async function y(e){return(await n(`/api/v1/admin/settings/auth`,e)).code===0}async function b(){let e=await t(`/api/v1/settings/email`);return e.code!==0||!e.data?null:e.data}async function x(e){return(await n(`/api/v1/admin/settings/email`,e)).code===0}async function S(){let e=await t(`/api/v1/admin/settings/email-template`);if(e.code!==0)throw Error(e.msg||`加载邮件模板失败`);if(!e.data)throw Error(`邮件模板数据为空`);let{subject:n,html:r,text:i}=e.data;return{subject:n,html:r,text:i}}async function C(e){let t=await n(`/api/v1/admin/settings/email-template`,e);if(t.code!==0||!t.data)return null;let{subject:r,html:i,text:a}=t.data;return{subject:r,html:i,text:a}}async function w(e=1,n=10){let r=await t(`/api/v1/admin/users?page=${e}&limit=${n}`);return r.code!==0||!r.data?null:r.data}async function T(e,t){return(await n(`/api/v1/admin/users/${e}`,t)).code===0}async function E(e){let t=await r(`/api/v1/admin/users/${e}`);return t.code===0?{}:{msg:t.msg}}export{C,x as S,p as _,E as a,T as b,f as c,m as d,w as f,S as g,b as h,_ as i,o as l,i as m,h as n,u as o,v as p,l as r,d as s,s as t,a as u,c as v,y as x,g as y};