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.
2 lines
4.5 KiB
JavaScript
2 lines
4.5 KiB
JavaScript
import{o as M,X as N,a4 as t,a3 as n,r as C,a1 as r,e as E,_ as R,W as V,f as m,Y as u,Z as f}from"./vendor-vue.Bykizn0M.js";import{a as y}from"./shared-api.D5_fnN32.js";import{P as A}from"./PageHeader.Di3JTPjc.js";import{u as U}from"./vendor-naive.BuHWlEgf.js";import"./index.js";import"./vendor-misc.1adHN6i_.js";const $={class:"aksrt-page-container"},H={class:"aksrt-form-actions"},z={__name:"CommentPermissions",setup(K){const q=R(),g=U(),b=C(!0),v=C(!1),s=E({comment_require_login:!1,comment_allow_reply:!0}),a=E({commentCaptchaEnabled:!1,moderationEnabled:!1,rateLimitEnabled:!1,keywordRuleCount:0});function w(o){q.push(o)}function P(o){return String(o||"").split(/\r?\n/).map(e=>e.trim()).filter(Boolean)}async function S(){b.value=!0;try{const[o,e,i]=await Promise.all([y.getSchemaPage("post_list","comment"),y.getPermissionsLoginSettings(),y.getPermissionsModerationSettings()]),c=(o==null?void 0:o.data)??o??{},l=(e==null?void 0:e.data)??e??{},d=(i==null?void 0:i.data)??i??{},p=Array.isArray(l.disabled_scenarios)?l.disabled_scenarios:[];s.comment_require_login=!!c.comment_require_login,s.comment_allow_reply=c.comment_allow_reply!==!1,a.commentCaptchaEnabled=!!l.enabled&&!!l.active_provider&&!p.includes("comment"),a.moderationEnabled=!!d.enabled,a.rateLimitEnabled=!!d.rate_limit_enabled,a.keywordRuleCount=P(d.blocked_keywords).length}catch(o){g.error(o.message||"加载评论权限失败")}finally{b.value=!1}}async function x(){v.value=!0;try{await y.saveSchemaPage("post_list","comment",{comment_require_login:s.comment_require_login,comment_allow_reply:s.comment_allow_reply}),g.success("评论权限已保存")}catch(o){g.error(o.message||"保存失败")}finally{v.value=!1}}return M(S),(o,e)=>{const i=r("n-button"),c=r("n-space"),l=r("n-tag"),d=r("n-card"),p=r("n-switch"),k=r("n-form-item"),h=r("n-form"),L=r("n-alert"),B=r("n-spin");return V(),N("div",$,[t(A,{title:"评论权限",desc:"管理评论入口的登录要求与回复权限,并查看当前验证码与审核策略状态。"},{actions:n(()=>[t(c,null,{default:n(()=>[t(i,{quaternary:"",onClick:e[0]||(e[0]=_=>w("/permissions/login"))},{default:n(()=>[...e[4]||(e[4]=[m("人机验证",-1)])]),_:1}),t(i,{quaternary:"",onClick:e[1]||(e[1]=_=>w("/permissions/moderation"))},{default:n(()=>[...e[5]||(e[5]=[m("审核策略",-1)])]),_:1})]),_:1})]),_:1}),t(B,{show:b.value,style:{width:"100%","min-height":"200px"}},{default:n(()=>[t(d,{class:"aksrt-section-card"},{default:n(()=>[e[6]||(e[6]=u("div",{class:"aksrt-section-header"},[u("h3",null,"当前联动状态")],-1)),t(c,null,{default:n(()=>[t(l,{type:a.commentCaptchaEnabled?"success":"default",round:""},{default:n(()=>[m(" 评论验证码:"+f(a.commentCaptchaEnabled?"已启用":"未启用"),1)]),_:1},8,["type"]),t(l,{type:a.moderationEnabled?"warning":"default",round:""},{default:n(()=>[m(" 审核链路:"+f(a.moderationEnabled?"已启用":"未启用"),1)]),_:1},8,["type"]),t(l,{type:a.rateLimitEnabled?"warning":"default",round:""},{default:n(()=>[m(" 评论限流:"+f(a.rateLimitEnabled?"已启用":"未启用"),1)]),_:1},8,["type"]),t(l,{type:a.keywordRuleCount>0?"error":"default",round:""},{default:n(()=>[m(" 敏感词:"+f(a.keywordRuleCount)+" 条 ",1)]),_:1},8,["type"])]),_:1})]),_:1}),t(d,{class:"aksrt-section-card"},{default:n(()=>[e[9]||(e[9]=u("div",{class:"aksrt-section-header"},[u("h3",null,"评论准入")],-1)),t(h,{model:s,"label-placement":"left","label-width":"180",class:"aksrt-form"},{default:n(()=>[t(k,{label:"评论需要登录"},{feedback:n(()=>[...e[7]||(e[7]=[u("span",{class:"aksrt-hint-text"},"开启后,游客只能浏览评论,不能直接提交评论。",-1)])]),default:n(()=>[t(p,{value:s.comment_require_login,"onUpdate:value":e[2]||(e[2]=_=>s.comment_require_login=_)},null,8,["value"])]),_:1}),t(k,{label:"允许楼中回复"},{feedback:n(()=>[...e[8]||(e[8]=[u("span",{class:"aksrt-hint-text"},"关闭后,前台评论列表将不再展示回复按钮。",-1)])]),default:n(()=>[t(p,{value:s.comment_allow_reply,"onUpdate:value":e[3]||(e[3]=_=>s.comment_allow_reply=_)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1}),t(d,{class:"aksrt-section-card"},{default:n(()=>[t(L,{type:"info","show-icon":!1},{default:n(()=>[...e[10]||(e[10]=[m(" 评论排序、分页方式、头像大小和空状态文案继续在“文章&列表 -> 评论设置”中维护;本页只负责准入与治理联动。 ",-1)])]),_:1})]),_:1}),u("div",H,[t(i,{type:"primary",loading:v.value,onClick:x},{default:n(()=>[...e[11]||(e[11]=[m("保存配置",-1)])]),_:1},8,["loading"])])]),_:1},8,["show"])])}}};export{z as default};
|