四端上传

This commit is contained in:
tianmo committed 2026-09-29 15:25:40 +08:00
1 parent 25bbb5f9c8
commit c6e2cb4d5b
276 files changed
+17812 -3

No files matched your search

@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[920],{754:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>c});var n=a(1333),l=a(8166),r=a(4705),s=a(8312),i=a(2787);function o(e){let{config:t}=e,[a,l]=(0,r.useState)([]),[o,d]=(0,r.useState)(0),[c,m]=(0,r.useState)(1),[u,x]=(0,r.useState)(""),[p,h]=(0,r.useState)(!1),[b,y]=(0,r.useState)(""),[g,f]=(0,r.useState)(!1),[v,j]=(0,r.useState)(null),[N,w]=(0,r.useState)({}),[S,_]=(0,r.useState)(!1),k=t.fields.filter(e=>!e.hideInTable),C=(0,r.useCallback)((e,a)=>{h(!0),y(""),s.F.listResource(t.key,{page:e,pageSize:20,keyword:a}).then(e=>{l(e.items),d(e.total),m(e.page)}).catch(e=>y(e.message)).finally(()=>h(!1))},[t.key]);(0,r.useEffect)(()=>{x(""),C(1,"")},[t.key,C]);let T=Math.max(1,Math.ceil(o/20));return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(i.$T,{message:b}),(0,n.jsxs)(i.Zp,{title:"".concat(t.title,"(共 ").concat(o," 条)"),action:(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(i.pd,{value:u,onChange:x,placeholder:"搜索…"}),(0,n.jsx)(i.$n,{variant:"ghost",onClick:()=>C(1,u),children:"搜索"}),(0,n.jsx)(i.$n,{onClick:()=>{let e={};for(let r of t.fields){var a,n,l;e[r.name]="select"===r.type?String(null!=(l=null==(n=r.options)||null==(a=n[0])?void 0:a.value)?l:1):""}w(e),j(null),f(!0)},children:"新建"})]}),children:[(0,n.jsx)("p",{className:"mb-3 text-xs text-gray-500",children:t.description}),p?(0,n.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:"加载中…"}):0===a.length?(0,n.jsx)(i.Sv,{}):(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"border-b border-gray-200 text-left text-xs text-gray-500",children:[(0,n.jsx)("th",{className:"px-2 py-2",children:"ID"}),k.map(e=>(0,n.jsx)("th",{className:"px-2 py-2",children:e.label},e.name)),(0,n.jsx)("th",{className:"px-2 py-2 text-right",children:"操作"})]})}),(0,n.jsx)("tbody",{children:a.map(e=>(0,n.jsxs)("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[(0,n.jsx)("td",{className:"px-2 py-2 text-gray-400",children:String(e.id)}),k.map(t=>{let a=function(e,t){let a=t[e.name];if(null==a||""===a)return"—";if("select"===e.type&&e.options){let t=e.options.find(e=>e.value===Number(a));return t?t.label:String(a)}return"date"===e.type?String(a).slice(0,10):String(a)}(t,e);return(0,n.jsx)("td",{className:"max-w-[280px] truncate px-2 py-2",title:a,children:a},t.name)}),(0,n.jsxs)("td",{className:"whitespace-nowrap px-2 py-2 text-right",children:[(0,n.jsx)(i.$n,{variant:"ghost",onClick:()=>(e=>{let a={};for(let n of t.fields)a[n.name]=function(e,t){if(null==t)return"";if("date"===e.type){let e=new Date(String(t));return isNaN(e.getTime())?"":e.toISOString().slice(0,10)}return String(t)}(n,e[n.name]);w(a),j(e),f(!0)})(e),children:"编辑"})," ",(0,n.jsx)(i.$n,{variant:"danger",onClick:()=>{window.confirm("确定删除这条记录吗?此操作不可撤销。")&&(y(""),s.F.deleteResource(t.key,Number(e.id)).then(()=>C(c,u)).catch(e=>y(e.message)))},children:"删除"})]})]},String(e.id)))})]})}),(0,n.jsxs)("div",{className:"mt-4 flex items-center justify-between text-sm text-gray-500",children:[(0,n.jsxs)("span",{children:["第 ",c," / ",T," 页"]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(i.$n,{variant:"ghost",disabled:c<=1,onClick:()=>C(c-1,u),children:"上一页"}),(0,n.jsx)(i.$n,{variant:"ghost",disabled:c>=T,onClick:()=>C(c+1,u),children:"下一页"})]})]})]}),(0,n.jsx)(i.aF,{open:g,title:"".concat(v?"编辑":"新建").concat(t.title),onClose:()=>f(!1),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.$n,{variant:"ghost",onClick:()=>f(!1),children:"取消"}),(0,n.jsx)(i.$n,{onClick:()=>{let e=function(e,t){let a={};for(let n of e){let e=t[n.name];void 0!==e&&(""===e?a[n.name]="number"===n.type?0:null:"number"===n.type||"select"===n.type?a[n.name]=Number(e):a[n.name]=e)}return a}(t.fields.filter(e=>!(v&&e.immutable)),N);_(!0),y(""),(v?s.F.updateResource(t.key,Number(v.id),e):s.F.createResource(t.key,e)).then(()=>{f(!1),C(c,u)}).catch(e=>y(e.message)).finally(()=>_(!1))},disabled:S,children:S?"保存中…":"保存"})]}),children:(0,n.jsx)("div",{className:"space-y-3",children:t.fields.map(e=>{var t,a,l,r;let s=!!(v&&e.immutable);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"mb-1 block text-sm text-gray-600",children:[e.label,e.immutable&&(0,n.jsx)("span",{className:"ml-2 text-xs text-orange-500",children:"创建后不可修改"})]}),"textarea"===e.type?(0,n.jsx)(i.TM,{value:null!=(t=N[e.name])?t:"",onChange:t=>w({...N,[e.name]:t})}):"select"===e.type?(0,n.jsx)(i.l6,{value:null!=(a=N[e.name])?a:"",onChange:t=>w({...N,[e.name]:t}),options:null!=(l=e.options)?l:[]}):(0,n.jsx)("div",{className:s?"pointer-events-none opacity-60":"",children:(0,n.jsx)(i.pd,{value:null!=(r=N[e.name])?r:"",onChange:t=>w({...N,[e.name]:t}),type:"number"===e.type?"number":"date"===e.type?"daLine truncated
@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12],{1910:(e,t,r)=>{"use strict";r.d(t,{L:()=>o,M3:()=>u,WG:()=>l,gf:()=>a});let n="yelay_admin_token";function a(){var e;return null!=(e=window.localStorage.getItem(n))?e:""}function l(e){window.localStorage.setItem(n,e)}function o(){window.localStorage.removeItem(n)}function u(){return""!==a()}},2457:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>f});var n=r(1333),a=r(4705),l=r(8661),o=r.n(l),u=r(8166),i=r(1910),s=r(4357);let c=[{href:"/",label:"数据看板"},{href:"/users",label:"用户"},{href:"/orders",label:"订单"},{href:"/settings",label:"系统配置"}];function f(e){let{children:t}=e,r=(0,u.useRouter)(),l=(0,u.usePathname)(),[o,f]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{if(!(0,i.M3)())return void r.replace("/login");f(!0)},[r]),o)?(0,n.jsxs)("div",{className:"flex min-h-screen",children:[(0,n.jsxs)("aside",{className:"w-56 shrink-0 border-r border-gray-200 bg-white",children:[(0,n.jsxs)("div",{className:"border-b border-gray-200 px-4 py-4",children:[(0,n.jsx)("div",{className:"text-sm font-semibold text-gray-900",children:"叶雷讲数学"}),(0,n.jsx)("div",{className:"text-xs text-gray-400",children:"管理后台"})]}),(0,n.jsxs)("nav",{className:"p-2",children:[c.map(e=>(0,n.jsx)(d,{href:e.href,label:e.label,active:l===e.href},e.href)),(0,n.jsx)("div",{className:"px-3 pt-4 pb-1 text-xs text-gray-400",children:"内容管理"}),s.le.map(e=>(0,n.jsx)(d,{href:"/".concat(e.key),label:e.title,active:l==="/".concat(e.key)},e.key))]}),(0,n.jsx)("div",{className:"border-t border-gray-200 p-2",children:(0,n.jsx)("button",{onClick:()=>{(0,i.L)(),r.replace("/login")},className:"w-full rounded-md px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-100",children:"退出登录"})})]}),(0,n.jsx)("main",{className:"flex-1 p-6",children:t})]}):(0,n.jsx)("div",{className:"flex min-h-screen items-center justify-center text-sm text-gray-400",children:"加载中…"})}function d(e){let{href:t,label:r,active:a}=e;return(0,n.jsx)(o(),{href:t,className:"block rounded-md px-3 py-2 text-sm transition ".concat(a?"bg-blue-50 font-medium text-blue-700":"text-gray-600 hover:bg-gray-100"),children:r})}},3035:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},3140:(e,t)=>{"use strict";function r(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function a(e){let t=new URLSearchParams;for(let[r,a]of Object.entries(e))if(Array.isArray(a))for(let e of a)t.append(r,n(e));else t.set(r,n(a));return t}function l(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(let t of r){for(let r of t.keys())e.delete(r);for(let[r,n]of t.entries())e.append(r,n)}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return l},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return a}})},3190:(e,t,r)=>{Promise.resolve().then(r.bind(r,2457))},4354:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return m},MiddlewareNotFoundError:function(){return g},MissingStaticPage:function(){return h},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return d},ST:function(){return p},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return i},getLocationOrigin:function(){return o},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return s},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return c},stringifyError:function(){return x}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,a=Array(n),l=0;l<n;l++)a[l]=arguments[l];return r||(r=!0,t=e(...a)),t}}let a=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>a.test(e);function o(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function u(){let{href:e}=window.location,t=o();return e.substring(t.length)}function i(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}function c(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&s(r))return n;if(!n)throw Object.defineProperty(Error('"'+i(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.'),"Line truncated
@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[813],{1910:(e,t,a)=>{"use strict";a.d(t,{L:()=>r,M3:()=>i,WG:()=>s,gf:()=>n});let l="yelay_admin_token";function n(){var e;return null!=(e=window.localStorage.getItem(l))?e:""}function s(e){window.localStorage.setItem(l,e)}function r(){window.localStorage.removeItem(l)}function i(){return""!==n()}},2787:(e,t,a)=>{"use strict";a.d(t,{$T:()=>c,$n:()=>n,Sv:()=>m,TM:()=>r,Zp:()=>d,aF:()=>o,l6:()=>i,pd:()=>s});var l=a(1333);function n(e){let{children:t,onClick:a,variant:n="primary",disabled:s,type:r="button"}=e;return(0,l.jsx)("button",{type:r,onClick:a,disabled:s,className:"rounded-md px-3 py-1.5 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-50 ".concat({primary:"bg-blue-600 text-white hover:bg-blue-700",ghost:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50",danger:"bg-red-600 text-white hover:bg-red-700"}[n]),children:t})}function s(e){let{value:t,onChange:a,placeholder:n,type:s="text"}=e;return(0,l.jsx)("input",{type:s,value:t,placeholder:n,onChange:e=>a(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500"})}function r(e){let{value:t,onChange:a}=e;return(0,l.jsx)("textarea",{value:t,rows:6,onChange:e=>a(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 font-mono text-xs outline-none focus:border-blue-500"})}function i(e){let{value:t,onChange:a,options:n}=e;return(0,l.jsx)("select",{value:t,onChange:e=>a(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500",children:n.map(e=>(0,l.jsx)("option",{value:String(e.value),children:e.label},e.value))})}function d(e){let{title:t,children:a,action:n}=e;return(0,l.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(t||n)&&(0,l.jsxs)("header",{className:"mb-4 flex items-center justify-between",children:[t&&(0,l.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:t}),n]}),a]})}function o(e){let{open:t,title:a,onClose:n,children:s,footer:r}=e;return t?(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:(0,l.jsxs)("div",{className:"max-h-[85vh] w-full max-w-2xl overflow-auto rounded-lg bg-white shadow-xl",children:[(0,l.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-5 py-3",children:[(0,l.jsx)("h3",{className:"text-base font-semibold",children:a}),(0,l.jsx)("button",{onClick:n,className:"text-gray-400 hover:text-gray-600","aria-label":"关闭",children:"✕"})]}),(0,l.jsx)("div",{className:"px-5 py-4",children:s}),r&&(0,l.jsx)("footer",{className:"flex justify-end gap-2 border-t border-gray-200 px-5 py-3",children:r})]})}):null}function c(e){let{message:t,kind:a="error"}=e;return t?(0,l.jsx)("div",{className:"mb-3 rounded-md border px-3 py-2 text-sm ".concat("error"===a?"bg-red-50 text-red-700 border-red-200":"bg-green-50 text-green-700 border-green-200"),children:t}):null}function m(e){let{text:t="暂无数据"}=e;return(0,l.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:t})}},3379:(e,t,a)=>{Promise.resolve().then(a.bind(a,7494))},4357:(e,t,a)=>{"use strict";a.d(t,{MW:()=>r,le:()=>s,u_:()=>i});let l={name:"status",label:"状态",type:"select",options:[{value:1,label:"启用"},{value:0,label:"停用"}]},n={name:"sort_order",label:"排序",type:"number",hideInTable:!0},s=[{key:"courses",title:"课程",description:"付费课程。注意 code 是视频目录名与封面名,创建后不可修改。",fields:[{name:"code",label:"课程标识",type:"text",immutable:!0,hint:"64 位哈希,对应视频目录"},{name:"title",label:"课程名称",type:"text"},{name:"intro",label:"课程介绍",type:"text"},{name:"price_fen",label:"价格(分)",type:"number"},{name:"cover_image",label:"封面文件",type:"text",hideInTable:!0},l,n]},{key:"lessons",title:"课时",description:"课程下的视频。chapter_id 与 play_id 参与视频路径拼接,改动会使旧地址失效。",filterByCourse:!0,fields:[{name:"course_id",label:"课程 ID",type:"number"},{name:"chapter_id",label:"章节 ID",type:"text"},{name:"play_id",label:"播放 ID",type:"text"},{name:"chapter_title",label:"章节名称",type:"text"},{name:"lesson_title",label:"视频名称",type:"text"},{name:"duration",label:"时长",type:"text"},{name:"published_at",label:"发布日期",type:"date"},n]},{key:"home-courses",title:"首页新课",description:"首页「新课上线」的长图页面。course_name 决定图片路径,不要改动。",fields:[{name:"course_name",label:"条目名称",type:"text",hint:"对应 Images/NewCourse/{名称}.png"},{name:"intro",label:"简介",type:"text"},{name:"course_id",label:"关联课程 ID",type:"number",hint:"留空则长图页不显示购买按钮"},{name:"content",label:"长图内容",type:"textarea",hideInTable:!0},{name:"publiLine truncated
@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[971],{1910:(e,t,n)=>{"use strict";n.d(t,{L:()=>l,M3:()=>o,WG:()=>s,gf:()=>a});let r="yelay_admin_token";function a(){var e;return null!=(e=window.localStorage.getItem(r))?e:""}function s(e){window.localStorage.setItem(r,e)}function l(){window.localStorage.removeItem(r)}function o(){return""!==a()}},2787:(e,t,n)=>{"use strict";n.d(t,{$T:()=>c,$n:()=>a,Sv:()=>u,TM:()=>l,Zp:()=>d,aF:()=>i,l6:()=>o,pd:()=>s});var r=n(1333);function a(e){let{children:t,onClick:n,variant:a="primary",disabled:s,type:l="button"}=e;return(0,r.jsx)("button",{type:l,onClick:n,disabled:s,className:"rounded-md px-3 py-1.5 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-50 ".concat({primary:"bg-blue-600 text-white hover:bg-blue-700",ghost:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50",danger:"bg-red-600 text-white hover:bg-red-700"}[a]),children:t})}function s(e){let{value:t,onChange:n,placeholder:a,type:s="text"}=e;return(0,r.jsx)("input",{type:s,value:t,placeholder:a,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500"})}function l(e){let{value:t,onChange:n}=e;return(0,r.jsx)("textarea",{value:t,rows:6,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 font-mono text-xs outline-none focus:border-blue-500"})}function o(e){let{value:t,onChange:n,options:a}=e;return(0,r.jsx)("select",{value:t,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500",children:a.map(e=>(0,r.jsx)("option",{value:String(e.value),children:e.label},e.value))})}function d(e){let{title:t,children:n,action:a}=e;return(0,r.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(t||a)&&(0,r.jsxs)("header",{className:"mb-4 flex items-center justify-between",children:[t&&(0,r.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:t}),a]}),n]})}function i(e){let{open:t,title:n,onClose:a,children:s,footer:l}=e;return t?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:(0,r.jsxs)("div",{className:"max-h-[85vh] w-full max-w-2xl overflow-auto rounded-lg bg-white shadow-xl",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-5 py-3",children:[(0,r.jsx)("h3",{className:"text-base font-semibold",children:n}),(0,r.jsx)("button",{onClick:a,className:"text-gray-400 hover:text-gray-600","aria-label":"关闭",children:"✕"})]}),(0,r.jsx)("div",{className:"px-5 py-4",children:s}),l&&(0,r.jsx)("footer",{className:"flex justify-end gap-2 border-t border-gray-200 px-5 py-3",children:l})]})}):null}function c(e){let{message:t,kind:n="error"}=e;return t?(0,r.jsx)("div",{className:"mb-3 rounded-md border px-3 py-2 text-sm ".concat("error"===n?"bg-red-50 text-red-700 border-red-200":"bg-green-50 text-green-700 border-green-200"),children:t}):null}function u(e){let{text:t="暂无数据"}=e;return(0,r.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:t})}},4978:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(1333),a=n(4705),s=n(8312),l=n(2787);function o(){let[e,t]=(0,a.useState)(null),[n,o]=(0,a.useState)("");return(0,a.useEffect)(()=>{s.F.stats().then(t).catch(e=>o(e.message))},[]),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold text-gray-900",children:"数据看板"}),(0,r.jsx)(l.$T,{message:n}),e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[(0,r.jsx)(d,{label:"用户总数",value:String(e.users)}),(0,r.jsx)(d,{label:"在售课程",value:String(e.courses)}),(0,r.jsx)(d,{label:"累计订单",value:String(e.orders)}),(0,r.jsx)(d,{label:"已开通",value:String(e.delivered)}),(0,r.jsx)(d,{label:"已退款",value:String(e.refunded)}),(0,r.jsx)(d,{label:"成交金额(元)",value:(e.revenueFen/100).toFixed(2)}),(0,r.jsx)(d,{label:"支付能力",value:e.payEnabled?"已配置":"未配置"})]}),!e.payEnabled&&(0,r.jsx)(l.Zp,{title:"支付尚未启用",children:(0,r.jsx)("p",{className:"text-sm text-gray-600",children:"服务端未配置虚拟支付参数(WX_OFFER_ID / WX_PAY_APPKEY),用户暂时无法购买课程。 请在微信小程序后台开通虚拟支付后,将 OfferID 与现网 AppKey 写入服务端环境变量。"})})]}):(0,r.jsx)("div",{className:"text-sm text-gray-400",children:"加载中…"})]})}function d(e){let{label:t,value:n}=e;return(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white px-4 py-3 shadow-sm",children:[(0,r.jsx)("div",{className:"text-xs text-gray-500",children:t}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-semibold text-gray-900",children:n})]})}},8312:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var r=n(1910);let a="Line truncated
@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1],{58:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var a=n(1333),r=n(4705),s=n(8312),o=n(2787);function l(){let[e,t]=(0,r.useState)([]),[n,l]=(0,r.useState)({}),[i,d]=(0,r.useState)(""),[c,u]=(0,r.useState)(""),[m,h]=(0,r.useState)(""),g=()=>{d(""),s.F.listSettings().then(e=>{t(e);let n={};e.forEach(e=>{var t;n[e.key]=null!=(t=e.value)?t:""}),l(n)}).catch(e=>d(e.message))};return(0,r.useEffect)(g,[]),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h1",{className:"text-lg font-semibold text-gray-900",children:"系统配置"}),(0,a.jsx)(o.$T,{message:i}),c&&(0,a.jsx)(o.$T,{message:c,kind:"success"}),(0,a.jsxs)(o.Zp,{title:"站点文案与开关",children:[(0,a.jsx)("p",{className:"mb-4 text-xs text-gray-500",children:"小程序首屏显示的标题、我的页面菜单文案、版本号等都在这里。修改后小程序下拉刷新即可生效。"}),(0,a.jsxs)("div",{className:"space-y-3",children:[e.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("div",{className:"w-56 shrink-0",children:[(0,a.jsx)("div",{className:"text-sm text-gray-700",children:e.remark||e.key}),(0,a.jsx)("div",{className:"font-mono text-xs text-gray-400",children:e.key})]}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(o.pd,{value:null!=(t=n[e.key])?t:"",onChange:t=>l({...n,[e.key]:t})})}),(0,a.jsx)(o.$n,{variant:"ghost",onClick:()=>{var t,a;h(e.key),d(""),u(""),s.F.upsertSetting(e.key,null!=(t=n[e.key])?t:"",null!=(a=e.remark)?a:void 0).then(()=>{u("已保存:".concat(e.key)),g()}).catch(e=>d(e.message)).finally(()=>h(""))},disabled:m===e.key,children:m===e.key?"保存中…":"保存"})]},e.key)}),0===e.length&&(0,a.jsx)("div",{className:"py-6 text-center text-sm text-gray-400",children:"暂无配置"})]})]})]})}},1910:(e,t,n)=>{"use strict";n.d(t,{L:()=>o,M3:()=>l,WG:()=>s,gf:()=>r});let a="yelay_admin_token";function r(){var e;return null!=(e=window.localStorage.getItem(a))?e:""}function s(e){window.localStorage.setItem(a,e)}function o(){window.localStorage.removeItem(a)}function l(){return""!==r()}},2787:(e,t,n)=>{"use strict";n.d(t,{$T:()=>c,$n:()=>r,Sv:()=>u,TM:()=>o,Zp:()=>i,aF:()=>d,l6:()=>l,pd:()=>s});var a=n(1333);function r(e){let{children:t,onClick:n,variant:r="primary",disabled:s,type:o="button"}=e;return(0,a.jsx)("button",{type:o,onClick:n,disabled:s,className:"rounded-md px-3 py-1.5 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-50 ".concat({primary:"bg-blue-600 text-white hover:bg-blue-700",ghost:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50",danger:"bg-red-600 text-white hover:bg-red-700"}[r]),children:t})}function s(e){let{value:t,onChange:n,placeholder:r,type:s="text"}=e;return(0,a.jsx)("input",{type:s,value:t,placeholder:r,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500"})}function o(e){let{value:t,onChange:n}=e;return(0,a.jsx)("textarea",{value:t,rows:6,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 font-mono text-xs outline-none focus:border-blue-500"})}function l(e){let{value:t,onChange:n,options:r}=e;return(0,a.jsx)("select",{value:t,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500",children:r.map(e=>(0,a.jsx)("option",{value:String(e.value),children:e.label},e.value))})}function i(e){let{title:t,children:n,action:r}=e;return(0,a.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(t||r)&&(0,a.jsxs)("header",{className:"mb-4 flex items-center justify-between",children:[t&&(0,a.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:t}),r]}),n]})}function d(e){let{open:t,title:n,onClose:r,children:s,footer:o}=e;return t?(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:(0,a.jsxs)("div",{className:"max-h-[85vh] w-full max-w-2xl overflow-auto rounded-lg bg-white shadow-xl",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-5 py-3",children:[(0,a.jsx)("h3",{className:"text-base font-semibold",children:n}),(0,a.jsx)("button",{onClick:r,className:"text-gray-400 hover:text-gray-600","aria-label":"关闭",children:"✕"})]}),(0,a.jsx)("div",{className:"px-5 py-4",children:s}),o&&(0,a.jsx)("footer",{className:"flex justify-end gap-2 border-t border-gray-200 px-5 py-3",children:o})]})}):null}function c(e){let{message:t,kind:n="error"}=e;return t?(0,a.jsx)("div",{className:"mb-3 rounded-md border px-3 py-2 text-sm ".concat("error"===n?"bg-red-50 text-red-700 border-red-200":"bg-green-50 text-green-700 border-green-200"),children:t}):null}function u(e){let{text:t="暂无数据"}=e;return(0,a.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",chilLine truncated
@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[572],{1910:(e,t,s)=>{"use strict";s.d(t,{L:()=>r,M3:()=>i,WG:()=>l,gf:()=>n});let a="yelay_admin_token";function n(){var e;return null!=(e=window.localStorage.getItem(a))?e:""}function l(e){window.localStorage.setItem(a,e)}function r(){window.localStorage.removeItem(a)}function i(){return""!==n()}},2787:(e,t,s)=>{"use strict";s.d(t,{$T:()=>o,$n:()=>n,Sv:()=>m,TM:()=>r,Zp:()=>c,aF:()=>d,l6:()=>i,pd:()=>l});var a=s(1333);function n(e){let{children:t,onClick:s,variant:n="primary",disabled:l,type:r="button"}=e;return(0,a.jsx)("button",{type:r,onClick:s,disabled:l,className:"rounded-md px-3 py-1.5 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-50 ".concat({primary:"bg-blue-600 text-white hover:bg-blue-700",ghost:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50",danger:"bg-red-600 text-white hover:bg-red-700"}[n]),children:t})}function l(e){let{value:t,onChange:s,placeholder:n,type:l="text"}=e;return(0,a.jsx)("input",{type:l,value:t,placeholder:n,onChange:e=>s(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500"})}function r(e){let{value:t,onChange:s}=e;return(0,a.jsx)("textarea",{value:t,rows:6,onChange:e=>s(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 font-mono text-xs outline-none focus:border-blue-500"})}function i(e){let{value:t,onChange:s,options:n}=e;return(0,a.jsx)("select",{value:t,onChange:e=>s(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500",children:n.map(e=>(0,a.jsx)("option",{value:String(e.value),children:e.label},e.value))})}function c(e){let{title:t,children:s,action:n}=e;return(0,a.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(t||n)&&(0,a.jsxs)("header",{className:"mb-4 flex items-center justify-between",children:[t&&(0,a.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:t}),n]}),s]})}function d(e){let{open:t,title:s,onClose:n,children:l,footer:r}=e;return t?(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:(0,a.jsxs)("div",{className:"max-h-[85vh] w-full max-w-2xl overflow-auto rounded-lg bg-white shadow-xl",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-5 py-3",children:[(0,a.jsx)("h3",{className:"text-base font-semibold",children:s}),(0,a.jsx)("button",{onClick:n,className:"text-gray-400 hover:text-gray-600","aria-label":"关闭",children:"✕"})]}),(0,a.jsx)("div",{className:"px-5 py-4",children:l}),r&&(0,a.jsx)("footer",{className:"flex justify-end gap-2 border-t border-gray-200 px-5 py-3",children:r})]})}):null}function o(e){let{message:t,kind:s="error"}=e;return t?(0,a.jsx)("div",{className:"mb-3 rounded-md border px-3 py-2 text-sm ".concat("error"===s?"bg-red-50 text-red-700 border-red-200":"bg-green-50 text-green-700 border-green-200"),children:t}):null}function m(e){let{text:t="暂无数据"}=e;return(0,a.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:t})}},3308:(e,t,s)=>{Promise.resolve().then(s.bind(s,7249))},7249:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(1333),n=s(4705),l=s(8312),r=s(2787);let i={1:"订单购买",2:"历史数据",3:"后台发放"};function c(){var e;let[t,s]=(0,n.useState)([]),[c,d]=(0,n.useState)(0),[o,m]=(0,n.useState)(1),[x,h]=(0,n.useState)(""),[u,g]=(0,n.useState)(""),[b,p]=(0,n.useState)(null),[y,j]=(0,n.useState)({nickname:"",headicon_id:"0",status:"1"}),[v,f]=(0,n.useState)([]),[N,w]=(0,n.useState)([]),[S,k]=(0,n.useState)(""),C=(0,n.useCallback)((e,t)=>{g(""),l.F.listUsers(e,20,t).then(e=>{s(e.items),d(e.total),m(e.page)}).catch(e=>g(e.message))},[]);(0,n.useEffect)(()=>{C(1,""),l.F.listResource("courses",{page:1,pageSize:100}).then(e=>f(e.items)).catch(()=>f([]))},[C]);let _=e=>{l.F.listEntitlements(e).then(e=>w(e)).catch(()=>w([]))},O=Math.max(1,Math.ceil(c/20));return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h1",{className:"text-lg font-semibold text-gray-900",children:"用户"}),(0,a.jsx)(r.$T,{message:u}),(0,a.jsxs)(r.Zp,{title:"共 ".concat(c," 位用户"),action:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(r.pd,{value:x,onChange:h,placeholder:"昵称或 openid…"}),(0,a.jsx)(r.$n,{variant:"ghost",onClick:()=>C(1,x),children:"搜索"})]}),children:[0===t.length?(0,a.jsx)(r.Sv,{}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-gray-200 text-left text-xs text-gray-500",children:[(0,a.jsx)("th",{className:"px-2 py-2",children:"ID"}),(0,a.jsx)("th",{className:"px-2 py-2",children:"昵称"}),(0,a.jsx)("th",{className:"px-2 py-2",children:"已购课程"}),(0,a.jsx)("th",{className:"px-2Line truncated
@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[492],{3202:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(5782)}])},5782:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=l(1333),n=l(6336),o=function(){return(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})})})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5847:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"styles",{enumerable:!0,get:function(){return l}});let l={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6336:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}});let r=l(1333),n=l(5847);function o(e){let{status:t,message:l}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:t+": "+l}),(0,r.jsx)("div",{style:n.styles.error,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,r.jsx)("h1",{className:"next-error-h1",style:n.styles.h1,children:t}),(0,r.jsx)("div",{style:n.styles.desc,children:(0,r.jsx)("h2",{style:n.styles.h2,children:l})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[964,857,358],()=>e(e.s=3202)),_N_E=e.O()}]);
@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{461:()=>{},6739:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,461,23))}},e=>{e.O(0,[282,964,857,358],()=>e(e.s=6739)),_N_E=e.O()}]);
@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[520],{1513:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(1333),s=n(4705),a=n(8166),o=n(8312),l=n(1910),i=n(2787);function d(){let e=(0,a.useRouter)(),[t,n]=(0,s.useState)(""),[d,c]=(0,s.useState)(""),[u,m]=(0,s.useState)("login"),[h,g]=(0,s.useState)(""),[x,b]=(0,s.useState)(""),[f,p]=(0,s.useState)(!1);return(0,r.jsx)("main",{className:"flex min-h-screen items-center justify-center p-4",children:(0,r.jsxs)("div",{className:"w-full max-w-sm",children:[(0,r.jsxs)("div",{className:"mb-6 text-center",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-gray-900",children:"叶雷讲数学"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"管理后台"})]}),(0,r.jsxs)(i.Zp,{children:[(0,r.jsx)(i.$T,{message:h}),x&&(0,r.jsx)(i.$T,{message:x,kind:"success"}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1 block text-sm text-gray-600",children:"账号"}),(0,r.jsx)(i.pd,{value:t,onChange:n,placeholder:"管理员账号"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1 block text-sm text-gray-600",children:"密码"}),(0,r.jsx)(i.pd,{value:d,onChange:c,placeholder:"密码",type:"password"})]}),(0,r.jsx)(i.$n,{onClick:()=>{if(g(""),b(""),!t||!d)return void g("请输入账号与密码");p(!0),("login"===u?o.F.login(t,d):o.F.bootstrap(t,d)).then(t=>{if("bootstrap"===u){b(t.created?"管理员已创建,请切换到登录。":"系统已存在管理员,无法重复创建。"),m("login");return}(0,l.WG)(t.accessToken),e.replace("/")}).catch(e=>g(e.message)).finally(()=>p(!1))},disabled:f,children:f?"处理中…":"login"===u?"登录":"创建管理员"})]}),(0,r.jsx)("button",{onClick:()=>{m("login"===u?"bootstrap":"login"),g(""),b("")},className:"mt-4 text-xs text-blue-600 hover:underline",children:"login"===u?"首次部署?创建管理员账号":"返回登录"})]})]})})}},1910:(e,t,n)=>{"use strict";n.d(t,{L:()=>o,M3:()=>l,WG:()=>a,gf:()=>s});let r="yelay_admin_token";function s(){var e;return null!=(e=window.localStorage.getItem(r))?e:""}function a(e){window.localStorage.setItem(r,e)}function o(){window.localStorage.removeItem(r)}function l(){return""!==s()}},2787:(e,t,n)=>{"use strict";n.d(t,{$T:()=>c,$n:()=>s,Sv:()=>u,TM:()=>o,Zp:()=>i,aF:()=>d,l6:()=>l,pd:()=>a});var r=n(1333);function s(e){let{children:t,onClick:n,variant:s="primary",disabled:a,type:o="button"}=e;return(0,r.jsx)("button",{type:o,onClick:n,disabled:a,className:"rounded-md px-3 py-1.5 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-50 ".concat({primary:"bg-blue-600 text-white hover:bg-blue-700",ghost:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50",danger:"bg-red-600 text-white hover:bg-red-700"}[s]),children:t})}function a(e){let{value:t,onChange:n,placeholder:s,type:a="text"}=e;return(0,r.jsx)("input",{type:a,value:t,placeholder:s,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500"})}function o(e){let{value:t,onChange:n}=e;return(0,r.jsx)("textarea",{value:t,rows:6,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 font-mono text-xs outline-none focus:border-blue-500"})}function l(e){let{value:t,onChange:n,options:s}=e;return(0,r.jsx)("select",{value:t,onChange:e=>n(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-1.5 text-sm outline-none focus:border-blue-500",children:s.map(e=>(0,r.jsx)("option",{value:String(e.value),children:e.label},e.value))})}function i(e){let{title:t,children:n,action:s}=e;return(0,r.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(t||s)&&(0,r.jsxs)("header",{className:"mb-4 flex items-center justify-between",children:[t&&(0,r.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:t}),s]}),n]})}function d(e){let{open:t,title:n,onClose:s,children:a,footer:o}=e;return t?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:(0,r.jsxs)("div",{className:"max-h-[85vh] w-full max-w-2xl overflow-auto rounded-lg bg-white shadow-xl",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-5 py-3",children:[(0,r.jsx)("h3",{className:"text-base font-semibold",children:n}),(0,r.jsx)("button",{onClick:s,className:"text-gray-400 hover:text-gray-600","aria-label":"关闭",children:"✕"})]}),(0,r.jsx)("div",{className:"px-5 py-4",children:a}),o&&(0,r.jsx)("footer",{className:"flex justify-end gap-2 border-t border-gray-200 px-5 py-3",children:o})]})}):null}function c(e){let{message:t,kind:n="error"}=e;return t?(0,r.jsx)("div",{className:"mb-3 rounded-md border px-3 py-2 text-sm ".concat("error"===n?"bg-red-50 text-red-700 border-red-200":"bg-green-50 text-green-700 border-green-200"),children:t}):null}fLine truncated