You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
2.8 KiB

  1. import{j as e,E as x,I as f,b}from"./semi-ui-BMB0_gSU.js";import{r as n}from"./react-core-CMEN6BYR.js";import{A as j,s as y}from"./index-gPcw8Cof.js";import{u as N}from"./i18n-D_ruByvS.js";import{m as w}from"./tools-DogoVVJ5.js";import"./react-components-CFDFlXwp.js";const E=()=>{const{t}=N(),[r,s]=n.useState(""),[i,l]=n.useState(!1),c=new Date().getFullYear(),m=async()=>{s(localStorage.getItem("about")||"");const h=await j.get("/api/about"),{success:d,message:g,data:a}=h.data;if(d){let o=a;a.startsWith("https://")||(o=w.parse(a)),s(o),localStorage.setItem("about",o)}else y(g),s(t("加载关于内容失败..."));l(!0)};n.useEffect(()=>{m().then()},[]);const u={padding:"24px"},p=e.jsxs("div",{style:{textAlign:"center"},children:[e.jsx("p",{children:t("可在设置页面设置关于内容,支持 HTML & Markdown")}),t("New API项目仓库地址:"),e.jsx("a",{href:"https://github.com/QuantumNous/new-api",target:"_blank",rel:"noopener noreferrer",className:"!text-semi-color-primary",children:"https://github.com/QuantumNous/new-api"}),e.jsxs("p",{children:[e.jsx("a",{href:"https://github.com/QuantumNous/new-api",target:"_blank",rel:"noopener noreferrer",className:"!text-semi-color-primary",children:"NewAPI"})," ",t("© {{currentYear}}",{currentYear:c})," ",e.jsx("a",{href:"https://github.com/QuantumNous",target:"_blank",rel:"noopener noreferrer",className:"!text-semi-color-primary",children:"QuantumNous"})," ",t("| 基于")," ",e.jsx("a",{href:"https://github.com/songquanpeng/one-api/releases/tag/v0.5.4",target:"_blank",rel:"noopener noreferrer",className:"!text-semi-color-primary",children:"One API v0.5.4"})," ","© 2023"," ",e.jsx("a",{href:"https://github.com/songquanpeng",target:"_blank",rel:"noopener noreferrer",className:"!text-semi-color-primary",children:"JustSong"})]}),e.jsxs("p",{children:[t("本项目根据"),e.jsx("a",{href:"https://github.com/songquanpeng/one-api/blob/v0.5.4/LICENSE",target:"_blank",rel:"noopener noreferrer",className:"!text-semi-color-primary",children:t("MIT许可证")}),t("授权,需在遵守"),e.jsx("a",{href:"https://www.gnu.org/licenses/agpl-3.0.html",target:"_blank",rel:"noopener noreferrer",className:"!text-semi-color-primary",children:t("AGPL v3.0协议")}),t("的前提下使用。")]})]});return e.jsx("div",{className:"mt-[60px] px-2",children:i&&r===""?e.jsx("div",{className:"flex justify-center items-center h-screen p-8",children:e.jsx(x,{image:e.jsx(b,{style:{width:150,height:150}}),darkModeImage:e.jsx(f,{style:{width:150,height:150}}),description:t("管理员暂时未设置任何关于内容"),style:u,children:p})}):e.jsx(e.Fragment,{children:r.startsWith("https://")?e.jsx("iframe",{src:r,style:{width:"100%",height:"100vh",border:"none"}}):e.jsx("div",{style:{fontSize:"larger"},dangerouslySetInnerHTML:{__html:r}})})})};export{E as default};