Files
wordpress-theme-aksrt/assets/admin/build/DownloadPermissions.D_4Tmrvf.js
T
kate522 a3dde3874a feat(admin): strip SPA ops menus; redirect old hashes to native WP (Phase 4)
SPA shop/forum/payment/users sections now keep configuration pages only.
Operational workbenches were removed from the sidebar and loaders; legacy
hash routes open NativeOpsRedirect into the matching WP native admin page.
Admin SPA production build refreshed accordingly.
2026-07-15 02:10:05 +08:00

2 lines
5.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{o as B,X as U,a4 as a,a3 as t,r as p,a1 as n,e as q,_ as D,W as F,f as l,Y as r,Z as f}from"./vendor-vue.Bykizn0M.js";import{a as b}from"./shared-api.D5_fnN32.js";import{P as M}from"./PageHeader.Di3JTPjc.js";import{u as $}from"./vendor-naive.BuHWlEgf.js";import"./index.js";import"./vendor-misc.1adHN6i_.js";const E={class:"aksrt-page-container"},H={class:"aksrt-form-actions"},z={__name:"DownloadPermissions",setup(I){const x=D(),w=$(),m=p(!0),g=p(!1),h=p(0),i=p({resource_cpt_enabled:!0,search_include_resource:!0,download_login:!0,download_credit:!0,download_captcha:!1}),e=q({download_login:!0,download_credit:!0,download_captcha:!1});function C(u){x.push(u)}async function P(){var u;m.value=!0;try{const[o,d]=await Promise.all([b.getCmsFeatures(),b.getCreditSettings()]),s=(o==null?void 0:o.cms_features)??((u=o==null?void 0:o.data)==null?void 0:u.cms_features)??{},c=(d==null?void 0:d.data)??d??{};i.value={resource_cpt_enabled:s.resource_cpt_enabled!==!1,search_include_resource:s.search_include_resource!==!1,download_login:s.download_login!==!1,download_credit:s.download_credit!==!1,download_captcha:!!s.download_captcha},e.download_login=i.value.download_login,e.download_credit=i.value.download_credit,e.download_captcha=i.value.download_captcha,h.value=Number(c.download_default_cost||0)}catch(o){w.error(o.message||"加载下载权限失败")}finally{m.value=!1}}async function S(){g.value=!0;try{await b.saveCmsFeatures({...i.value,download_login:e.download_login,download_credit:e.download_credit,download_captcha:e.download_captcha}),i.value={...i.value,download_login:e.download_login,download_credit:e.download_credit,download_captcha:e.download_captcha},w.success("下载权限已保存")}catch(u){w.error(u.message||"保存失败")}finally{g.value=!1}}return B(P),(u,o)=>{const d=n("n-button"),s=n("n-space"),c=n("n-tag"),v=n("n-card"),y=n("n-switch"),k=n("n-form-item"),N=n("n-form"),T=n("n-alert"),V=n("n-spin");return F(),U("div",E,[a(M,{title:"下载权限",desc:"管理资源下载的登录、积分购买模式与验证码门槛。付费解锁走收银台订单,下载 token 不再按次扣积分。"},{actions:t(()=>[a(s,null,{default:t(()=>[a(d,{quaternary:"",onClick:o[0]||(o[0]=_=>C("/payment/paid"))},{default:t(()=>[...o[5]||(o[5]=[l("资源下载页",-1)])]),_:1}),a(d,{quaternary:"",onClick:o[1]||(o[1]=_=>C("/permissions/login"))},{default:t(()=>[...o[6]||(o[6]=[l("人机验证",-1)])]),_:1})]),_:1})]),_:1}),a(V,{show:m.value,style:{width:"100%","min-height":"200px"}},{default:t(()=>[a(v,{class:"aksrt-section-card"},{default:t(()=>[o[8]||(o[8]=r("div",{class:"aksrt-section-header"},[r("h3",null,"当前门槛摘要")],-1)),a(s,null,{default:t(()=>[a(c,{type:e.download_login?"warning":"default",round:""},{default:t(()=>[l(" 登录要求:"+f(e.download_login?"已启用":"已关闭"),1)]),_:1},8,["type"]),a(c,{type:e.download_credit?"warning":"default",round:""},{default:t(()=>[l(" 积分购买模式:"+f(e.download_credit?"已启用":"已关闭"),1)]),_:1},8,["type"]),a(c,{type:e.download_captcha?"warning":"default",round:""},{default:t(()=>[l(" 下载验证码:"+f(e.download_captcha?"已启用":"已关闭"),1)]),_:1},8,["type"]),a(c,{type:"info",round:""},{default:t(()=>[l("默认积分价参考:"+f(h.value),1)]),_:1}),a(c,{type:"info",round:""},{default:t(()=>[...o[7]||(o[7]=[l("Token TTL:10 分钟",-1)])]),_:1})]),_:1})]),_:1}),a(v,{class:"aksrt-section-card"},{default:t(()=>[o[12]||(o[12]=r("div",{class:"aksrt-section-header"},[r("h3",null,"下载门槛")],-1)),a(N,{model:e,"label-placement":"left","label-width":"180",class:"aksrt-form"},{default:t(()=>[a(k,{label:"下载需要登录"},{feedback:t(()=>[...o[9]||(o[9]=[r("span",{class:"aksrt-hint-text"},"关闭后,单个资源的登录要求仍可通过资源元字段单独覆盖。",-1)])]),default:t(()=>[a(y,{value:e.download_login,"onUpdate:value":o[2]||(o[2]=_=>e.download_login=_)},null,8,["value"])]),_:1}),a(k,{label:"允许积分购买模式"},{feedback:t(()=>[...o[10]||(o[10]=[r("span",{class:"aksrt-hint-text"},"开启后,文章 pay_modo=积分 可走收银台一次购买解锁;下载 token 不再按次扣积分。关闭时积分模式资源按免费/需登录策略处理。",-1)])]),default:t(()=>[a(y,{value:e.download_credit,"onUpdate:value":o[3]||(o[3]=_=>e.download_credit=_)},null,8,["value"])]),_:1}),a(k,{label:"下载启用验证码"},{feedback:t(()=>[...o[11]||(o[11]=[r("span",{class:"aksrt-hint-text"},"具体验证码服务商与场景白名单仍在“登录权限”页维护。",-1)])]),default:t(()=>[a(y,{value:e.download_captcha,"onUpdate:value":o[4]||(o[4]=_=>e.download_captcha=_)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1}),a(v,{class:"aksrt-section-card"},{default:t(()=>[a(T,{type:"info","show-icon":!1},{default:t(()=>[...o[13]||(o[13]=[l(" 实际价格以文章「付费内容设置」为准;本页只维护全局访问门槛。VIP 白名单与收银台策略见「支付 & 付费」相关页面。 ",-1)])]),_:1})]),_:1}),r("div",H,[a(d,{type:"primary",loading:g.value,onClick:S},{default:t(()=>[...o[14]||(o[14]=[l("保存配置",-1)])]),_:1},8,["loading"])])]),_:1},8,["show"])])}}};export{z as default};