diff --git a/web/.env b/web/.env index f3f0ffb7..d9cbec5b 100644 --- a/web/.env +++ b/web/.env @@ -16,6 +16,8 @@ VITE_ALLOW_PHONE_BIND=true # 局部参数 VITE_DEFAULT_TWEET_VISIBILITY=friend VITE_DEFAULT_TWEET_MAX_LENGTH=300 +VITE_RIGHT_FOLLOW_TOPIC_MAX_SIZE=6 +VITE_RIGHT_HOT_TOPIC_MAX_SIZE=12 VITE_COPYRIGHT_TOP="2023 paopao.info" VITE_COPYRIGHT_LEFT="Roc's Me" VITE_COPYRIGHT_LEFT_LINK="" diff --git a/web/dist/assets/404-74e48212.js b/web/dist/assets/404-b496ccad.js similarity index 84% rename from web/dist/assets/404-74e48212.js rename to web/dist/assets/404-b496ccad.js index ba254dfa..8d84baba 100644 --- a/web/dist/assets/404-74e48212.js +++ b/web/dist/assets/404-b496ccad.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{u as a}from"./vue-router-29025daf.js";import{F as i,e as c,a2 as u}from"./naive-ui-ddb574dd.js";import{d as l,c as d,L as t,Y as o,o as f,e as x}from"./@vue-f70ab1bd.js";import{_ as g}from"./index-f6017bc3.js";import"./vuex-cc1858c6.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./@vicons-2f3cb6b9.js";import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const K=g(v,[["__scopeId","data-v-e62daa85"]]);export{K as default}; +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{u as a}from"./vue-router-29025daf.js";import{F as i,e as c,a2 as u}from"./naive-ui-ddb574dd.js";import{d as l,c as d,L as t,Y as o,o as f,e as x}from"./@vue-f70ab1bd.js";import{_ as g}from"./index-cfa0bdbf.js";import"./vuex-cc1858c6.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./@vicons-2f3cb6b9.js";import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const K=g(v,[["__scopeId","data-v-e62daa85"]]);export{K as default}; diff --git a/web/dist/assets/Anouncement-1028ef75.js b/web/dist/assets/Anouncement-c45d8cb5.js similarity index 91% rename from web/dist/assets/Anouncement-1028ef75.js rename to web/dist/assets/Anouncement-c45d8cb5.js index efeeb606..db651348 100644 --- a/web/dist/assets/Anouncement-1028ef75.js +++ b/web/dist/assets/Anouncement-c45d8cb5.js @@ -1 +1 @@ -import{_ as F}from"./post-skeleton-fdf95824.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{u as z}from"./vuex-cc1858c6.js";import{b as A}from"./vue-router-29025daf.js";import{a as R}from"./formatTime-936c40eb.js";import{d as S,r as n,j as V,c as o,L as a,Y as p,o as e,U as u,O as l,F as I,$ as L,K as M,a as s,M as _,a1 as O}from"./@vue-f70ab1bd.js";import{F as P,G as U,I as $,H as j}from"./naive-ui-ddb574dd.js";import{_ as q}from"./index-f6017bc3.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./@vicons-2f3cb6b9.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";/* empty css */const D={key:0,class:"pagination-wrap"},E={key:0,class:"skeleton-wrap"},G={key:1},H={key:0,class:"empty-wrap"},K={class:"bill-line"},T=S({__name:"Anouncement",setup(Y){const d=z(),g=A(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return V(()=>{}),(m,J)=>{const y=N,k=U,x=F,w=$,B=j,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",D,[a(k,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",E,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",G,[r.value.length===0?(e(),o("div",H,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",K,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(R)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=q(T,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; +import{_ as F}from"./post-skeleton-a79b6d6f.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{u as z}from"./vuex-cc1858c6.js";import{b as A}from"./vue-router-29025daf.js";import{a as R}from"./formatTime-936c40eb.js";import{d as S,r as n,j as V,c as o,L as a,Y as p,o as e,U as u,O as l,F as I,$ as L,K as M,a as s,M as _,a1 as O}from"./@vue-f70ab1bd.js";import{F as P,G as U,I as $,H as j}from"./naive-ui-ddb574dd.js";import{_ as q}from"./index-cfa0bdbf.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./@vicons-2f3cb6b9.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";/* empty css */const D={key:0,class:"pagination-wrap"},E={key:0,class:"skeleton-wrap"},G={key:1},H={key:0,class:"empty-wrap"},K={class:"bill-line"},T=S({__name:"Anouncement",setup(Y){const d=z(),g=A(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return V(()=>{}),(m,J)=>{const y=N,k=U,x=F,w=$,B=j,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",D,[a(k,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",E,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",G,[r.value.length===0?(e(),o("div",H,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",K,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(R)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=q(T,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; diff --git a/web/dist/assets/Collection-209a2041.js b/web/dist/assets/Collection-161cc0df.js similarity index 83% rename from web/dist/assets/Collection-209a2041.js rename to web/dist/assets/Collection-161cc0df.js index 53c69ca0..2da170fa 100644 --- a/web/dist/assets/Collection-209a2041.js +++ b/web/dist/assets/Collection-161cc0df.js @@ -1 +1 @@ -import{_ as z}from"./post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js";import{_ as B}from"./post-skeleton-fdf95824.js";import{_ as F}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{u as P}from"./vuex-cc1858c6.js";import{b as R,u as $}from"./vue-router-29025daf.js";import{G as b,_ as G}from"./index-f6017bc3.js";import{d as I,r as s,j as L,c as e,L as n,Y as m,U as M,O as u,o as t,F as N,$ as S,K as U}from"./@vue-f70ab1bd.js";import{F as V,G as j,I as q,H as E}from"./naive-ui-ddb574dd.js";import"./content-0b348d1e.js";import"./@vicons-2f3cb6b9.js";import"./nonesir-video-29a967e9.js";import"./formatTime-936c40eb.js";import"./moment-b7869f98.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const H={key:0,class:"skeleton-wrap"},K={key:1},O={key:0,class:"empty-wrap"},T={key:0,class:"pagination-wrap"},Y=I({__name:"Collection",setup(A){const d=P(),g=R();$();const a=s(!1),_=s([]),p=s(+g.query.p||1),i=s(20),r=s(0),l=()=>{a.value=!0,b({page:p.value,page_size:i.value}).then(o=>{a.value=!1,_.value=o.list,r.value=Math.ceil(o.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(o=>{a.value=!1})},v=o=>{p.value=o,l()};return L(()=>{l()}),(o,D)=>{const f=F,h=B,k=q,y=z,w=E,C=V,x=j;return t(),e("div",null,[n(f,{title:"收藏"}),n(C,{class:"main-content-wrap",bordered:""},{default:m(()=>[a.value?(t(),e("div",H,[n(h,{num:i.value},null,8,["num"])])):(t(),e("div",K,[_.value.length===0?(t(),e("div",O,[n(k,{size:"large",description:"暂无数据"})])):u("",!0),(t(!0),e(N,null,S(_.value,c=>(t(),U(w,{key:c.id},{default:m(()=>[n(y,{post:c},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),r.value>0?(t(),e("div",T,[n(x,{page:p.value,"onUpdate:page":v,"page-slot":M(d).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):u("",!0)])}}});const xt=G(Y,[["__scopeId","data-v-1e709369"]]);export{xt as default}; +import{_ as z}from"./post-item.vue_vue_type_style_index_0_lang-bc7656ee.js";import{_ as B}from"./post-skeleton-a79b6d6f.js";import{_ as F}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{u as P}from"./vuex-cc1858c6.js";import{b as R,u as $}from"./vue-router-29025daf.js";import{G as b,_ as G}from"./index-cfa0bdbf.js";import{d as I,r as s,j as L,c as e,L as n,Y as m,U as M,O as u,o as t,F as N,$ as S,K as U}from"./@vue-f70ab1bd.js";import{F as V,G as j,I as q,H as E}from"./naive-ui-ddb574dd.js";import"./content-43b82f8f.js";import"./@vicons-2f3cb6b9.js";import"./nonesir-video-29a967e9.js";import"./formatTime-936c40eb.js";import"./moment-b7869f98.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const H={key:0,class:"skeleton-wrap"},K={key:1},O={key:0,class:"empty-wrap"},T={key:0,class:"pagination-wrap"},Y=I({__name:"Collection",setup(A){const d=P(),g=R();$();const a=s(!1),_=s([]),p=s(+g.query.p||1),i=s(20),r=s(0),l=()=>{a.value=!0,b({page:p.value,page_size:i.value}).then(o=>{a.value=!1,_.value=o.list,r.value=Math.ceil(o.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(o=>{a.value=!1})},v=o=>{p.value=o,l()};return L(()=>{l()}),(o,D)=>{const f=F,h=B,k=q,y=z,w=E,C=V,x=j;return t(),e("div",null,[n(f,{title:"收藏"}),n(C,{class:"main-content-wrap",bordered:""},{default:m(()=>[a.value?(t(),e("div",H,[n(h,{num:i.value},null,8,["num"])])):(t(),e("div",K,[_.value.length===0?(t(),e("div",O,[n(k,{size:"large",description:"暂无数据"})])):u("",!0),(t(!0),e(N,null,S(_.value,c=>(t(),U(w,{key:c.id},{default:m(()=>[n(y,{post:c},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),r.value>0?(t(),e("div",T,[n(x,{page:p.value,"onUpdate:page":v,"page-slot":M(d).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):u("",!0)])}}});const xt=G(Y,[["__scopeId","data-v-1e709369"]]);export{xt as default}; diff --git a/web/dist/assets/Contacts-d49a42ff.js b/web/dist/assets/Contacts-0f2e935d.js similarity index 93% rename from web/dist/assets/Contacts-d49a42ff.js rename to web/dist/assets/Contacts-0f2e935d.js index 0a2a74ce..627cd68f 100644 --- a/web/dist/assets/Contacts-d49a42ff.js +++ b/web/dist/assets/Contacts-0f2e935d.js @@ -1 +1 @@ -import{u as M,b as N}from"./vue-router-29025daf.js";import{d as b,o as t,c as n,a as s,L as a,M as v,r as i,j as P,Y as h,U as R,O as y,F as k,$ as S,K as V}from"./@vue-f70ab1bd.js";import{o as q,F as D,G as L,I as T,H as j}from"./naive-ui-ddb574dd.js";import{_ as C,J as E}from"./index-f6017bc3.js";import{_ as G}from"./post-skeleton-fdf95824.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{u as J}from"./vuex-cc1858c6.js";import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";import"./@vicons-2f3cb6b9.js";/* empty css */const K={class:"avatar"},O={class:"base-info"},Y={class:"username"},A={class:"uid"},Q=b({__name:"contact-item",props:{contact:null},setup(c){const p=M(),m=e=>{p.push({name:"user",query:{username:e}})};return(e,o)=>{const _=q;return t(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=l=>m(c.contact.username))},[s("div",K,[a(_,{size:"large",src:c.contact.avatar},null,8,["src"])]),s("div",O,[s("div",Y,[s("strong",null,v(c.contact.nickname),1),s("span",null," @"+v(c.contact.username),1)]),s("div",A,"UID. "+v(c.contact.user_id),1)])])}}});const W=C(Q,[["__scopeId","data-v-08ee9b2e"]]),X={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=b({__name:"Contacts",setup(c){const p=J(),m=N(),e=i(!1),o=i([]),_=i(+m.query.p||1),l=i(20),d=i(0),$=r=>{_.value=r,g()};P(()=>{g()});const g=(r=!1)=>{o.value.length===0&&(e.value=!0),E({page:_.value,page_size:l.value}).then(u=>{e.value=!1,o.value=u.list,d.value=Math.ceil(u.pager.total_rows/l.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(u=>{e.value=!1})};return(r,u)=>{const w=H,x=G,I=T,z=W,B=j,U=D,F=L;return t(),n(k,null,[s("div",null,[a(w,{title:"好友"}),a(U,{class:"main-content-wrap",bordered:""},{default:h(()=>[e.value?(t(),n("div",X,[a(x,{num:l.value},null,8,["num"])])):(t(),n("div",Z,[o.value.length===0?(t(),n("div",tt,[a(I,{size:"large",description:"暂无数据"})])):y("",!0),(t(!0),n(k,null,S(o.value,f=>(t(),V(B,{key:f.user_id},{default:h(()=>[a(z,{contact:f},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(t(),n("div",et,[a(F,{page:_.value,"onUpdate:page":$,"page-slot":R(p).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):y("",!0)],64)}}});const It=C(ot,[["__scopeId","data-v-3b2bf978"]]);export{It as default}; +import{u as M,b as N}from"./vue-router-29025daf.js";import{d as b,o as t,c as n,a as s,L as a,M as v,r as i,j as P,Y as h,U as R,O as y,F as k,$ as S,K as V}from"./@vue-f70ab1bd.js";import{o as q,F as D,G as L,I as T,H as j}from"./naive-ui-ddb574dd.js";import{_ as C,J as E}from"./index-cfa0bdbf.js";import{_ as G}from"./post-skeleton-a79b6d6f.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{u as J}from"./vuex-cc1858c6.js";import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";import"./@vicons-2f3cb6b9.js";/* empty css */const K={class:"avatar"},O={class:"base-info"},Y={class:"username"},A={class:"uid"},Q=b({__name:"contact-item",props:{contact:null},setup(c){const p=M(),m=e=>{p.push({name:"user",query:{username:e}})};return(e,o)=>{const _=q;return t(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=l=>m(c.contact.username))},[s("div",K,[a(_,{size:"large",src:c.contact.avatar},null,8,["src"])]),s("div",O,[s("div",Y,[s("strong",null,v(c.contact.nickname),1),s("span",null," @"+v(c.contact.username),1)]),s("div",A,"UID. "+v(c.contact.user_id),1)])])}}});const W=C(Q,[["__scopeId","data-v-08ee9b2e"]]),X={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=b({__name:"Contacts",setup(c){const p=J(),m=N(),e=i(!1),o=i([]),_=i(+m.query.p||1),l=i(20),d=i(0),$=r=>{_.value=r,g()};P(()=>{g()});const g=(r=!1)=>{o.value.length===0&&(e.value=!0),E({page:_.value,page_size:l.value}).then(u=>{e.value=!1,o.value=u.list,d.value=Math.ceil(u.pager.total_rows/l.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(u=>{e.value=!1})};return(r,u)=>{const w=H,x=G,I=T,z=W,B=j,U=D,F=L;return t(),n(k,null,[s("div",null,[a(w,{title:"好友"}),a(U,{class:"main-content-wrap",bordered:""},{default:h(()=>[e.value?(t(),n("div",X,[a(x,{num:l.value},null,8,["num"])])):(t(),n("div",Z,[o.value.length===0?(t(),n("div",tt,[a(I,{size:"large",description:"暂无数据"})])):y("",!0),(t(!0),n(k,null,S(o.value,f=>(t(),V(B,{key:f.user_id},{default:h(()=>[a(z,{contact:f},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(t(),n("div",et,[a(F,{page:_.value,"onUpdate:page":$,"page-slot":R(p).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):y("",!0)],64)}}});const It=C(ot,[["__scopeId","data-v-3b2bf978"]]);export{It as default}; diff --git a/web/dist/assets/Home-adef1ded.js b/web/dist/assets/Home-227299a1.js similarity index 97% rename from web/dist/assets/Home-adef1ded.js rename to web/dist/assets/Home-227299a1.js index a695d1e9..01a223b9 100644 --- a/web/dist/assets/Home-adef1ded.js +++ b/web/dist/assets/Home-227299a1.js @@ -1 +1 @@ -import{_ as qe}from"./post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js";import{_ as Ie}from"./post-skeleton-fdf95824.js";import{d as Q,r as l,j as X,o as c,c as v,U as $,a as I,L as t,Y as s,K as N,O as q,Z as K,e as z,M as G,F as Y,$ as Z,n as Te,w as Ue}from"./@vue-f70ab1bd.js";import{u as W}from"./vuex-cc1858c6.js";import{l as J}from"./lodash-3329902d.js";import{g as xe,a as Ee,c as Re,b as Le,_ as ze}from"./index-f6017bc3.js";import{p as Ae}from"./content-0b348d1e.js";import{V as T,P as S}from"./IEnum-ea67d3af.js";import{I as Pe,V as Se,A as Ne,d as Ve,E as Be}from"./@vicons-2f3cb6b9.js";import{o as Oe,v as Me,j as Fe,e as De,w as je,x as He,y as Ke,z as Ge,A as Je,B as Qe,C as Xe,a as Ye,D as Ze,E as We,F as et,G as tt,H as at,I as ot}from"./naive-ui-ddb574dd.js";import{_ as nt}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{b as st,u as lt}from"./vue-router-29025daf.js";import"./formatTime-936c40eb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./nonesir-video-29a967e9.js";const it={key:0,class:"compose-wrap"},ut={class:"compose-line"},rt={class:"compose-user"},ct={class:"compose-line compose-options"},pt={class:"attachment"},_t={class:"submit-wrap"},dt={class:"attachment-list-wrap"},mt={key:0,class:"attachment-price-wrap"},vt=I("span",null," 附件价格¥",-1),gt={key:0,class:"eye-wrap"},ft={key:1,class:"link-wrap"},yt={key:1,class:"compose-wrap"},ht=I("div",{class:"login-wrap"},[I("span",{class:"login-banner"}," 登录后,精彩更多")],-1),wt={key:0,class:"login-only-wrap"},bt={key:1,class:"login-wrap"},kt=Q({__name:"compose",emits:["post-success"],setup(ee,{emit:V}){const r=W(),E=l([]),y=l(!1),h=l(!1),f=l(!1),w=l(!1),b=l(""),U=l([]),R=l(),A=l(0),d=l("public/image"),i=l([]),g=l([]),k=l([]),m=l([]),C=l(T.FRIEND),x=l(T.FRIEND),M=[{value:T.PUBLIC,label:"公开"},{value:T.PRIVATE,label:"私密"},{value:T.FRIEND,label:"好友可见"}],P=+"300",B=l("true".toLowerCase()==="true"),F=l("true".toLowerCase()==="true"),O=l("true".toLowerCase()==="true"),te=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),oe="/v1/attachment",H=l(),ne=()=>{f.value=!f.value,f.value&&w.value&&(w.value=!1)},se=()=>{w.value=!w.value,w.value&&f.value&&(f.value=!1)},le=J.debounce(a=>{xe({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ie=J.debounce(a=>{Ee({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ue=(a,e)=>{y.value||(y.value=!0,e==="@"?le(a):ie(a))},re=a=>{a.length>P||(b.value=a)},D=a=>{d.value=a},ce=a=>{i.value=a},pe=async a=>{var e,n,o,u,_,L;return d.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=a.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):d.value==="image"&&((n=a.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):d.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=a.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):d.value==="public/video"&&((u=a.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):d.value==="attachment"&&!["application/zip"].includes((_=a.file.file)==null?void 0:_.type)?(window.$message.warning("附件仅允许 zip 格式"),!1):d.value==="attachment"&&((L=a.file.file)==null?void 0:L.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(d.value==="public/image"&&g.value.push({id:a.id,content:o.data.content}),d.value==="public/video"&&k.value.push({id:a.id,content:o.data.content}),d.value==="attachment"&&m.value.push({id:a.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let u=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(_=>{u+=":"+_}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},me=({file:a})=>{let e=g.value.findIndex(n=>n.id===a.id);e>-1&&g.value.splice(e,1),e=k.value.findIndex(n=>n.id===a.id),e>-1&&k.value.splice(e,1),e=m.value.findIndex(n=>n.id===a.id),e>-1&&m.value.splice(e,1)},ve=()=>{if(b.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:a,users:e}=Ae(b.value);const n=[];let o=100;n.push({content:b.value,type:S.TEXT,sort:o}),g.value.map(u=>{o++,n.push({content:u.content,type:S.IMAGEURL,sort:o})}),k.value.map(u=>{o++,n.push({content:u.content,type:S.VIDEOURL,sort:o})}),m.value.map(u=>{o++,n.push({content:u.content,type:S.ATTACHMENT,sort:o})}),U.value.length>0&&U.value.map(u=>{o++,n.push({content:u,type:S.LINKURL,sort:o})}),h.value=!0,Re({contents:n,tags:Array.from(new Set(a)),users:Array.from(new Set(e)),attachment_price:+A.value*100,visibility:C.value}).then(u=>{var _;window.$message.success("发布成功"),h.value=!1,V("post-success",u),f.value=!1,w.value=!1,(_=R.value)==null||_.clear(),i.value=[],b.value="",U.value=[],g.value=[],k.value=[],m.value=[],C.value=x.value}).catch(u=>{h.value=!1})},j=a=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",a)};return X(()=>{"friend".toLowerCase()==="friend"?x.value=T.FRIEND:"friend".toLowerCase()==="public"?x.value=T.PUBLIC:x.value=T.PRIVATE,C.value=x.value,H.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(a,e)=>{const n=Oe,o=Me,u=Fe,_=De,L=je,ge=He,fe=Ke,ye=Ge,he=Je,we=Qe,be=Xe,ke=Ye,Ce=Ze,$e=We;return c(),v("div",null,[$(r).state.userInfo.id>0?(c(),v("div",it,[I("div",ut,[I("div",rt,[t(n,{round:"",size:30,src:$(r).state.userInfo.avatar},null,8,["src"])]),t(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:y.value,value:b.value,prefix:["@","#"],options:E.value,onSearch:ue,"onUpdate:value":re,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),t(we,{ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:H.value},data:{type:d.value},onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[I("div",ct,[I("div",pt,[t(L,{abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value==="public/video"||i.value.length===9,onClick:()=>{D("public/image"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Pe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),F.value?(c(),N(L,{key:0,abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value!=="public/video"||i.value.length===9,onClick:()=>{D("public/video"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):q("",!0),O.value?(c(),N(L,{key:1,abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value==="public/video"||i.value.length===9,onClick:()=>{D("attachment"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):q("",!0),t(_,{quaternary:"",circle:"",type:"primary",onClick:K(ne,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ve))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),N(_,{key:2,quaternary:"",circle:"",type:"primary",onClick:K(se,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Be))]),_:1})]),_:1},8,["onClick"])):q("",!0)]),I("div",_t,[t(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[t(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:b.value.length/$(P)*100},null,8,["percentage"])]),default:s(()=>[z(" "+G(b.value.length)+" / "+G($(P)),1)]),_:1}),t(_,{loading:h.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[z(" 发布 ")]),_:1},8,["loading"])])]),I("div",dt,[t(ye),m.value.length>0?(c(),v("div",mt,[te.value?(c(),N(he,{key:0,value:A.value,"onUpdate:value":e[0]||(e[0]=p=>A.value=p),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[vt]),_:1},8,["value"])):q("",!0)])):q("",!0)])]),_:1},8,["headers","data"]),w.value?(c(),v("div",gt,[t(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=p=>C.value=p),name:"radiogroup"},{default:s(()=>[t(ke,null,{default:s(()=>[(c(),v(Y,null,Z(M,p=>t(be,{key:p.value,value:p.value,label:p.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):q("",!0),f.value?(c(),v("div",ft,[t($e,{value:U.value,"onUpdate:value":e[2]||(e[2]=p=>U.value=p),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[z(" 创建链接 ")]),_:1},8,["value"])])):q("",!0)])):(c(),v("div",yt,[ht,B.value?q("",!0):(c(),v("div",wt,[t(_,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=p=>j("signin"))},{default:s(()=>[z(" 登录 ")]),_:1})])),B.value?(c(),v("div",bt,[t(_,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=p=>j("signin"))},{default:s(()=>[z(" 登录 ")]),_:1}),t(_,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=p=>j("signup"))},{default:s(()=>[z(" 注册 ")]),_:1})])):q("",!0)]))])}}});const Ct={key:0,class:"skeleton-wrap"},$t={key:1},qt={key:0,class:"empty-wrap"},It={key:0,class:"pagination-wrap"},Tt=Q({__name:"Home",setup(ee){const V=W(),r=st(),E=lt(),y=l(!1),h=l([]),f=l(+r.query.p||1),w=l(20),b=l(0),U=Te(()=>{let i="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?i="#"+decodeURIComponent(r.query.q):i="搜索: "+decodeURIComponent(r.query.q)),i}),R=()=>{y.value=!0,Le({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:f.value,page_size:w.value}).then(i=>{y.value=!1,h.value=i.list,b.value=Math.ceil(i.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(i=>{y.value=!1})},A=i=>{if(f.value!=1){E.push({name:"post",query:{id:i.id}});return}let g=[],k=h.value.length;k==w.value&&k--;for(var m=0;m{E.push({name:"home",query:{...r.query,p:i}})};return X(()=>{R()}),Ue(()=>({path:r.path,query:r.query,refresh:V.state.refresh}),(i,g)=>{if(i.refresh!==g.refresh){f.value=+r.query.p||1,setTimeout(()=>{R()},0);return}g.path!=="/post"&&i.path==="/"&&(f.value=+r.query.p||1,setTimeout(()=>{R()},0))}),(i,g)=>{const k=nt,m=kt,C=at,x=Ie,M=ot,P=qe,B=et,F=tt;return c(),v("div",null,[t(k,{title:$(U)},null,8,["title"]),t(B,{class:"main-content-wrap",bordered:""},{default:s(()=>[t(C,null,{default:s(()=>[t(m,{onPostSuccess:A})]),_:1}),y.value?(c(),v("div",Ct,[t(x,{num:w.value},null,8,["num"])])):(c(),v("div",$t,[h.value.length===0?(c(),v("div",qt,[t(M,{size:"large",description:"暂无数据"})])):q("",!0),(c(!0),v(Y,null,Z(h.value,O=>(c(),N(C,{key:O.id},{default:s(()=>[t(P,{post:O},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),b.value>0?(c(),v("div",It,[t(F,{page:f.value,"onUpdate:page":d,"page-slot":$(V).state.collapsedRight?5:8,"page-count":b.value},null,8,["page","page-slot","page-count"])])):q("",!0)])}}});const la=ze(Tt,[["__scopeId","data-v-936146f2"]]);export{la as default}; +import{_ as qe}from"./post-item.vue_vue_type_style_index_0_lang-bc7656ee.js";import{_ as Ie}from"./post-skeleton-a79b6d6f.js";import{d as Q,r as l,j as X,o as c,c as v,U as $,a as I,L as t,Y as s,K as N,O as q,Z as K,e as z,M as G,F as Y,$ as Z,n as Te,w as Ue}from"./@vue-f70ab1bd.js";import{u as W}from"./vuex-cc1858c6.js";import{l as J}from"./lodash-3329902d.js";import{g as xe,a as Ee,c as Re,b as Le,_ as ze}from"./index-cfa0bdbf.js";import{p as Ae}from"./content-43b82f8f.js";import{V as T,P as S}from"./IEnum-ea67d3af.js";import{I as Pe,V as Se,A as Ne,d as Ve,E as Be}from"./@vicons-2f3cb6b9.js";import{o as Oe,v as Me,j as Fe,e as De,w as je,x as He,y as Ke,z as Ge,A as Je,B as Qe,C as Xe,a as Ye,D as Ze,E as We,F as et,G as tt,H as at,I as ot}from"./naive-ui-ddb574dd.js";import{_ as nt}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{b as st,u as lt}from"./vue-router-29025daf.js";import"./formatTime-936c40eb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./nonesir-video-29a967e9.js";const it={key:0,class:"compose-wrap"},ut={class:"compose-line"},rt={class:"compose-user"},ct={class:"compose-line compose-options"},pt={class:"attachment"},_t={class:"submit-wrap"},dt={class:"attachment-list-wrap"},mt={key:0,class:"attachment-price-wrap"},vt=I("span",null," 附件价格¥",-1),gt={key:0,class:"eye-wrap"},ft={key:1,class:"link-wrap"},yt={key:1,class:"compose-wrap"},ht=I("div",{class:"login-wrap"},[I("span",{class:"login-banner"}," 登录后,精彩更多")],-1),wt={key:0,class:"login-only-wrap"},bt={key:1,class:"login-wrap"},kt=Q({__name:"compose",emits:["post-success"],setup(ee,{emit:V}){const r=W(),E=l([]),y=l(!1),h=l(!1),f=l(!1),w=l(!1),b=l(""),U=l([]),R=l(),A=l(0),d=l("public/image"),i=l([]),g=l([]),k=l([]),m=l([]),C=l(T.FRIEND),x=l(T.FRIEND),M=[{value:T.PUBLIC,label:"公开"},{value:T.PRIVATE,label:"私密"},{value:T.FRIEND,label:"好友可见"}],P=+"300",B=l("true".toLowerCase()==="true"),F=l("true".toLowerCase()==="true"),O=l("true".toLowerCase()==="true"),te=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),oe="/v1/attachment",H=l(),ne=()=>{f.value=!f.value,f.value&&w.value&&(w.value=!1)},se=()=>{w.value=!w.value,w.value&&f.value&&(f.value=!1)},le=J.debounce(a=>{xe({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ie=J.debounce(a=>{Ee({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ue=(a,e)=>{y.value||(y.value=!0,e==="@"?le(a):ie(a))},re=a=>{a.length>P||(b.value=a)},D=a=>{d.value=a},ce=a=>{i.value=a},pe=async a=>{var e,n,o,u,_,L;return d.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=a.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):d.value==="image"&&((n=a.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):d.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=a.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):d.value==="public/video"&&((u=a.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):d.value==="attachment"&&!["application/zip"].includes((_=a.file.file)==null?void 0:_.type)?(window.$message.warning("附件仅允许 zip 格式"),!1):d.value==="attachment"&&((L=a.file.file)==null?void 0:L.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(d.value==="public/image"&&g.value.push({id:a.id,content:o.data.content}),d.value==="public/video"&&k.value.push({id:a.id,content:o.data.content}),d.value==="attachment"&&m.value.push({id:a.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let u=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(_=>{u+=":"+_}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},me=({file:a})=>{let e=g.value.findIndex(n=>n.id===a.id);e>-1&&g.value.splice(e,1),e=k.value.findIndex(n=>n.id===a.id),e>-1&&k.value.splice(e,1),e=m.value.findIndex(n=>n.id===a.id),e>-1&&m.value.splice(e,1)},ve=()=>{if(b.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:a,users:e}=Ae(b.value);const n=[];let o=100;n.push({content:b.value,type:S.TEXT,sort:o}),g.value.map(u=>{o++,n.push({content:u.content,type:S.IMAGEURL,sort:o})}),k.value.map(u=>{o++,n.push({content:u.content,type:S.VIDEOURL,sort:o})}),m.value.map(u=>{o++,n.push({content:u.content,type:S.ATTACHMENT,sort:o})}),U.value.length>0&&U.value.map(u=>{o++,n.push({content:u,type:S.LINKURL,sort:o})}),h.value=!0,Re({contents:n,tags:Array.from(new Set(a)),users:Array.from(new Set(e)),attachment_price:+A.value*100,visibility:C.value}).then(u=>{var _;window.$message.success("发布成功"),h.value=!1,V("post-success",u),f.value=!1,w.value=!1,(_=R.value)==null||_.clear(),i.value=[],b.value="",U.value=[],g.value=[],k.value=[],m.value=[],C.value=x.value}).catch(u=>{h.value=!1})},j=a=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",a)};return X(()=>{"friend".toLowerCase()==="friend"?x.value=T.FRIEND:"friend".toLowerCase()==="public"?x.value=T.PUBLIC:x.value=T.PRIVATE,C.value=x.value,H.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(a,e)=>{const n=Oe,o=Me,u=Fe,_=De,L=je,ge=He,fe=Ke,ye=Ge,he=Je,we=Qe,be=Xe,ke=Ye,Ce=Ze,$e=We;return c(),v("div",null,[$(r).state.userInfo.id>0?(c(),v("div",it,[I("div",ut,[I("div",rt,[t(n,{round:"",size:30,src:$(r).state.userInfo.avatar},null,8,["src"])]),t(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:y.value,value:b.value,prefix:["@","#"],options:E.value,onSearch:ue,"onUpdate:value":re,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),t(we,{ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:H.value},data:{type:d.value},onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[I("div",ct,[I("div",pt,[t(L,{abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value==="public/video"||i.value.length===9,onClick:()=>{D("public/image"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Pe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),F.value?(c(),N(L,{key:0,abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value!=="public/video"||i.value.length===9,onClick:()=>{D("public/video"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):q("",!0),O.value?(c(),N(L,{key:1,abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value==="public/video"||i.value.length===9,onClick:()=>{D("attachment"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):q("",!0),t(_,{quaternary:"",circle:"",type:"primary",onClick:K(ne,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ve))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),N(_,{key:2,quaternary:"",circle:"",type:"primary",onClick:K(se,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Be))]),_:1})]),_:1},8,["onClick"])):q("",!0)]),I("div",_t,[t(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[t(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:b.value.length/$(P)*100},null,8,["percentage"])]),default:s(()=>[z(" "+G(b.value.length)+" / "+G($(P)),1)]),_:1}),t(_,{loading:h.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[z(" 发布 ")]),_:1},8,["loading"])])]),I("div",dt,[t(ye),m.value.length>0?(c(),v("div",mt,[te.value?(c(),N(he,{key:0,value:A.value,"onUpdate:value":e[0]||(e[0]=p=>A.value=p),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[vt]),_:1},8,["value"])):q("",!0)])):q("",!0)])]),_:1},8,["headers","data"]),w.value?(c(),v("div",gt,[t(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=p=>C.value=p),name:"radiogroup"},{default:s(()=>[t(ke,null,{default:s(()=>[(c(),v(Y,null,Z(M,p=>t(be,{key:p.value,value:p.value,label:p.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):q("",!0),f.value?(c(),v("div",ft,[t($e,{value:U.value,"onUpdate:value":e[2]||(e[2]=p=>U.value=p),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[z(" 创建链接 ")]),_:1},8,["value"])])):q("",!0)])):(c(),v("div",yt,[ht,B.value?q("",!0):(c(),v("div",wt,[t(_,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=p=>j("signin"))},{default:s(()=>[z(" 登录 ")]),_:1})])),B.value?(c(),v("div",bt,[t(_,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=p=>j("signin"))},{default:s(()=>[z(" 登录 ")]),_:1}),t(_,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=p=>j("signup"))},{default:s(()=>[z(" 注册 ")]),_:1})])):q("",!0)]))])}}});const Ct={key:0,class:"skeleton-wrap"},$t={key:1},qt={key:0,class:"empty-wrap"},It={key:0,class:"pagination-wrap"},Tt=Q({__name:"Home",setup(ee){const V=W(),r=st(),E=lt(),y=l(!1),h=l([]),f=l(+r.query.p||1),w=l(20),b=l(0),U=Te(()=>{let i="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?i="#"+decodeURIComponent(r.query.q):i="搜索: "+decodeURIComponent(r.query.q)),i}),R=()=>{y.value=!0,Le({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:f.value,page_size:w.value}).then(i=>{y.value=!1,h.value=i.list,b.value=Math.ceil(i.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(i=>{y.value=!1})},A=i=>{if(f.value!=1){E.push({name:"post",query:{id:i.id}});return}let g=[],k=h.value.length;k==w.value&&k--;for(var m=0;m{E.push({name:"home",query:{...r.query,p:i}})};return X(()=>{R()}),Ue(()=>({path:r.path,query:r.query,refresh:V.state.refresh}),(i,g)=>{if(i.refresh!==g.refresh){f.value=+r.query.p||1,setTimeout(()=>{R()},0);return}g.path!=="/post"&&i.path==="/"&&(f.value=+r.query.p||1,setTimeout(()=>{R()},0))}),(i,g)=>{const k=nt,m=kt,C=at,x=Ie,M=ot,P=qe,B=et,F=tt;return c(),v("div",null,[t(k,{title:$(U)},null,8,["title"]),t(B,{class:"main-content-wrap",bordered:""},{default:s(()=>[t(C,null,{default:s(()=>[t(m,{onPostSuccess:A})]),_:1}),y.value?(c(),v("div",Ct,[t(x,{num:w.value},null,8,["num"])])):(c(),v("div",$t,[h.value.length===0?(c(),v("div",qt,[t(M,{size:"large",description:"暂无数据"})])):q("",!0),(c(!0),v(Y,null,Z(h.value,O=>(c(),N(C,{key:O.id},{default:s(()=>[t(P,{post:O},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),b.value>0?(c(),v("div",It,[t(F,{page:f.value,"onUpdate:page":d,"page-slot":$(V).state.collapsedRight?5:8,"page-count":b.value},null,8,["page","page-slot","page-count"])])):q("",!0)])}}});const la=ze(Tt,[["__scopeId","data-v-936146f2"]]);export{la as default}; diff --git a/web/dist/assets/Messages-b6f6d433.js b/web/dist/assets/Messages-2ff8f262.js similarity index 97% rename from web/dist/assets/Messages-b6f6d433.js rename to web/dist/assets/Messages-2ff8f262.js index f71ed184..da8da6c8 100644 --- a/web/dist/assets/Messages-b6f6d433.js +++ b/web/dist/assets/Messages-2ff8f262.js @@ -1 +1 @@ -import{d as b,_ as D,o as a,c as o,L as n,Y as i,a as k,Z as $,e as u,M as g,K as N,O as l,U as p,a1 as V,$ as O,F as R,r as y,j as A}from"./@vue-f70ab1bd.js";import{u as L,b as U}from"./vue-router-29025daf.js";import{C as E,D as P,E as T,_ as F,F as G}from"./index-f6017bc3.js";import{a as H}from"./formatTime-936c40eb.js";import{m as K,n as Y,o as z,p as Z}from"./@vicons-2f3cb6b9.js";import{o as J,l as Q,j as W,S as X,L as ee,U as se,F as te,G as ne,I as ae,H as oe}from"./naive-ui-ddb574dd.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{u as le}from"./vuex-cc1858c6.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";const re={class:"sender-wrap"},ce={key:0,class:"nickname"},_e={class:"username"},ue={key:1,class:"nickname"},de={class:"timestamp"},me={class:"timestamp-txt"},pe={key:0,class:"brief-content"},ge={key:1,class:"whisper-content-wrap"},ve={key:2,class:"requesting-friend-wrap"},fe={key:2,class:"status-info"},ye={key:3,class:"status-info"},ke=b({__name:"message-item",props:{message:null},setup(e){const h="https://assets.paopao.info/public/avatar/default/admin.png",w=L(),r=s=>{c(s),(s.type===1||s.type===2||s.type===3)&&(s.post&&s.post.id>0?w.push({name:"post",query:{id:s.post_id}}):window.$message.error("该动态已被删除"))},d=s=>{c(s),E({user_id:s.sender_user_id}).then(t=>{s.reply_id=2,window.$message.success("已同意添加好友")}).catch(t=>{console.log(t)})},v=s=>{c(s),P({user_id:s.sender_user_id}).then(t=>{s.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(t=>{console.log(t)})},c=s=>{s.is_read===0&&T({id:s.id}).then(t=>{s.is_read=1}).catch(t=>{console.log(t)})};return(s,t)=>{const x=J,_=D("router-link"),I=Q,m=W,C=X,M=ee;return a(),o("div",{class:V(["message-item",{unread:e.message.is_read===0}]),onClick:t[4]||(t[4]=f=>c(e.message))},[n(M,{"content-indented":""},{avatar:i(()=>[n(x,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:h},null,8,["src"])]),header:i(()=>[k("div",re,[e.message.sender_user.id>0?(a(),o("span",ce,[n(_,{onClick:t[0]||(t[0]=$(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:i(()=>[u(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),k("span",_e," @"+g(e.message.sender_user.username),1)])):(a(),o("span",ue," 系统 "))])]),"header-extra":i(()=>[k("span",de,[e.message.is_read===0?(a(),N(I,{key:0,dot:"",processing:""})):l("",!0),k("span",me,g(p(H)(e.message.created_on)),1)])]),description:i(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:i(()=>[e.message.type!=4?(a(),o("div",pe,[u(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),o("span",{key:0,onClick:t[1]||(t[1]=$(f=>r(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(K))]),_:1}),u(" 查看详情 ")])):l("",!0)])):l("",!0),e.message.type===4?(a(),o("div",ge,g(e.message.content),1)):l("",!0),e.message.type===5?(a(),o("div",ve,[u(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),o("span",{key:0,onClick:t[2]||(t[2]=$(f=>d(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(Y))]),_:1}),u(" 同意 ")])):l("",!0),e.message.reply_id===1?(a(),o("span",{key:1,onClick:t[3]||(t[3]=$(f=>v(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(z))]),_:1}),u(" 拒绝 ")])):l("",!0),e.message.reply_id===2?(a(),o("span",fe,[n(m,null,{default:i(()=>[n(p(Z))]),_:1}),u(" 已同意 ")])):l("",!0),e.message.reply_id===3?(a(),o("span",ye,[n(m,null,{default:i(()=>[n(p(z))]),_:1}),u(" 已拒绝 ")])):l("",!0)])):l("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const he=F(ke,[["__scopeId","data-v-4a0e27fa"]]),we={class:"content"},$e=b({__name:"message-skeleton",props:{num:{default:1}},setup(e){return(h,w)=>{const r=se;return a(!0),o(R,null,O(new Array(e.num),d=>(a(),o("div",{class:"skeleton-item",key:d},[k("div",we,[n(r,{text:"",repeat:2}),n(r,{text:"",style:{width:"60%"}})])]))),128)}}});const xe=F($e,[["__scopeId","data-v-01d2e871"]]),Ce={key:0,class:"skeleton-wrap"},Me={key:1},be={key:0,class:"empty-wrap"},Fe={key:0,class:"pagination-wrap"},Ie=b({__name:"Messages",setup(e){const h=U(),w=le(),r=y(!1),d=y(+h.query.p||1),v=y(10),c=y(0),s=y([]),t=()=>{r.value=!0,G({page:d.value,page_size:v.value}).then(_=>{r.value=!1,s.value=_.list,c.value=Math.ceil(_.pager.total_rows/v.value)}).catch(_=>{r.value=!1})},x=_=>{d.value=_,t()};return A(()=>{t()}),(_,I)=>{const m=ie,C=xe,M=ae,f=he,j=oe,q=te,B=ne;return a(),o("div",null,[n(m,{title:"消息"}),n(q,{class:"main-content-wrap messages-wrap",bordered:""},{default:i(()=>[r.value?(a(),o("div",Ce,[n(C,{num:v.value},null,8,["num"])])):(a(),o("div",Me,[s.value.length===0?(a(),o("div",be,[n(M,{size:"large",description:"暂无数据"})])):l("",!0),(a(!0),o(R,null,O(s.value,S=>(a(),N(j,{key:S.id},{default:i(()=>[n(f,{message:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),c.value>0?(a(),o("div",Fe,[n(B,{page:d.value,"onUpdate:page":x,"page-slot":p(w).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)])}}});const Xe=F(Ie,[["__scopeId","data-v-4e7b1342"]]);export{Xe as default}; +import{d as b,_ as D,o as a,c as o,L as n,Y as i,a as k,Z as $,e as u,M as g,K as N,O as l,U as p,a1 as V,$ as O,F as R,r as y,j as A}from"./@vue-f70ab1bd.js";import{u as L,b as U}from"./vue-router-29025daf.js";import{C as E,D as P,E as T,_ as F,F as G}from"./index-cfa0bdbf.js";import{a as H}from"./formatTime-936c40eb.js";import{m as K,n as Y,o as z,p as Z}from"./@vicons-2f3cb6b9.js";import{o as J,l as Q,j as W,S as X,L as ee,U as se,F as te,G as ne,I as ae,H as oe}from"./naive-ui-ddb574dd.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{u as le}from"./vuex-cc1858c6.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";const re={class:"sender-wrap"},ce={key:0,class:"nickname"},_e={class:"username"},ue={key:1,class:"nickname"},de={class:"timestamp"},me={class:"timestamp-txt"},pe={key:0,class:"brief-content"},ge={key:1,class:"whisper-content-wrap"},ve={key:2,class:"requesting-friend-wrap"},fe={key:2,class:"status-info"},ye={key:3,class:"status-info"},ke=b({__name:"message-item",props:{message:null},setup(e){const h="https://assets.paopao.info/public/avatar/default/admin.png",w=L(),r=s=>{c(s),(s.type===1||s.type===2||s.type===3)&&(s.post&&s.post.id>0?w.push({name:"post",query:{id:s.post_id}}):window.$message.error("该动态已被删除"))},d=s=>{c(s),E({user_id:s.sender_user_id}).then(t=>{s.reply_id=2,window.$message.success("已同意添加好友")}).catch(t=>{console.log(t)})},v=s=>{c(s),P({user_id:s.sender_user_id}).then(t=>{s.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(t=>{console.log(t)})},c=s=>{s.is_read===0&&T({id:s.id}).then(t=>{s.is_read=1}).catch(t=>{console.log(t)})};return(s,t)=>{const x=J,_=D("router-link"),I=Q,m=W,C=X,M=ee;return a(),o("div",{class:V(["message-item",{unread:e.message.is_read===0}]),onClick:t[4]||(t[4]=f=>c(e.message))},[n(M,{"content-indented":""},{avatar:i(()=>[n(x,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:h},null,8,["src"])]),header:i(()=>[k("div",re,[e.message.sender_user.id>0?(a(),o("span",ce,[n(_,{onClick:t[0]||(t[0]=$(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:i(()=>[u(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),k("span",_e," @"+g(e.message.sender_user.username),1)])):(a(),o("span",ue," 系统 "))])]),"header-extra":i(()=>[k("span",de,[e.message.is_read===0?(a(),N(I,{key:0,dot:"",processing:""})):l("",!0),k("span",me,g(p(H)(e.message.created_on)),1)])]),description:i(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:i(()=>[e.message.type!=4?(a(),o("div",pe,[u(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),o("span",{key:0,onClick:t[1]||(t[1]=$(f=>r(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(K))]),_:1}),u(" 查看详情 ")])):l("",!0)])):l("",!0),e.message.type===4?(a(),o("div",ge,g(e.message.content),1)):l("",!0),e.message.type===5?(a(),o("div",ve,[u(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),o("span",{key:0,onClick:t[2]||(t[2]=$(f=>d(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(Y))]),_:1}),u(" 同意 ")])):l("",!0),e.message.reply_id===1?(a(),o("span",{key:1,onClick:t[3]||(t[3]=$(f=>v(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(z))]),_:1}),u(" 拒绝 ")])):l("",!0),e.message.reply_id===2?(a(),o("span",fe,[n(m,null,{default:i(()=>[n(p(Z))]),_:1}),u(" 已同意 ")])):l("",!0),e.message.reply_id===3?(a(),o("span",ye,[n(m,null,{default:i(()=>[n(p(z))]),_:1}),u(" 已拒绝 ")])):l("",!0)])):l("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const he=F(ke,[["__scopeId","data-v-4a0e27fa"]]),we={class:"content"},$e=b({__name:"message-skeleton",props:{num:{default:1}},setup(e){return(h,w)=>{const r=se;return a(!0),o(R,null,O(new Array(e.num),d=>(a(),o("div",{class:"skeleton-item",key:d},[k("div",we,[n(r,{text:"",repeat:2}),n(r,{text:"",style:{width:"60%"}})])]))),128)}}});const xe=F($e,[["__scopeId","data-v-01d2e871"]]),Ce={key:0,class:"skeleton-wrap"},Me={key:1},be={key:0,class:"empty-wrap"},Fe={key:0,class:"pagination-wrap"},Ie=b({__name:"Messages",setup(e){const h=U(),w=le(),r=y(!1),d=y(+h.query.p||1),v=y(10),c=y(0),s=y([]),t=()=>{r.value=!0,G({page:d.value,page_size:v.value}).then(_=>{r.value=!1,s.value=_.list,c.value=Math.ceil(_.pager.total_rows/v.value)}).catch(_=>{r.value=!1})},x=_=>{d.value=_,t()};return A(()=>{t()}),(_,I)=>{const m=ie,C=xe,M=ae,f=he,j=oe,q=te,B=ne;return a(),o("div",null,[n(m,{title:"消息"}),n(q,{class:"main-content-wrap messages-wrap",bordered:""},{default:i(()=>[r.value?(a(),o("div",Ce,[n(C,{num:v.value},null,8,["num"])])):(a(),o("div",Me,[s.value.length===0?(a(),o("div",be,[n(M,{size:"large",description:"暂无数据"})])):l("",!0),(a(!0),o(R,null,O(s.value,S=>(a(),N(j,{key:S.id},{default:i(()=>[n(f,{message:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),c.value>0?(a(),o("div",Fe,[n(B,{page:d.value,"onUpdate:page":x,"page-slot":p(w).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)])}}});const Xe=F(Ie,[["__scopeId","data-v-4e7b1342"]]);export{Xe as default}; diff --git a/web/dist/assets/Post-ea11be7c.js b/web/dist/assets/Post-1eee200c.js similarity index 98% rename from web/dist/assets/Post-ea11be7c.js rename to web/dist/assets/Post-1eee200c.js index 5d9236dd..bad199b8 100644 --- a/web/dist/assets/Post-ea11be7c.js +++ b/web/dist/assets/Post-1eee200c.js @@ -1 +1 @@ -import{d as be,_ as Z,e as $e,f as xe,g as Ce,h as Ie,i as Pe,j as Re,k as Ue,l as ze,s as Se,v as Te,p as Le,m as Ae,n as qe,o as Me}from"./index-f6017bc3.js";import{b as Oe,e as W,J as Be,j as ne,K as me,o as re,L as ve,v as je,w as De,x as Ne,y as Ve,z as Ee,B as Fe,M as He,O as Ke,i as Je,P as Ge,a as Qe,F as Ye,I as Ze,k as We,H as Xe,f as et,g as tt}from"./naive-ui-ddb574dd.js";import{d as G,r as p,o as a,c as d,a as v,O as y,L as s,Y as n,e as w,_ as _e,M as P,K as S,U as e,n as ee,a3 as st,F as te,$ as se,Z as K,j as pe,a4 as fe,a5 as ge,w as ot}from"./@vue-f70ab1bd.js";import{u as ae}from"./vuex-cc1858c6.js";import{f as oe}from"./formatTime-936c40eb.js";import{T as he,I as nt,e as at,f as lt,g as it,h as ct,i as ut,j as rt,k as _t}from"./@vicons-2f3cb6b9.js";import{p as de,_ as ye,a as pt,b as dt,c as mt}from"./content-0b348d1e.js";import{u as ke,b as vt}from"./vue-router-29025daf.js";import{_ as ft}from"./post-skeleton-fdf95824.js";import{l as gt}from"./lodash-3329902d.js";import{V as Y}from"./IEnum-ea67d3af.js";import{a as ht}from"./copy-to-clipboard-ca358197.js";import{_ as yt}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";import"./nonesir-video-29a967e9.js";import"./toggle-selection-93f4ad84.js";const kt={class:"reply-compose-wrap"},wt={class:"reply-switch"},bt={key:0,class:"reply-input-wrap"},$t=G({__name:"compose-reply",props:{commentId:{default:0},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(U,{expose:T,emit:i}){const c=U,R=p(),k=p(!1),f=p(""),C=p(!1),l=g=>{k.value=g,g?setTimeout(()=>{var r;(r=R.value)==null||r.focus()},10):(C.value=!1,f.value="",i("reset"))},z=()=>{C.value=!0,be({comment_id:c.commentId,at_user_id:c.atUserid,content:f.value}).then(g=>{l(!1),window.$message.success("评论成功"),i("reload")}).catch(g=>{C.value=!1})};return T({switchReply:l}),(g,r)=>{const b=Oe,o=W,I=Be;return a(),d("div",kt,[v("div",wt,[k.value?y("",!0):(a(),d("span",{key:0,class:"show",onClick:r[0]||(r[0]=h=>l(!0))}," 回复 ")),k.value?(a(),d("span",{key:1,class:"hide",onClick:r[1]||(r[1]=h=>l(!1))}," 取消 ")):y("",!0)]),k.value?(a(),d("div",bt,[s(I,null,{default:n(()=>[s(b,{ref_key:"inputInstRef",ref:R,size:"small",placeholder:c.atUsername?"@"+c.atUsername:"请输入回复内容..",maxlength:"100",value:f.value,"onUpdate:value":r[2]||(r[2]=h=>f.value=h),"show-count":"",clearable:""},null,8,["placeholder","value"]),s(o,{type:"primary",size:"small",ghost:"",loading:C.value,onClick:z},{default:n(()=>[w(" 回复 ")]),_:1},8,["loading"])]),_:1})])):y("",!0)])}}});const xt=Z($t,[["__scopeId","data-v-89bc7a6d"]]),Ct={class:"reply-item"},It={class:"header-wrap"},Pt={class:"username"},Rt={class:"reply-name"},Ut={class:"timestamp"},zt={class:"base-wrap"},St={class:"content"},Tt={key:0,class:"reply-switch"},Lt=G({__name:"reply-item",props:{reply:null},emits:["focusReply","reload"],setup(U,{emit:T}){const i=U,c=ae(),R=()=>{T("focusReply",i.reply)},k=()=>{$e({id:i.reply.id}).then(f=>{window.$message.success("删除成功"),setTimeout(()=>{T("reload")},50)}).catch(f=>{console.log(f)})};return(f,C)=>{const l=_e("router-link"),z=ne,g=W,r=me;return a(),d("div",Ct,[v("div",It,[v("div",Pt,[s(l,{class:"user-link",to:{name:"user",query:{username:i.reply.user.username}}},{default:n(()=>[w(P(i.reply.user.username),1)]),_:1},8,["to"]),v("span",Rt,P(i.reply.at_user_id>0?"回复":":"),1),i.reply.at_user_id>0?(a(),S(l,{key:0,class:"user-link",to:{name:"user",query:{username:i.reply.at_user.username}}},{default:n(()=>[w(P(i.reply.at_user.username),1)]),_:1},8,["to"])):y("",!0)]),v("div",Ut,[w(P(i.reply.ip_loc?i.reply.ip_loc+" · ":i.reply.ip_loc)+" "+P(e(oe)(i.reply.created_on,e(c).state.collapsedLeft))+" ",1),e(c).state.userInfo.is_admin||e(c).state.userInfo.id===i.reply.user.id?(a(),S(r,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:k},{trigger:n(()=>[s(g,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[s(z,null,{default:n(()=>[s(e(he))]),_:1})]),_:1})]),default:n(()=>[w(" 是否确认删除? ")]),_:1})):y("",!0)])]),v("div",zt,[v("div",St,P(i.reply.content),1),e(c).state.userInfo.id>0?(a(),d("div",Tt,[v("span",{class:"show",onClick:R}," 回复 ")])):y("",!0)])])}}});const At=Z(Lt,[["__scopeId","data-v-c486479f"]]),qt={class:"comment-item"},Mt={class:"nickname-wrap"},Ot={class:"username-wrap"},Bt={class:"opt-wrap"},jt={class:"timestamp"},Dt=["innerHTML"],Nt={class:"reply-wrap"},Vt=G({__name:"comment-item",props:{comment:null},emits:["reload"],setup(U,{emit:T}){const i=U,c=ae(),R=ke(),k=p(0),f=p(""),C=p(),l=ee(()=>{let I=Object.assign({texts:[],imgs:[]},i.comment);return I.contents.map(h=>{(+h.type==1||+h.type==2)&&I.texts.push(h),+h.type==3&&I.imgs.push(h)}),I}),z=(I,h)=>{let L=I.target;if(L.dataset.detail){const A=L.dataset.detail.split(":");A.length===2&&(c.commit("refresh"),A[0]==="tag"?window.$message.warning("评论内的无效话题"):R.push({name:"user",query:{username:A[1]}}))}},g=I=>{var h,L;k.value=I.user_id,f.value=((h=I.user)==null?void 0:h.username)||"",(L=C.value)==null||L.switchReply(!0)},r=()=>{T("reload")},b=()=>{k.value=0,f.value=""},o=()=>{xe({id:l.value.id}).then(I=>{window.$message.success("删除成功"),setTimeout(()=>{r()},50)}).catch(I=>{})};return(I,h)=>{const L=re,A=_e("router-link"),j=ne,N=W,V=me,E=ye,F=At,H=xt,O=ve;return a(),d("div",qt,[s(O,{"content-indented":""},st({avatar:n(()=>[s(L,{round:"",size:30,src:e(l).user.avatar},null,8,["src"])]),header:n(()=>[v("span",Mt,[s(A,{onClick:h[0]||(h[0]=K(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(l).user.username}}},{default:n(()=>[w(P(e(l).user.nickname),1)]),_:1},8,["to"])]),v("span",Ot," @"+P(e(l).user.username),1)]),"header-extra":n(()=>[v("div",Bt,[v("span",jt,P(e(l).ip_loc?e(l).ip_loc+" · ":e(l).ip_loc)+" "+P(e(oe)(e(l).created_on,e(c).state.collapsedLeft)),1),e(c).state.userInfo.is_admin||e(c).state.userInfo.id===e(l).user.id?(a(),S(V,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:o},{trigger:n(()=>[s(N,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[s(j,null,{default:n(()=>[s(e(he))]),_:1})]),_:1})]),default:n(()=>[w(" 是否确认删除? ")]),_:1})):y("",!0)])]),footer:n(()=>[e(l).imgs.length>0?(a(),S(E,{key:0,imgs:e(l).imgs},null,8,["imgs"])):y("",!0),v("div",Nt,[(a(!0),d(te,null,se(e(l).replies,t=>(a(),S(F,{key:t.id,reply:t,onFocusReply:g,onReload:r},null,8,["reply"]))),128))]),e(c).state.userInfo.id>0?(a(),S(H,{key:1,ref_key:"replyComposeRef",ref:C,"comment-id":e(l).id,"at-userid":k.value,"at-username":f.value,onReload:r,onReset:b},null,8,["comment-id","at-userid","at-username"])):y("",!0)]),_:2},[e(l).texts.length>0?{name:"description",fn:n(()=>[(a(!0),d(te,null,se(e(l).texts,t=>(a(),d("span",{key:t.id,class:"comment-text",onClick:h[1]||(h[1]=K(u=>z(u,e(l).id),["stop"])),innerHTML:e(de)(t.content).content},null,8,Dt))),128))]),key:"0"}:void 0]),1024)])}}});const Et=Z(Vt,[["__scopeId","data-v-02db83b3"]]),Ft=U=>(fe("data-v-ca3e6071"),U=U(),ge(),U),Ht={key:0,class:"compose-wrap"},Kt={class:"compose-line"},Jt={class:"compose-user"},Gt={class:"compose-line compose-options"},Qt={class:"attachment"},Yt={class:"submit-wrap"},Zt={class:"attachment-list-wrap"},Wt={key:1,class:"compose-wrap"},Xt=Ft(()=>v("div",{class:"login-wrap"},[v("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),es={key:0,class:"login-only-wrap"},ts={key:1,class:"login-wrap"},ss=G({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(U,{emit:T}){const i=U,c=ae(),R=p([]),k=p(!1),f=p(!1),C=p(!1),l=p(""),z=p(),g=p("public/image"),r=p([]),b=p([]),o=p("true".toLowerCase()==="true"),I="/v1/attachment",h=p(),L=gt.debounce(m=>{Ce({k:m}).then(_=>{let $=[];_.suggest.map(x=>{$.push({label:x,value:x})}),R.value=$,f.value=!1}).catch(_=>{f.value=!1})},200),A=(m,_)=>{f.value||(f.value=!0,_==="@"&&L(m))},j=m=>{m.length>200||(l.value=m)},N=m=>{g.value=m},V=m=>{r.value=m},E=async m=>{var _,$;return g.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((_=m.file.file)==null?void 0:_.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):g.value==="image"&&(($=m.file.file)==null?void 0:$.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},F=({file:m,event:_})=>{var $;try{let x=JSON.parse(($=_.target)==null?void 0:$.response);x.code===0&&g.value==="public/image"&&b.value.push({id:m.id,content:x.data.content})}catch{window.$message.error("上传失败")}},H=({file:m,event:_})=>{var $;try{let x=JSON.parse(($=_.target)==null?void 0:$.response);if(x.code!==0){let B=x.msg||"上传失败";x.details&&x.details.length>0&&x.details.map(q=>{B+=":"+q}),window.$message.error(B)}}catch{window.$message.error("上传失败")}},O=({file:m})=>{let _=b.value.findIndex($=>$.id===m.id);_>-1&&b.value.splice(_,1)},t=()=>{k.value=!0},u=()=>{var m;k.value=!1,(m=z.value)==null||m.clear(),r.value=[],l.value="",b.value=[]},D=()=>{if(l.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:m}=de(l.value);const _=[];let $=100;_.push({content:l.value,type:2,sort:$}),b.value.map(x=>{$++,_.push({content:x.content,type:3,sort:$})}),C.value=!0,Ie({contents:_,post_id:i.postId,users:Array.from(new Set(m))}).then(x=>{window.$message.success("发布成功"),C.value=!1,T("post-success"),u()}).catch(x=>{C.value=!1})},Q=m=>{c.commit("triggerAuth",!0),c.commit("triggerAuthKey",m)};return pe(()=>{h.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(m,_)=>{const $=re,x=je,B=ne,q=W,le=De,ie=Ne,ce=Ve,X=Ee,ue=Fe;return a(),d("div",null,[e(c).state.userInfo.id>0?(a(),d("div",Ht,[v("div",Kt,[v("div",Jt,[s($,{round:"",size:30,src:e(c).state.userInfo.avatar},null,8,["src"])]),s(x,{type:"textarea",size:"large",autosize:"",bordered:!1,options:R.value,prefix:["@"],loading:f.value,value:l.value,disabled:i.lock===1,"onUpdate:value":j,onSearch:A,onFocus:t,placeholder:i.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),k.value?(a(),S(ue,{key:0,ref_key:"uploadRef",ref:z,abstract:"","list-type":"image",multiple:!0,max:9,action:I,headers:{Authorization:h.value},data:{type:g.value},onBeforeUpload:E,onFinish:F,onError:H,onRemove:O,"onUpdate:fileList":V},{default:n(()=>[v("div",Gt,[v("div",Qt,[s(le,{abstract:""},{default:n(({handleClick:J})=>[s(q,{disabled:r.value.length>0&&g.value==="public/video"||r.value.length===9,onClick:()=>{N("public/image"),J()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[s(B,{size:"20",color:"var(--primary-color)"},{default:n(()=>[s(e(nt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),s(ce,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[s(ie,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:l.value.length/200*100},null,8,["percentage"])]),default:n(()=>[w(" "+P(l.value.length)+" / 200 ",1)]),_:1})]),v("div",Yt,[s(q,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:u},{default:n(()=>[w(" 取消 ")]),_:1}),s(q,{loading:C.value,onClick:D,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[w(" 发布 ")]),_:1},8,["loading"])])]),v("div",Zt,[s(X)])]),_:1},8,["headers","data"])):y("",!0)])):(a(),d("div",Wt,[Xt,o.value?y("",!0):(a(),d("div",es,[s(q,{strong:"",secondary:"",round:"",type:"primary",onClick:_[0]||(_[0]=J=>Q("signin"))},{default:n(()=>[w(" 登录 ")]),_:1})])),o.value?(a(),d("div",ts,[s(q,{strong:"",secondary:"",round:"",type:"primary",onClick:_[1]||(_[1]=J=>Q("signin"))},{default:n(()=>[w(" 登录 ")]),_:1}),s(q,{strong:"",secondary:"",round:"",type:"info",onClick:_[2]||(_[2]=J=>Q("signup"))},{default:n(()=>[w(" 注册 ")]),_:1})])):y("",!0)]))])}}});const os=Z(ss,[["__scopeId","data-v-ca3e6071"]]),ns={class:"username-wrap"},as={key:0,class:"options"},ls={key:0},is=["innerHTML"],cs={class:"timestamp"},us={key:0},rs={key:1},_s={class:"opts-wrap"},ps=["onClick"],ds={class:"opt-item"},ms=["onClick"],vs=["onClick"],fs=G({__name:"post-detail",props:{post:null},emits:["reload"],setup(U,{emit:T}){const i=U,c=ae(),R=ke(),k=p(!1),f=p(!1),C=p(!1),l=p(!1),z=p(!1),g=p(!1),r=p(!1),b=p(Y.PUBLIC),o=ee({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},i.post);return t.contents.map(u=>{(+u.type==1||+u.type==2)&&t.texts.push(u),+u.type==3&&t.imgs.push(u),+u.type==4&&t.videos.push(u),+u.type==6&&t.links.push(u),+u.type==7&&t.attachments.push(u),+u.type==8&&t.charge_attachments.push(u)}),t},set:t=>{i.post.upvote_count=t.upvote_count,i.post.comment_count=t.comment_count,i.post.collection_count=t.collection_count}}),I=ee(()=>{let t=[{label:"删除",key:"delete"}];return o.value.is_lock===0?t.push({label:"锁定",key:"lock"}):t.push({label:"解锁",key:"unlock"}),c.state.userInfo.is_admin&&(o.value.is_top===0?t.push({label:"置顶",key:"stick"}):t.push({label:"取消置顶",key:"unstick"})),o.value.visibility===Y.PUBLIC?t.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):o.value.visibility===Y.PRIVATE?t.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):t.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),t}),h=t=>{R.push({name:"post",query:{id:t}})},L=(t,u)=>{if(t.target.dataset.detail){const D=t.target.dataset.detail.split(":");if(D.length===2){c.commit("refresh"),D[0]==="tag"?R.push({name:"home",query:{q:D[1],t:"tag"}}):R.push({name:"user",query:{username:D[1]}});return}}h(u)},A=t=>{switch(t){case"delete":C.value=!0;break;case"lock":case"unlock":l.value=!0;break;case"stick":case"unstick":z.value=!0;break;case"vpublic":b.value=0,g.value=!0;break;case"vprivate":b.value=1,g.value=!0;break;case"vfriend":b.value=2,g.value=!0;break}},j=()=>{Ue({id:o.value.id}).then(t=>{window.$message.success("删除成功"),R.replace("/"),setTimeout(()=>{c.commit("refresh")},50)}).catch(t=>{r.value=!1})},N=()=>{ze({id:o.value.id}).then(t=>{T("reload"),t.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(t=>{r.value=!1})},V=()=>{Se({id:o.value.id}).then(t=>{T("reload"),t.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(t=>{r.value=!1})},E=()=>{Te({id:o.value.id,visibility:b.value}).then(t=>{T("reload"),window.$message.success("修改可见性成功")}).catch(t=>{r.value=!1})},F=()=>{Le({id:o.value.id}).then(t=>{k.value=t.status,t.status?o.value={...o.value,upvote_count:o.value.upvote_count+1}:o.value={...o.value,upvote_count:o.value.upvote_count-1}}).catch(t=>{console.log(t)})},H=()=>{Ae({id:o.value.id}).then(t=>{f.value=t.status,t.status?o.value={...o.value,collection_count:o.value.collection_count+1}:o.value={...o.value,collection_count:o.value.collection_count-1}}).catch(t=>{console.log(t)})},O=()=>{ht(`${window.location.origin}/#/post?id=${o.value.id}`),window.$message.success("链接已复制到剪贴板")};return pe(()=>{c.state.userInfo.id>0&&(Pe({id:o.value.id}).then(t=>{k.value=t.status}).catch(t=>{console.log(t)}),Re({id:o.value.id}).then(t=>{f.value=t.status}).catch(t=>{console.log(t)}))}),(t,u)=>{const D=re,Q=_e("router-link"),m=He,_=ne,$=W,x=Ke,B=Je,q=pt,le=ye,ie=dt,ce=mt,X=Ge,ue=Qe,J=ve;return a(),d("div",{class:"detail-item",onClick:u[6]||(u[6]=M=>h(e(o).id))},[s(J,null,{avatar:n(()=>[s(D,{round:"",size:30,src:e(o).user.avatar},null,8,["src"])]),header:n(()=>[s(Q,{onClick:u[0]||(u[0]=K(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(o).user.username}}},{default:n(()=>[w(P(e(o).user.nickname),1)]),_:1},8,["to"]),v("span",ns," @"+P(e(o).user.username),1),e(o).is_top?(a(),S(m,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[w(" 置顶 ")]),_:1})):y("",!0),e(o).visibility==e(Y).PRIVATE?(a(),S(m,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[w(" 私密 ")]),_:1})):y("",!0),e(o).visibility==e(Y).FRIEND?(a(),S(m,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[w(" 好友可见 ")]),_:1})):y("",!0)]),"header-extra":n(()=>[e(c).state.userInfo.is_admin||e(c).state.userInfo.id===e(o).user.id?(a(),d("div",as,[s(x,{placement:"bottom-end",trigger:"click",size:"small",options:e(I),onSelect:A},{default:n(()=>[s($,{quaternary:"",circle:""},{icon:n(()=>[s(_,null,{default:n(()=>[s(e(at))]),_:1})]),_:1})]),_:1},8,["options"])])):y("",!0),s(B,{show:C.value,"onUpdate:show":u[1]||(u[1]=M=>C.value=M),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:j},null,8,["show"]),s(B,{show:l.value,"onUpdate:show":u[2]||(u[2]=M=>l.value=M),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(o).is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:N},null,8,["show","content"]),s(B,{show:z.value,"onUpdate:show":u[3]||(u[3]=M=>z.value=M),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(o).is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:V},null,8,["show","content"]),s(B,{show:g.value,"onUpdate:show":u[4]||(u[4]=M=>g.value=M),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(b.value==0?"公开":b.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:E},null,8,["show","content"])]),footer:n(()=>[s(q,{attachments:e(o).attachments},null,8,["attachments"]),s(q,{attachments:e(o).charge_attachments,price:e(o).attachment_price},null,8,["attachments","price"]),s(le,{imgs:e(o).imgs},null,8,["imgs"]),s(ie,{videos:e(o).videos,full:!0},null,8,["videos"]),s(ce,{links:e(o).links},null,8,["links"]),v("div",cs,[w(" 发布于 "+P(e(oe)(e(o).created_on,e(c).state.collapsedLeft))+" ",1),e(o).ip_loc?(a(),d("span",us,[s(X,{vertical:""}),w(" "+P(e(o).ip_loc),1)])):y("",!0),!e(c).state.collapsedLeft&&e(o).created_on!=e(o).latest_replied_on?(a(),d("span",rs,[s(X,{vertical:""}),w(" 最后回复 "+P(e(oe)(e(o).latest_replied_on,e(c).state.collapsedLeft)),1)])):y("",!0)])]),action:n(()=>[v("div",_s,[s(ue,{justify:"space-between"},{default:n(()=>[v("div",{class:"opt-item hover",onClick:K(F,["stop"])},[s(_,{size:"20",class:"opt-item-icon"},{default:n(()=>[k.value?y("",!0):(a(),S(e(lt),{key:0})),k.value?(a(),S(e(it),{key:1,color:"red"})):y("",!0)]),_:1}),w(" "+P(e(o).upvote_count),1)],8,ps),v("div",ds,[s(_,{size:"20",class:"opt-item-icon"},{default:n(()=>[s(e(ct))]),_:1}),w(" "+P(e(o).comment_count),1)]),v("div",{class:"opt-item hover",onClick:K(H,["stop"])},[s(_,{size:"20",class:"opt-item-icon"},{default:n(()=>[f.value?y("",!0):(a(),S(e(ut),{key:0})),f.value?(a(),S(e(rt),{key:1,color:"#ff7600"})):y("",!0)]),_:1}),w(" "+P(e(o).collection_count),1)],8,ms),v("div",{class:"opt-item hover",onClick:K(O,["stop"])},[s(_,{size:"20",class:"opt-item-icon"},{default:n(()=>[s(e(_t))]),_:1}),w(" "+P(e(o).share_count),1)],8,vs)]),_:1})])]),default:n(()=>[e(o).texts.length>0?(a(),d("div",ls,[(a(!0),d(te,null,se(e(o).texts,M=>(a(),d("span",{key:M.id,class:"post-text",onClick:u[5]||(u[5]=K(we=>L(we,e(o).id),["stop"])),innerHTML:e(de)(M.content).content},null,8,is))),128))])):y("",!0)]),_:1})])}}});const gs=U=>(fe("data-v-219a8fb1"),U=U(),ge(),U),hs={key:0,class:"detail-wrap"},ys={key:1,class:"empty-wrap"},ks={key:0,class:"comment-opts-wrap"},ws=gs(()=>v("span",{class:"comment-title-item"},"评论",-1)),bs={key:2},$s={key:0,class:"skeleton-wrap"},xs={key:1},Cs={key:0,class:"empty-wrap"},Is=G({__name:"Post",setup(U){const T=vt(),i=p({}),c=p(!1),R=p(!1),k=p([]),f=ee(()=>+T.query.id),C=p("default"),l=r=>{C.value=r,g()},z=()=>{i.value={id:0},c.value=!0,qe({id:f.value}).then(r=>{c.value=!1,i.value=r,g()}).catch(r=>{c.value=!1})},g=(r=!1)=>{k.value.length===0&&(R.value=!0),Me({id:i.value.id,sort_strategy:C.value}).then(b=>{k.value=b.list,R.value=!1,r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(b=>{R.value=!1})};return pe(()=>{z()}),ot(f,()=>{f.value>0&&T.name==="post"&&z()}),(r,b)=>{const o=yt,I=fs,h=Ze,L=We,A=Xe,j=et,N=tt,V=os,E=ft,F=Et,H=Ye;return a(),d("div",null,[s(o,{title:"泡泡详情",back:!0}),s(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[s(A,null,{default:n(()=>[s(L,{show:c.value},{default:n(()=>[i.value.id>1?(a(),d("div",hs,[s(I,{post:i.value,onReload:z},null,8,["post"])])):(a(),d("div",ys,[s(h,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),i.value.id>0?(a(),d("div",ks,[s(N,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":l},{prefix:n(()=>[ws]),default:n(()=>[s(j,{name:"default",tab:"默认"}),s(j,{name:"newest",tab:"最新"})]),_:1})])):y("",!0),i.value.id>0?(a(),S(A,{key:1},{default:n(()=>[s(V,{lock:i.value.is_lock,"post-id":i.value.id,onPostSuccess:b[0]||(b[0]=O=>g(!0))},null,8,["lock","post-id"])]),_:1})):y("",!0),i.value.id>0?(a(),d("div",bs,[R.value?(a(),d("div",$s,[s(E,{num:5})])):(a(),d("div",xs,[k.value.length===0?(a(),d("div",Cs,[s(h,{size:"large",description:"暂无评论,快来抢沙发"})])):y("",!0),(a(!0),d(te,null,se(k.value,O=>(a(),S(A,{key:O.id},{default:n(()=>[s(F,{comment:O,onReload:g},null,8,["comment"])]),_:2},1024))),128))]))])):y("",!0)]),_:1})])}}});const no=Z(Is,[["__scopeId","data-v-219a8fb1"]]);export{no as default}; +import{d as be,_ as Z,e as $e,f as xe,g as Ce,h as Ie,i as Pe,j as Re,k as Ue,l as ze,s as Se,v as Te,p as Le,m as Ae,n as qe,o as Me}from"./index-cfa0bdbf.js";import{b as Oe,e as W,J as Be,j as ne,K as me,o as re,L as ve,v as je,w as De,x as Ne,y as Ve,z as Ee,B as Fe,M as He,O as Ke,i as Je,P as Ge,a as Qe,F as Ye,I as Ze,k as We,H as Xe,f as et,g as tt}from"./naive-ui-ddb574dd.js";import{d as G,r as p,o as a,c as d,a as v,O as y,L as s,Y as n,e as w,_ as _e,M as P,K as S,U as e,n as ee,a3 as st,F as te,$ as se,Z as K,j as pe,a4 as fe,a5 as ge,w as ot}from"./@vue-f70ab1bd.js";import{u as ae}from"./vuex-cc1858c6.js";import{f as oe}from"./formatTime-936c40eb.js";import{T as he,I as nt,e as at,f as lt,g as it,h as ct,i as ut,j as rt,k as _t}from"./@vicons-2f3cb6b9.js";import{p as de,_ as ye,a as pt,b as dt,c as mt}from"./content-43b82f8f.js";import{u as ke,b as vt}from"./vue-router-29025daf.js";import{_ as ft}from"./post-skeleton-a79b6d6f.js";import{l as gt}from"./lodash-3329902d.js";import{V as Y}from"./IEnum-ea67d3af.js";import{a as ht}from"./copy-to-clipboard-ca358197.js";import{_ as yt}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";import"./nonesir-video-29a967e9.js";import"./toggle-selection-93f4ad84.js";const kt={class:"reply-compose-wrap"},wt={class:"reply-switch"},bt={key:0,class:"reply-input-wrap"},$t=G({__name:"compose-reply",props:{commentId:{default:0},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(U,{expose:T,emit:i}){const c=U,R=p(),k=p(!1),f=p(""),C=p(!1),l=g=>{k.value=g,g?setTimeout(()=>{var r;(r=R.value)==null||r.focus()},10):(C.value=!1,f.value="",i("reset"))},z=()=>{C.value=!0,be({comment_id:c.commentId,at_user_id:c.atUserid,content:f.value}).then(g=>{l(!1),window.$message.success("评论成功"),i("reload")}).catch(g=>{C.value=!1})};return T({switchReply:l}),(g,r)=>{const b=Oe,o=W,I=Be;return a(),d("div",kt,[v("div",wt,[k.value?y("",!0):(a(),d("span",{key:0,class:"show",onClick:r[0]||(r[0]=h=>l(!0))}," 回复 ")),k.value?(a(),d("span",{key:1,class:"hide",onClick:r[1]||(r[1]=h=>l(!1))}," 取消 ")):y("",!0)]),k.value?(a(),d("div",bt,[s(I,null,{default:n(()=>[s(b,{ref_key:"inputInstRef",ref:R,size:"small",placeholder:c.atUsername?"@"+c.atUsername:"请输入回复内容..",maxlength:"100",value:f.value,"onUpdate:value":r[2]||(r[2]=h=>f.value=h),"show-count":"",clearable:""},null,8,["placeholder","value"]),s(o,{type:"primary",size:"small",ghost:"",loading:C.value,onClick:z},{default:n(()=>[w(" 回复 ")]),_:1},8,["loading"])]),_:1})])):y("",!0)])}}});const xt=Z($t,[["__scopeId","data-v-89bc7a6d"]]),Ct={class:"reply-item"},It={class:"header-wrap"},Pt={class:"username"},Rt={class:"reply-name"},Ut={class:"timestamp"},zt={class:"base-wrap"},St={class:"content"},Tt={key:0,class:"reply-switch"},Lt=G({__name:"reply-item",props:{reply:null},emits:["focusReply","reload"],setup(U,{emit:T}){const i=U,c=ae(),R=()=>{T("focusReply",i.reply)},k=()=>{$e({id:i.reply.id}).then(f=>{window.$message.success("删除成功"),setTimeout(()=>{T("reload")},50)}).catch(f=>{console.log(f)})};return(f,C)=>{const l=_e("router-link"),z=ne,g=W,r=me;return a(),d("div",Ct,[v("div",It,[v("div",Pt,[s(l,{class:"user-link",to:{name:"user",query:{username:i.reply.user.username}}},{default:n(()=>[w(P(i.reply.user.username),1)]),_:1},8,["to"]),v("span",Rt,P(i.reply.at_user_id>0?"回复":":"),1),i.reply.at_user_id>0?(a(),S(l,{key:0,class:"user-link",to:{name:"user",query:{username:i.reply.at_user.username}}},{default:n(()=>[w(P(i.reply.at_user.username),1)]),_:1},8,["to"])):y("",!0)]),v("div",Ut,[w(P(i.reply.ip_loc?i.reply.ip_loc+" · ":i.reply.ip_loc)+" "+P(e(oe)(i.reply.created_on,e(c).state.collapsedLeft))+" ",1),e(c).state.userInfo.is_admin||e(c).state.userInfo.id===i.reply.user.id?(a(),S(r,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:k},{trigger:n(()=>[s(g,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[s(z,null,{default:n(()=>[s(e(he))]),_:1})]),_:1})]),default:n(()=>[w(" 是否确认删除? ")]),_:1})):y("",!0)])]),v("div",zt,[v("div",St,P(i.reply.content),1),e(c).state.userInfo.id>0?(a(),d("div",Tt,[v("span",{class:"show",onClick:R}," 回复 ")])):y("",!0)])])}}});const At=Z(Lt,[["__scopeId","data-v-c486479f"]]),qt={class:"comment-item"},Mt={class:"nickname-wrap"},Ot={class:"username-wrap"},Bt={class:"opt-wrap"},jt={class:"timestamp"},Dt=["innerHTML"],Nt={class:"reply-wrap"},Vt=G({__name:"comment-item",props:{comment:null},emits:["reload"],setup(U,{emit:T}){const i=U,c=ae(),R=ke(),k=p(0),f=p(""),C=p(),l=ee(()=>{let I=Object.assign({texts:[],imgs:[]},i.comment);return I.contents.map(h=>{(+h.type==1||+h.type==2)&&I.texts.push(h),+h.type==3&&I.imgs.push(h)}),I}),z=(I,h)=>{let L=I.target;if(L.dataset.detail){const A=L.dataset.detail.split(":");A.length===2&&(c.commit("refresh"),A[0]==="tag"?window.$message.warning("评论内的无效话题"):R.push({name:"user",query:{username:A[1]}}))}},g=I=>{var h,L;k.value=I.user_id,f.value=((h=I.user)==null?void 0:h.username)||"",(L=C.value)==null||L.switchReply(!0)},r=()=>{T("reload")},b=()=>{k.value=0,f.value=""},o=()=>{xe({id:l.value.id}).then(I=>{window.$message.success("删除成功"),setTimeout(()=>{r()},50)}).catch(I=>{})};return(I,h)=>{const L=re,A=_e("router-link"),j=ne,N=W,V=me,E=ye,F=At,H=xt,O=ve;return a(),d("div",qt,[s(O,{"content-indented":""},st({avatar:n(()=>[s(L,{round:"",size:30,src:e(l).user.avatar},null,8,["src"])]),header:n(()=>[v("span",Mt,[s(A,{onClick:h[0]||(h[0]=K(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(l).user.username}}},{default:n(()=>[w(P(e(l).user.nickname),1)]),_:1},8,["to"])]),v("span",Ot," @"+P(e(l).user.username),1)]),"header-extra":n(()=>[v("div",Bt,[v("span",jt,P(e(l).ip_loc?e(l).ip_loc+" · ":e(l).ip_loc)+" "+P(e(oe)(e(l).created_on,e(c).state.collapsedLeft)),1),e(c).state.userInfo.is_admin||e(c).state.userInfo.id===e(l).user.id?(a(),S(V,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:o},{trigger:n(()=>[s(N,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[s(j,null,{default:n(()=>[s(e(he))]),_:1})]),_:1})]),default:n(()=>[w(" 是否确认删除? ")]),_:1})):y("",!0)])]),footer:n(()=>[e(l).imgs.length>0?(a(),S(E,{key:0,imgs:e(l).imgs},null,8,["imgs"])):y("",!0),v("div",Nt,[(a(!0),d(te,null,se(e(l).replies,t=>(a(),S(F,{key:t.id,reply:t,onFocusReply:g,onReload:r},null,8,["reply"]))),128))]),e(c).state.userInfo.id>0?(a(),S(H,{key:1,ref_key:"replyComposeRef",ref:C,"comment-id":e(l).id,"at-userid":k.value,"at-username":f.value,onReload:r,onReset:b},null,8,["comment-id","at-userid","at-username"])):y("",!0)]),_:2},[e(l).texts.length>0?{name:"description",fn:n(()=>[(a(!0),d(te,null,se(e(l).texts,t=>(a(),d("span",{key:t.id,class:"comment-text",onClick:h[1]||(h[1]=K(u=>z(u,e(l).id),["stop"])),innerHTML:e(de)(t.content).content},null,8,Dt))),128))]),key:"0"}:void 0]),1024)])}}});const Et=Z(Vt,[["__scopeId","data-v-02db83b3"]]),Ft=U=>(fe("data-v-ca3e6071"),U=U(),ge(),U),Ht={key:0,class:"compose-wrap"},Kt={class:"compose-line"},Jt={class:"compose-user"},Gt={class:"compose-line compose-options"},Qt={class:"attachment"},Yt={class:"submit-wrap"},Zt={class:"attachment-list-wrap"},Wt={key:1,class:"compose-wrap"},Xt=Ft(()=>v("div",{class:"login-wrap"},[v("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),es={key:0,class:"login-only-wrap"},ts={key:1,class:"login-wrap"},ss=G({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(U,{emit:T}){const i=U,c=ae(),R=p([]),k=p(!1),f=p(!1),C=p(!1),l=p(""),z=p(),g=p("public/image"),r=p([]),b=p([]),o=p("true".toLowerCase()==="true"),I="/v1/attachment",h=p(),L=gt.debounce(m=>{Ce({k:m}).then(_=>{let $=[];_.suggest.map(x=>{$.push({label:x,value:x})}),R.value=$,f.value=!1}).catch(_=>{f.value=!1})},200),A=(m,_)=>{f.value||(f.value=!0,_==="@"&&L(m))},j=m=>{m.length>200||(l.value=m)},N=m=>{g.value=m},V=m=>{r.value=m},E=async m=>{var _,$;return g.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((_=m.file.file)==null?void 0:_.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):g.value==="image"&&(($=m.file.file)==null?void 0:$.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},F=({file:m,event:_})=>{var $;try{let x=JSON.parse(($=_.target)==null?void 0:$.response);x.code===0&&g.value==="public/image"&&b.value.push({id:m.id,content:x.data.content})}catch{window.$message.error("上传失败")}},H=({file:m,event:_})=>{var $;try{let x=JSON.parse(($=_.target)==null?void 0:$.response);if(x.code!==0){let B=x.msg||"上传失败";x.details&&x.details.length>0&&x.details.map(q=>{B+=":"+q}),window.$message.error(B)}}catch{window.$message.error("上传失败")}},O=({file:m})=>{let _=b.value.findIndex($=>$.id===m.id);_>-1&&b.value.splice(_,1)},t=()=>{k.value=!0},u=()=>{var m;k.value=!1,(m=z.value)==null||m.clear(),r.value=[],l.value="",b.value=[]},D=()=>{if(l.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:m}=de(l.value);const _=[];let $=100;_.push({content:l.value,type:2,sort:$}),b.value.map(x=>{$++,_.push({content:x.content,type:3,sort:$})}),C.value=!0,Ie({contents:_,post_id:i.postId,users:Array.from(new Set(m))}).then(x=>{window.$message.success("发布成功"),C.value=!1,T("post-success"),u()}).catch(x=>{C.value=!1})},Q=m=>{c.commit("triggerAuth",!0),c.commit("triggerAuthKey",m)};return pe(()=>{h.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(m,_)=>{const $=re,x=je,B=ne,q=W,le=De,ie=Ne,ce=Ve,X=Ee,ue=Fe;return a(),d("div",null,[e(c).state.userInfo.id>0?(a(),d("div",Ht,[v("div",Kt,[v("div",Jt,[s($,{round:"",size:30,src:e(c).state.userInfo.avatar},null,8,["src"])]),s(x,{type:"textarea",size:"large",autosize:"",bordered:!1,options:R.value,prefix:["@"],loading:f.value,value:l.value,disabled:i.lock===1,"onUpdate:value":j,onSearch:A,onFocus:t,placeholder:i.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),k.value?(a(),S(ue,{key:0,ref_key:"uploadRef",ref:z,abstract:"","list-type":"image",multiple:!0,max:9,action:I,headers:{Authorization:h.value},data:{type:g.value},onBeforeUpload:E,onFinish:F,onError:H,onRemove:O,"onUpdate:fileList":V},{default:n(()=>[v("div",Gt,[v("div",Qt,[s(le,{abstract:""},{default:n(({handleClick:J})=>[s(q,{disabled:r.value.length>0&&g.value==="public/video"||r.value.length===9,onClick:()=>{N("public/image"),J()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[s(B,{size:"20",color:"var(--primary-color)"},{default:n(()=>[s(e(nt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),s(ce,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[s(ie,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:l.value.length/200*100},null,8,["percentage"])]),default:n(()=>[w(" "+P(l.value.length)+" / 200 ",1)]),_:1})]),v("div",Yt,[s(q,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:u},{default:n(()=>[w(" 取消 ")]),_:1}),s(q,{loading:C.value,onClick:D,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[w(" 发布 ")]),_:1},8,["loading"])])]),v("div",Zt,[s(X)])]),_:1},8,["headers","data"])):y("",!0)])):(a(),d("div",Wt,[Xt,o.value?y("",!0):(a(),d("div",es,[s(q,{strong:"",secondary:"",round:"",type:"primary",onClick:_[0]||(_[0]=J=>Q("signin"))},{default:n(()=>[w(" 登录 ")]),_:1})])),o.value?(a(),d("div",ts,[s(q,{strong:"",secondary:"",round:"",type:"primary",onClick:_[1]||(_[1]=J=>Q("signin"))},{default:n(()=>[w(" 登录 ")]),_:1}),s(q,{strong:"",secondary:"",round:"",type:"info",onClick:_[2]||(_[2]=J=>Q("signup"))},{default:n(()=>[w(" 注册 ")]),_:1})])):y("",!0)]))])}}});const os=Z(ss,[["__scopeId","data-v-ca3e6071"]]),ns={class:"username-wrap"},as={key:0,class:"options"},ls={key:0},is=["innerHTML"],cs={class:"timestamp"},us={key:0},rs={key:1},_s={class:"opts-wrap"},ps=["onClick"],ds={class:"opt-item"},ms=["onClick"],vs=["onClick"],fs=G({__name:"post-detail",props:{post:null},emits:["reload"],setup(U,{emit:T}){const i=U,c=ae(),R=ke(),k=p(!1),f=p(!1),C=p(!1),l=p(!1),z=p(!1),g=p(!1),r=p(!1),b=p(Y.PUBLIC),o=ee({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},i.post);return t.contents.map(u=>{(+u.type==1||+u.type==2)&&t.texts.push(u),+u.type==3&&t.imgs.push(u),+u.type==4&&t.videos.push(u),+u.type==6&&t.links.push(u),+u.type==7&&t.attachments.push(u),+u.type==8&&t.charge_attachments.push(u)}),t},set:t=>{i.post.upvote_count=t.upvote_count,i.post.comment_count=t.comment_count,i.post.collection_count=t.collection_count}}),I=ee(()=>{let t=[{label:"删除",key:"delete"}];return o.value.is_lock===0?t.push({label:"锁定",key:"lock"}):t.push({label:"解锁",key:"unlock"}),c.state.userInfo.is_admin&&(o.value.is_top===0?t.push({label:"置顶",key:"stick"}):t.push({label:"取消置顶",key:"unstick"})),o.value.visibility===Y.PUBLIC?t.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):o.value.visibility===Y.PRIVATE?t.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):t.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),t}),h=t=>{R.push({name:"post",query:{id:t}})},L=(t,u)=>{if(t.target.dataset.detail){const D=t.target.dataset.detail.split(":");if(D.length===2){c.commit("refresh"),D[0]==="tag"?R.push({name:"home",query:{q:D[1],t:"tag"}}):R.push({name:"user",query:{username:D[1]}});return}}h(u)},A=t=>{switch(t){case"delete":C.value=!0;break;case"lock":case"unlock":l.value=!0;break;case"stick":case"unstick":z.value=!0;break;case"vpublic":b.value=0,g.value=!0;break;case"vprivate":b.value=1,g.value=!0;break;case"vfriend":b.value=2,g.value=!0;break}},j=()=>{Ue({id:o.value.id}).then(t=>{window.$message.success("删除成功"),R.replace("/"),setTimeout(()=>{c.commit("refresh")},50)}).catch(t=>{r.value=!1})},N=()=>{ze({id:o.value.id}).then(t=>{T("reload"),t.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(t=>{r.value=!1})},V=()=>{Se({id:o.value.id}).then(t=>{T("reload"),t.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(t=>{r.value=!1})},E=()=>{Te({id:o.value.id,visibility:b.value}).then(t=>{T("reload"),window.$message.success("修改可见性成功")}).catch(t=>{r.value=!1})},F=()=>{Le({id:o.value.id}).then(t=>{k.value=t.status,t.status?o.value={...o.value,upvote_count:o.value.upvote_count+1}:o.value={...o.value,upvote_count:o.value.upvote_count-1}}).catch(t=>{console.log(t)})},H=()=>{Ae({id:o.value.id}).then(t=>{f.value=t.status,t.status?o.value={...o.value,collection_count:o.value.collection_count+1}:o.value={...o.value,collection_count:o.value.collection_count-1}}).catch(t=>{console.log(t)})},O=()=>{ht(`${window.location.origin}/#/post?id=${o.value.id}`),window.$message.success("链接已复制到剪贴板")};return pe(()=>{c.state.userInfo.id>0&&(Pe({id:o.value.id}).then(t=>{k.value=t.status}).catch(t=>{console.log(t)}),Re({id:o.value.id}).then(t=>{f.value=t.status}).catch(t=>{console.log(t)}))}),(t,u)=>{const D=re,Q=_e("router-link"),m=He,_=ne,$=W,x=Ke,B=Je,q=pt,le=ye,ie=dt,ce=mt,X=Ge,ue=Qe,J=ve;return a(),d("div",{class:"detail-item",onClick:u[6]||(u[6]=M=>h(e(o).id))},[s(J,null,{avatar:n(()=>[s(D,{round:"",size:30,src:e(o).user.avatar},null,8,["src"])]),header:n(()=>[s(Q,{onClick:u[0]||(u[0]=K(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(o).user.username}}},{default:n(()=>[w(P(e(o).user.nickname),1)]),_:1},8,["to"]),v("span",ns," @"+P(e(o).user.username),1),e(o).is_top?(a(),S(m,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[w(" 置顶 ")]),_:1})):y("",!0),e(o).visibility==e(Y).PRIVATE?(a(),S(m,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[w(" 私密 ")]),_:1})):y("",!0),e(o).visibility==e(Y).FRIEND?(a(),S(m,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[w(" 好友可见 ")]),_:1})):y("",!0)]),"header-extra":n(()=>[e(c).state.userInfo.is_admin||e(c).state.userInfo.id===e(o).user.id?(a(),d("div",as,[s(x,{placement:"bottom-end",trigger:"click",size:"small",options:e(I),onSelect:A},{default:n(()=>[s($,{quaternary:"",circle:""},{icon:n(()=>[s(_,null,{default:n(()=>[s(e(at))]),_:1})]),_:1})]),_:1},8,["options"])])):y("",!0),s(B,{show:C.value,"onUpdate:show":u[1]||(u[1]=M=>C.value=M),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:j},null,8,["show"]),s(B,{show:l.value,"onUpdate:show":u[2]||(u[2]=M=>l.value=M),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(o).is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:N},null,8,["show","content"]),s(B,{show:z.value,"onUpdate:show":u[3]||(u[3]=M=>z.value=M),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(o).is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:V},null,8,["show","content"]),s(B,{show:g.value,"onUpdate:show":u[4]||(u[4]=M=>g.value=M),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(b.value==0?"公开":b.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:E},null,8,["show","content"])]),footer:n(()=>[s(q,{attachments:e(o).attachments},null,8,["attachments"]),s(q,{attachments:e(o).charge_attachments,price:e(o).attachment_price},null,8,["attachments","price"]),s(le,{imgs:e(o).imgs},null,8,["imgs"]),s(ie,{videos:e(o).videos,full:!0},null,8,["videos"]),s(ce,{links:e(o).links},null,8,["links"]),v("div",cs,[w(" 发布于 "+P(e(oe)(e(o).created_on,e(c).state.collapsedLeft))+" ",1),e(o).ip_loc?(a(),d("span",us,[s(X,{vertical:""}),w(" "+P(e(o).ip_loc),1)])):y("",!0),!e(c).state.collapsedLeft&&e(o).created_on!=e(o).latest_replied_on?(a(),d("span",rs,[s(X,{vertical:""}),w(" 最后回复 "+P(e(oe)(e(o).latest_replied_on,e(c).state.collapsedLeft)),1)])):y("",!0)])]),action:n(()=>[v("div",_s,[s(ue,{justify:"space-between"},{default:n(()=>[v("div",{class:"opt-item hover",onClick:K(F,["stop"])},[s(_,{size:"20",class:"opt-item-icon"},{default:n(()=>[k.value?y("",!0):(a(),S(e(lt),{key:0})),k.value?(a(),S(e(it),{key:1,color:"red"})):y("",!0)]),_:1}),w(" "+P(e(o).upvote_count),1)],8,ps),v("div",ds,[s(_,{size:"20",class:"opt-item-icon"},{default:n(()=>[s(e(ct))]),_:1}),w(" "+P(e(o).comment_count),1)]),v("div",{class:"opt-item hover",onClick:K(H,["stop"])},[s(_,{size:"20",class:"opt-item-icon"},{default:n(()=>[f.value?y("",!0):(a(),S(e(ut),{key:0})),f.value?(a(),S(e(rt),{key:1,color:"#ff7600"})):y("",!0)]),_:1}),w(" "+P(e(o).collection_count),1)],8,ms),v("div",{class:"opt-item hover",onClick:K(O,["stop"])},[s(_,{size:"20",class:"opt-item-icon"},{default:n(()=>[s(e(_t))]),_:1}),w(" "+P(e(o).share_count),1)],8,vs)]),_:1})])]),default:n(()=>[e(o).texts.length>0?(a(),d("div",ls,[(a(!0),d(te,null,se(e(o).texts,M=>(a(),d("span",{key:M.id,class:"post-text",onClick:u[5]||(u[5]=K(we=>L(we,e(o).id),["stop"])),innerHTML:e(de)(M.content).content},null,8,is))),128))])):y("",!0)]),_:1})])}}});const gs=U=>(fe("data-v-219a8fb1"),U=U(),ge(),U),hs={key:0,class:"detail-wrap"},ys={key:1,class:"empty-wrap"},ks={key:0,class:"comment-opts-wrap"},ws=gs(()=>v("span",{class:"comment-title-item"},"评论",-1)),bs={key:2},$s={key:0,class:"skeleton-wrap"},xs={key:1},Cs={key:0,class:"empty-wrap"},Is=G({__name:"Post",setup(U){const T=vt(),i=p({}),c=p(!1),R=p(!1),k=p([]),f=ee(()=>+T.query.id),C=p("default"),l=r=>{C.value=r,g()},z=()=>{i.value={id:0},c.value=!0,qe({id:f.value}).then(r=>{c.value=!1,i.value=r,g()}).catch(r=>{c.value=!1})},g=(r=!1)=>{k.value.length===0&&(R.value=!0),Me({id:i.value.id,sort_strategy:C.value}).then(b=>{k.value=b.list,R.value=!1,r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(b=>{R.value=!1})};return pe(()=>{z()}),ot(f,()=>{f.value>0&&T.name==="post"&&z()}),(r,b)=>{const o=yt,I=fs,h=Ze,L=We,A=Xe,j=et,N=tt,V=os,E=ft,F=Et,H=Ye;return a(),d("div",null,[s(o,{title:"泡泡详情",back:!0}),s(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[s(A,null,{default:n(()=>[s(L,{show:c.value},{default:n(()=>[i.value.id>1?(a(),d("div",hs,[s(I,{post:i.value,onReload:z},null,8,["post"])])):(a(),d("div",ys,[s(h,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),i.value.id>0?(a(),d("div",ks,[s(N,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":l},{prefix:n(()=>[ws]),default:n(()=>[s(j,{name:"default",tab:"默认"}),s(j,{name:"newest",tab:"最新"})]),_:1})])):y("",!0),i.value.id>0?(a(),S(A,{key:1},{default:n(()=>[s(V,{lock:i.value.is_lock,"post-id":i.value.id,onPostSuccess:b[0]||(b[0]=O=>g(!0))},null,8,["lock","post-id"])]),_:1})):y("",!0),i.value.id>0?(a(),d("div",bs,[R.value?(a(),d("div",$s,[s(E,{num:5})])):(a(),d("div",xs,[k.value.length===0?(a(),d("div",Cs,[s(h,{size:"large",description:"暂无评论,快来抢沙发"})])):y("",!0),(a(!0),d(te,null,se(k.value,O=>(a(),S(A,{key:O.id},{default:n(()=>[s(F,{comment:O,onReload:g},null,8,["comment"])]),_:2},1024))),128))]))])):y("",!0)]),_:1})])}}});const no=Z(Is,[["__scopeId","data-v-219a8fb1"]]);export{no as default}; diff --git a/web/dist/assets/Profile-b16dccf8.js b/web/dist/assets/Profile-35bca462.js similarity index 84% rename from web/dist/assets/Profile-b16dccf8.js rename to web/dist/assets/Profile-35bca462.js index 0fe8d74b..28456e6c 100644 --- a/web/dist/assets/Profile-b16dccf8.js +++ b/web/dist/assets/Profile-35bca462.js @@ -1 +1 @@ -import{_ as F}from"./post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js";import{_ as M}from"./post-skeleton-fdf95824.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{u as S}from"./vuex-cc1858c6.js";import{b as V}from"./vue-router-29025daf.js";import{w as D,_ as L}from"./index-f6017bc3.js";import{d as R,r,j,c as a,L as e,U as _,K as h,Y as m,O as d,o as t,a as s,M as f,F as q,$ as E}from"./@vue-f70ab1bd.js";import{F as G,G as H,o as K,f as O,g as T,I as Y,H as A}from"./naive-ui-ddb574dd.js";import"./content-0b348d1e.js";import"./@vicons-2f3cb6b9.js";import"./nonesir-video-29a967e9.js";import"./formatTime-936c40eb.js";import"./moment-b7869f98.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const J={class:"profile-baseinfo"},Q={class:"avatar"},W={class:"base-info"},X={class:"username"},Z={class:"uid"},ee={key:0,class:"skeleton-wrap"},te={key:1},oe={key:0,class:"empty-wrap"},se={key:1,class:"pagination-wrap"},ne=R({__name:"Profile",setup(ae){const o=S(),k=V(),i=r(!1),p=r([]),l=r(+k.query.p||1),c=r(20),u=r(0),g=()=>{i.value=!0,D({username:o.state.userInfo.username,page:l.value,page_size:c.value}).then(n=>{i.value=!1,p.value=n.list,u.value=Math.ceil(n.pager.total_rows/c.value),window.scrollTo(0,0)}).catch(n=>{i.value=!1})},y=n=>{l.value=n,g()};return j(()=>{g()}),(n,_e)=>{const w=N,I=K,b=O,P=T,x=M,z=Y,B=F,U=A,$=G,C=H;return t(),a("div",null,[e(w,{title:"主页"}),_(o).state.userInfo.id>0?(t(),h($,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:m(()=>[s("div",J,[s("div",Q,[e(I,{size:"large",src:_(o).state.userInfo.avatar},null,8,["src"])]),s("div",W,[s("div",X,[s("strong",null,f(_(o).state.userInfo.nickname),1),s("span",null," @"+f(_(o).state.userInfo.username),1)]),s("div",Z,"UID. "+f(_(o).state.userInfo.id),1)])]),e(P,{class:"profile-tabs-wrap",animated:""},{default:m(()=>[e(b,{name:"post",tab:"泡泡"})]),_:1}),i.value?(t(),a("div",ee,[e(x,{num:c.value},null,8,["num"])])):(t(),a("div",te,[p.value.length===0?(t(),a("div",oe,[e(z,{size:"large",description:"暂无数据"})])):d("",!0),(t(!0),a(q,null,E(p.value,v=>(t(),h(U,{key:v.id},{default:m(()=>[e(B,{post:v},null,8,["post"])]),_:2},1024))),128))]))]),_:1})):d("",!0),u.value>0?(t(),a("div",se,[e(C,{page:l.value,"onUpdate:page":y,"page-slot":_(o).state.collapsedRight?5:8,"page-count":u.value},null,8,["page","page-slot","page-count"])])):d("",!0)])}}});const Ve=L(ne,[["__scopeId","data-v-1d87d974"]]);export{Ve as default}; +import{_ as F}from"./post-item.vue_vue_type_style_index_0_lang-bc7656ee.js";import{_ as M}from"./post-skeleton-a79b6d6f.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{u as S}from"./vuex-cc1858c6.js";import{b as V}from"./vue-router-29025daf.js";import{w as D,_ as L}from"./index-cfa0bdbf.js";import{d as R,r,j,c as a,L as e,U as _,K as h,Y as m,O as d,o as t,a as s,M as f,F as q,$ as E}from"./@vue-f70ab1bd.js";import{F as G,G as H,o as K,f as O,g as T,I as Y,H as A}from"./naive-ui-ddb574dd.js";import"./content-43b82f8f.js";import"./@vicons-2f3cb6b9.js";import"./nonesir-video-29a967e9.js";import"./formatTime-936c40eb.js";import"./moment-b7869f98.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const J={class:"profile-baseinfo"},Q={class:"avatar"},W={class:"base-info"},X={class:"username"},Z={class:"uid"},ee={key:0,class:"skeleton-wrap"},te={key:1},oe={key:0,class:"empty-wrap"},se={key:1,class:"pagination-wrap"},ne=R({__name:"Profile",setup(ae){const o=S(),k=V(),i=r(!1),p=r([]),l=r(+k.query.p||1),c=r(20),u=r(0),g=()=>{i.value=!0,D({username:o.state.userInfo.username,page:l.value,page_size:c.value}).then(n=>{i.value=!1,p.value=n.list,u.value=Math.ceil(n.pager.total_rows/c.value),window.scrollTo(0,0)}).catch(n=>{i.value=!1})},y=n=>{l.value=n,g()};return j(()=>{g()}),(n,_e)=>{const w=N,I=K,b=O,P=T,x=M,z=Y,B=F,U=A,$=G,C=H;return t(),a("div",null,[e(w,{title:"主页"}),_(o).state.userInfo.id>0?(t(),h($,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:m(()=>[s("div",J,[s("div",Q,[e(I,{size:"large",src:_(o).state.userInfo.avatar},null,8,["src"])]),s("div",W,[s("div",X,[s("strong",null,f(_(o).state.userInfo.nickname),1),s("span",null," @"+f(_(o).state.userInfo.username),1)]),s("div",Z,"UID. "+f(_(o).state.userInfo.id),1)])]),e(P,{class:"profile-tabs-wrap",animated:""},{default:m(()=>[e(b,{name:"post",tab:"泡泡"})]),_:1}),i.value?(t(),a("div",ee,[e(x,{num:c.value},null,8,["num"])])):(t(),a("div",te,[p.value.length===0?(t(),a("div",oe,[e(z,{size:"large",description:"暂无数据"})])):d("",!0),(t(!0),a(q,null,E(p.value,v=>(t(),h(U,{key:v.id},{default:m(()=>[e(B,{post:v},null,8,["post"])]),_:2},1024))),128))]))]),_:1})):d("",!0),u.value>0?(t(),a("div",se,[e(C,{page:l.value,"onUpdate:page":y,"page-slot":_(o).state.collapsedRight?5:8,"page-count":u.value},null,8,["page","page-slot","page-count"])])):d("",!0)])}}});const Ve=L(ne,[["__scopeId","data-v-1d87d974"]]);export{Ve as default}; diff --git a/web/dist/assets/Setting-6508bd8c.js b/web/dist/assets/Setting-90459374.js similarity index 98% rename from web/dist/assets/Setting-6508bd8c.js rename to web/dist/assets/Setting-90459374.js index 74389d7f..16e504ad 100644 --- a/web/dist/assets/Setting-6508bd8c.js +++ b/web/dist/assets/Setting-90459374.js @@ -1 +1 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{d as ye,r as d,D as H,j as ke,c as g,L as t,Y as s,K as b,O as _,o as r,a as m,U as u,e as c,M as R,z as be,v as Ce,P as q,Z as B,a4 as Ie,a5 as $e}from"./@vue-f70ab1bd.js";import{u as Pe}from"./vuex-cc1858c6.js";import{O as X,P as Ue,Q as Se,R as Re,S as qe,T as Be,U as Ae,_ as ze}from"./index-f6017bc3.js";import{t as Ne}from"./@vicons-2f3cb6b9.js";import{h as Ke,o as De,e as xe,B as Fe,b as Oe,j as Te,S as je,$ as Ve,J as Ee,a0 as Le,a1 as Me,d as Je}from"./naive-ui-ddb574dd.js";import"./vue-router-29025daf.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const O=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),We={class:"base-line avatar"},Ge={class:"base-line"},Qe=O(()=>m("span",{class:"base-label"},"昵称",-1)),Ye={key:0},Ze={class:"base-line"},He=O(()=>m("span",{class:"base-label"},"用户名",-1)),Xe={key:0},et={key:1},tt=O(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=O(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(A){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),z=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),N=d(!1),K=d(!1),M=d(),J=d(),C=d(!1),D=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),W=d(),G=d(),Q=d(),Y=d(),a=H({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=H({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return z.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):z.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&z.value==="public/avatar"&&Ue({avatar:f.data.content}).then(p=>{var x;window.$message.success("头像更新成功"),(x=M.value)==null||x.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=Y.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=Q.value)==null||e.validate(v=>{v||(D.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=W.value)==null||e.validate(v=>{v||(N.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{N.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{N.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{K.value=!1,f.code===20012&&j()}))})},T=()=>{X().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{X().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Be({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&S.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Ae({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{S.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,S.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&T(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=J.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=we,f=De,p=xe,x=Fe,h=Oe,ge=Te,F=Ke,Z=je,w=Ve,he=Ee,V=Le,E=Me,L=Je;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(x,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:z.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[Qe,C.value?_("",!0):(r(),g("div",Ye,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:J,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:ce,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(p,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(Ne))]),_:1})]),_:1})):_("",!0)]),m("div",Ze,[He,c(" @"+R(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",Xe,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(Z,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:W,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:T},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(p,{type:"primary",ghost:"",disabled:S.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&S.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:N.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(Z,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(L,{ref_key:"activateFormRef",ref:G,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:j},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),U.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:Q,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:re,onKeydown:e[18]||(e[18]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:Y,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:D.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=ze(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; +import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{d as ye,r as d,D as H,j as ke,c as g,L as t,Y as s,K as b,O as _,o as r,a as m,U as u,e as c,M as R,z as be,v as Ce,P as q,Z as B,a4 as Ie,a5 as $e}from"./@vue-f70ab1bd.js";import{u as Pe}from"./vuex-cc1858c6.js";import{O as X,P as Ue,Q as Se,R as Re,S as qe,T as Be,U as Ae,_ as ze}from"./index-cfa0bdbf.js";import{t as Ne}from"./@vicons-2f3cb6b9.js";import{h as Ke,o as De,e as xe,B as Fe,b as Oe,j as Te,S as je,$ as Ve,J as Ee,a0 as Le,a1 as Me,d as Je}from"./naive-ui-ddb574dd.js";import"./vue-router-29025daf.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const O=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),We={class:"base-line avatar"},Ge={class:"base-line"},Qe=O(()=>m("span",{class:"base-label"},"昵称",-1)),Ye={key:0},Ze={class:"base-line"},He=O(()=>m("span",{class:"base-label"},"用户名",-1)),Xe={key:0},et={key:1},tt=O(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=O(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(A){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),z=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),N=d(!1),K=d(!1),M=d(),J=d(),C=d(!1),D=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),W=d(),G=d(),Q=d(),Y=d(),a=H({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=H({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return z.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):z.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&z.value==="public/avatar"&&Ue({avatar:f.data.content}).then(p=>{var x;window.$message.success("头像更新成功"),(x=M.value)==null||x.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=Y.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=Q.value)==null||e.validate(v=>{v||(D.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=W.value)==null||e.validate(v=>{v||(N.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{N.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{N.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{K.value=!1,f.code===20012&&j()}))})},T=()=>{X().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{X().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Be({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&S.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Ae({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{S.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,S.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&T(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=J.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=we,f=De,p=xe,x=Fe,h=Oe,ge=Te,F=Ke,Z=je,w=Ve,he=Ee,V=Le,E=Me,L=Je;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(x,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:z.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[Qe,C.value?_("",!0):(r(),g("div",Ye,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:J,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:ce,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(p,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(Ne))]),_:1})]),_:1})):_("",!0)]),m("div",Ze,[He,c(" @"+R(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",Xe,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(Z,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:W,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:T},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(p,{type:"primary",ghost:"",disabled:S.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&S.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:N.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(Z,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(L,{ref_key:"activateFormRef",ref:G,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:j},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),U.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:Q,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:re,onKeydown:e[18]||(e[18]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:Y,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:D.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=ze(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; diff --git a/web/dist/assets/Topic-7bd6ba6c.js b/web/dist/assets/Topic-e86f3eee.js similarity index 97% rename from web/dist/assets/Topic-7bd6ba6c.js rename to web/dist/assets/Topic-e86f3eee.js index ba8334f2..ac9c07e5 100644 --- a/web/dist/assets/Topic-7bd6ba6c.js +++ b/web/dist/assets/Topic-e86f3eee.js @@ -1 +1 @@ -import{q as x,u as S,r as I,t as U,_ as j}from"./index-f6017bc3.js";import{l as z}from"./@vicons-2f3cb6b9.js";import{d as F,r as _,n as $,j as q,_ as E,o as l,c as u,L as n,Y as a,K as T,e as A,M as w,O as m,U as r,w as D,a3 as K,F as Y,$ as G}from"./@vue-f70ab1bd.js";import{o as H,M as L,j as J,e as P,O as Q,L as R,F as W,f as X,g as Z,a as tt,k as et}from"./naive-ui-ddb574dd.js";import{_ as ot}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{u as nt}from"./vuex-cc1858c6.js";import"./vue-router-29025daf.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const st={key:0,class:"tag-item"},at={key:0,class:"tag-quote"},ct={key:1,class:"tag-quote tag-follow"},lt={key:0,class:"options"},it=F({__name:"tag-item",props:{tag:null,showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(s){const e=s,g=_(!1),d=$(()=>{let o=[];return e.tag.is_following===0?o.push({label:"关注",key:"follow"}):(e.tag.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"}),o.push({label:"取消关注",key:"unfollow"})),o}),i=o=>{switch(o){case"follow":I({topic_id:e.tag.id}).then(t=>{e.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":S({topic_id:e.tag.id}).then(t=>{e.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return q(()=>{g.value=!1}),(o,t)=>{const k=E("router-link"),f=H,v=L,c=J,h=P,y=Q,p=R;return!s.checkFollowing||s.checkFollowing&&s.tag.is_following===1?(l(),u("div",st,[n(p,null,{header:a(()=>[(l(),T(v,{type:"success",size:"large",round:"",key:s.tag.id},{avatar:a(()=>[n(f,{src:s.tag.user.avatar},null,8,["src"])]),default:a(()=>[n(k,{class:"hash-link",to:{name:"home",query:{q:s.tag.tag,t:"tag"}}},{default:a(()=>[A(" #"+w(s.tag.tag),1)]),_:1},8,["to"]),s.showAction?m("",!0):(l(),u("span",at,"("+w(s.tag.quote_num)+")",1)),s.showAction?(l(),u("span",ct,"("+w(s.tag.quote_num)+")",1)):m("",!0)]),_:1}))]),"header-extra":a(()=>[s.showAction?(l(),u("div",lt,[n(y,{placement:"bottom-end",trigger:"click",size:"small",options:r(d),onSelect:i},{default:a(()=>[n(h,{type:"success",quaternary:"",circle:"",block:""},{icon:a(()=>[n(c,null,{default:a(()=>[n(r(z))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)]),_:1})])):m("",!0)}}});const _t=F({__name:"Topic",setup(s){const e=nt(),g=_([]),d=_("hot"),i=_(!1),o=_(!1),t=_(!1);D(o,()=>{o.value||(window.$message.success("保存成功"),e.commit("refreshTopicFollow"))});const k=$({get:()=>{let c="编辑";return o.value&&(c="保存"),c},set:c=>{}}),f=()=>{i.value=!0,U({type:d.value,num:50}).then(c=>{g.value=c.topics,i.value=!1}).catch(c=>{console.log(c),i.value=!1})},v=c=>{d.value=c,c=="follow"?t.value=!0:t.value=!1,f()};return q(()=>{f()}),(c,h)=>{const y=ot,p=X,B=L,C=Z,V=it,M=tt,N=et,O=W;return l(),u("div",null,[n(y,{title:"话题"}),n(O,{class:"main-content-wrap tags-wrap",bordered:""},{default:a(()=>[n(C,{type:"line",animated:"","onUpdate:value":v},K({default:a(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),r(e).state.userLogined?(l(),T(p,{key:0,name:"follow",tab:"关注"})):m("",!0)]),_:2},[r(e).state.userLogined?{name:"suffix",fn:a(()=>[n(B,{checked:o.value,"onUpdate:checked":h[0]||(h[0]=b=>o.value=b),checkable:""},{default:a(()=>[A(w(r(k)),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:a(()=>[n(M,null,{default:a(()=>[(l(!0),u(Y,null,G(g.value,b=>(l(),T(V,{tag:b,showAction:r(e).state.userLogined&&o.value,checkFollowing:t.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Vt=j(_t,[["__scopeId","data-v-15794a53"]]);export{Vt as default}; +import{q as x,u as S,r as I,t as U,_ as j}from"./index-cfa0bdbf.js";import{l as z}from"./@vicons-2f3cb6b9.js";import{d as F,r as _,n as $,j as q,_ as E,o as l,c as u,L as n,Y as a,K as T,e as A,M as w,O as m,U as r,w as D,a3 as K,F as Y,$ as G}from"./@vue-f70ab1bd.js";import{o as H,M as L,j as J,e as P,O as Q,L as R,F as W,f as X,g as Z,a as tt,k as et}from"./naive-ui-ddb574dd.js";import{_ as ot}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{u as nt}from"./vuex-cc1858c6.js";import"./vue-router-29025daf.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const st={key:0,class:"tag-item"},at={key:0,class:"tag-quote"},ct={key:1,class:"tag-quote tag-follow"},lt={key:0,class:"options"},it=F({__name:"tag-item",props:{tag:null,showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(s){const e=s,g=_(!1),d=$(()=>{let o=[];return e.tag.is_following===0?o.push({label:"关注",key:"follow"}):(e.tag.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"}),o.push({label:"取消关注",key:"unfollow"})),o}),i=o=>{switch(o){case"follow":I({topic_id:e.tag.id}).then(t=>{e.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":S({topic_id:e.tag.id}).then(t=>{e.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return q(()=>{g.value=!1}),(o,t)=>{const k=E("router-link"),f=H,v=L,c=J,h=P,y=Q,p=R;return!s.checkFollowing||s.checkFollowing&&s.tag.is_following===1?(l(),u("div",st,[n(p,null,{header:a(()=>[(l(),T(v,{type:"success",size:"large",round:"",key:s.tag.id},{avatar:a(()=>[n(f,{src:s.tag.user.avatar},null,8,["src"])]),default:a(()=>[n(k,{class:"hash-link",to:{name:"home",query:{q:s.tag.tag,t:"tag"}}},{default:a(()=>[A(" #"+w(s.tag.tag),1)]),_:1},8,["to"]),s.showAction?m("",!0):(l(),u("span",at,"("+w(s.tag.quote_num)+")",1)),s.showAction?(l(),u("span",ct,"("+w(s.tag.quote_num)+")",1)):m("",!0)]),_:1}))]),"header-extra":a(()=>[s.showAction?(l(),u("div",lt,[n(y,{placement:"bottom-end",trigger:"click",size:"small",options:r(d),onSelect:i},{default:a(()=>[n(h,{type:"success",quaternary:"",circle:"",block:""},{icon:a(()=>[n(c,null,{default:a(()=>[n(r(z))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)]),_:1})])):m("",!0)}}});const _t=F({__name:"Topic",setup(s){const e=nt(),g=_([]),d=_("hot"),i=_(!1),o=_(!1),t=_(!1);D(o,()=>{o.value||(window.$message.success("保存成功"),e.commit("refreshTopicFollow"))});const k=$({get:()=>{let c="编辑";return o.value&&(c="保存"),c},set:c=>{}}),f=()=>{i.value=!0,U({type:d.value,num:50}).then(c=>{g.value=c.topics,i.value=!1}).catch(c=>{console.log(c),i.value=!1})},v=c=>{d.value=c,c=="follow"?t.value=!0:t.value=!1,f()};return q(()=>{f()}),(c,h)=>{const y=ot,p=X,B=L,C=Z,V=it,M=tt,N=et,O=W;return l(),u("div",null,[n(y,{title:"话题"}),n(O,{class:"main-content-wrap tags-wrap",bordered:""},{default:a(()=>[n(C,{type:"line",animated:"","onUpdate:value":v},K({default:a(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),r(e).state.userLogined?(l(),T(p,{key:0,name:"follow",tab:"关注"})):m("",!0)]),_:2},[r(e).state.userLogined?{name:"suffix",fn:a(()=>[n(B,{checked:o.value,"onUpdate:checked":h[0]||(h[0]=b=>o.value=b),checkable:""},{default:a(()=>[A(w(r(k)),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:a(()=>[n(M,null,{default:a(()=>[(l(!0),u(Y,null,G(g.value,b=>(l(),T(V,{tag:b,showAction:r(e).state.userLogined&&o.value,checkFollowing:t.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Vt=j(_t,[["__scopeId","data-v-15794a53"]]);export{Vt as default}; diff --git a/web/dist/assets/User-63f42059.js b/web/dist/assets/User-50645c66.js similarity index 96% rename from web/dist/assets/User-63f42059.js rename to web/dist/assets/User-50645c66.js index 11bb7b7e..92f0e553 100644 --- a/web/dist/assets/User-63f42059.js +++ b/web/dist/assets/User-50645c66.js @@ -1 +1 @@ -import{_ as _e}from"./post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js";import{_ as re}from"./post-skeleton-fdf95824.js";import{x as ue,_ as I,y as pe,z as de,w as me,A as he,B as ve}from"./index-f6017bc3.js";import{Q as C,R as P,S as R,b as T,e as S,i as A,u as fe,T as ge,F as we,G as ye,o as ke,M as be,j as xe,O as $e,k as Ue,f as ze,g as Fe,I as Ie,H as Se}from"./naive-ui-ddb574dd.js";import{d as q,r as c,o as i,K as F,Y as t,a as _,L as n,e as h,M as $,D as qe,n as We,w as Me,j as Be,c as m,U as x,O as z,F as Ce,$ as Pe}from"./@vue-f70ab1bd.js";import{_ as Re}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{u as Te}from"./vuex-cc1858c6.js";import{b as Ae}from"./vue-router-29025daf.js";import{e as De}from"./@vicons-2f3cb6b9.js";import"./content-0b348d1e.js";import"./nonesir-video-29a967e9.js";import"./formatTime-936c40eb.js";import"./moment-b7869f98.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Ne={class:"whisper-wrap"},Ve={class:"whisper-line"},Le={class:"whisper-line send-wrap"},Oe=q({__name:"whisper",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,ue({user_id:u.user.id,content:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=C,f=P,g=R,w=T,y=S,k=A;return i(),F(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ne,[n(g,{"show-icon":!1},{default:t(()=>[h(" 即将发送私信给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ve,[n(w,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"200","show-count":""},null,8,["value"])]),_("div",Le,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const je=I(Oe,[["__scopeId","data-v-0cbfe47c"]]),He={class:"whisper-wrap"},Ee={class:"whisper-line"},Ge={class:"whisper-line send-wrap"},Ke=q({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,pe({user_id:u.user.id,greetings:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=C,f=P,g=R,w=T,y=S,k=A;return i(),F(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",He,[n(g,{"show-icon":!1},{default:t(()=>[h(" 发送添加朋友申请给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ee,[n(w,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Ge,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Qe=I(Ke,[["__scopeId","data-v-60be56a2"]]),Ye={key:0,class:"profile-baseinfo"},Je={class:"avatar"},Xe={class:"base-info"},Ze={class:"username"},es={class:"uid"},ss={key:0,class:"user-opts"},ns={key:0,class:"skeleton-wrap"},ts={key:1},as={key:0,class:"empty-wrap"},os={key:0,class:"pagination-wrap"},ls=q({__name:"User",setup(r){fe();const U=ge(),u=Te(),a=Ae(),o=c(!1),e=qe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),l=c(!1),p=c(!1),d=c(!1),v=c([]),f=c(a.query.username||""),g=c(+a.query.p||1),w=c(20),y=c(0),k=()=>{o.value=!0,me({username:f.value,page:g.value,page_size:w.value}).then(s=>{o.value=!1,v.value=s.list,y.value=Math.ceil(s.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(s=>{o.value=!1})},b=()=>{l.value=!0,de({username:f.value}).then(s=>{l.value=!1,e.id=s.id,e.avatar=s.avatar,e.username=s.username,e.nickname=s.nickname,e.is_admin=s.is_admin,e.is_friend=s.is_friend,e.status=s.status,k()}).catch(s=>{l.value=!1,console.log(s)})},D=s=>{g.value=s,k()},N=()=>{p.value=!0},V=()=>{d.value=!0},L=()=>{p.value=!1},O=()=>{d.value=!1},j=We(()=>{let s=[{label:"私信",key:"whisper"}];return u.state.userInfo.is_admin&&(e.status===1?s.push({label:"禁言",key:"banned"}):s.push({label:"解封",key:"deblocking"})),e.is_friend?s.push({label:"删除好友",key:"delete"}):s.push({label:"添加朋友",key:"requesting"}),s}),H=s=>{switch(s){case"whisper":N();break;case"delete":E();break;case"requesting":V();break;case"banned":case"deblocking":G();break}},E=()=>{U.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,he({user_id:e.id}).then(s=>{l.value=!1,e.is_friend=!1,k()}).catch(s=>{l.value=!1,console.log(s)})}})},G=()=>{U.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,ve({id:e.id,status:e.status===1?2:1}).then(s=>{l.value=!1,b()}).catch(s=>{l.value=!1,console.log(s)})}})};return Me(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(f.value=a.query.username||"",b())}),Be(()=>{b()}),(s,W)=>{const K=Re,Q=ke,M=be,Y=xe,J=S,X=$e,Z=je,ee=Ue,se=ze,ne=Fe,te=re,ae=Ie,oe=_e,le=Se,ie=we,ce=ye;return i(),m("div",null,[n(K,{title:"用户详情"}),n(ie,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(ee,{show:l.value},{default:t(()=>[e.id>0?(i(),m("div",Ye,[_("div",Je,[n(Q,{size:"large",src:e.avatar},null,8,["src"])]),_("div",Xe,[_("div",Ze,[_("strong",null,$(e.nickname),1),_("span",null," @"+$(e.username),1),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username&&e.is_friend?(i(),F(M,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[h(" 好友 ")]),_:1})):z("",!0),e.is_admin?(i(),F(M,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[h(" 管理员 ")]),_:1})):z("",!0)]),_("div",es,"UID. "+$(e.id),1)]),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username?(i(),m("div",ss,[n(X,{placement:"bottom-end",trigger:"click",size:"small",options:x(j),onSelect:H},{default:t(()=>[n(J,{quaternary:"",circle:""},{icon:t(()=>[n(Y,null,{default:t(()=>[n(x(De))]),_:1})]),_:1})]),_:1},8,["options"])])):z("",!0)])):z("",!0),n(Z,{show:p.value,user:e,onSuccess:L},null,8,["show","user"]),n(Qe,{show:d.value,user:e,onSuccess:O},null,8,["show","user"])]),_:1},8,["show"]),n(ne,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(se,{name:"post",tab:"泡泡"})]),_:1}),o.value?(i(),m("div",ns,[n(te,{num:w.value},null,8,["num"])])):(i(),m("div",ts,[v.value.length===0?(i(),m("div",as,[n(ae,{size:"large",description:"暂无数据"})])):z("",!0),(i(!0),m(Ce,null,Pe(v.value,B=>(i(),F(le,{key:B.id},{default:t(()=>[n(oe,{post:B},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),y.value>0?(i(),m("div",os,[n(ce,{page:g.value,"onUpdate:page":D,"page-slot":x(u).state.collapsedRight?5:8,"page-count":y.value},null,8,["page","page-slot","page-count"])])):z("",!0)])}}});const Ps=I(ls,[["__scopeId","data-v-46a0183a"]]);export{Ps as default}; +import{_ as _e}from"./post-item.vue_vue_type_style_index_0_lang-bc7656ee.js";import{_ as re}from"./post-skeleton-a79b6d6f.js";import{x as ue,_ as I,y as pe,z as de,w as me,A as he,B as ve}from"./index-cfa0bdbf.js";import{Q as C,R as P,S as R,b as T,e as S,i as A,u as fe,T as ge,F as we,G as ye,o as ke,M as be,j as xe,O as $e,k as Ue,f as ze,g as Fe,I as Ie,H as Se}from"./naive-ui-ddb574dd.js";import{d as q,r as c,o as i,K as F,Y as t,a as _,L as n,e as h,M as $,D as qe,n as We,w as Me,j as Be,c as m,U as x,O as z,F as Ce,$ as Pe}from"./@vue-f70ab1bd.js";import{_ as Re}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{u as Te}from"./vuex-cc1858c6.js";import{b as Ae}from"./vue-router-29025daf.js";import{e as De}from"./@vicons-2f3cb6b9.js";import"./content-43b82f8f.js";import"./nonesir-video-29a967e9.js";import"./formatTime-936c40eb.js";import"./moment-b7869f98.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Ne={class:"whisper-wrap"},Ve={class:"whisper-line"},Le={class:"whisper-line send-wrap"},Oe=q({__name:"whisper",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,ue({user_id:u.user.id,content:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=C,f=P,g=R,w=T,y=S,k=A;return i(),F(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ne,[n(g,{"show-icon":!1},{default:t(()=>[h(" 即将发送私信给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ve,[n(w,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"200","show-count":""},null,8,["value"])]),_("div",Le,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const je=I(Oe,[["__scopeId","data-v-0cbfe47c"]]),He={class:"whisper-wrap"},Ee={class:"whisper-line"},Ge={class:"whisper-line send-wrap"},Ke=q({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,pe({user_id:u.user.id,greetings:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=C,f=P,g=R,w=T,y=S,k=A;return i(),F(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",He,[n(g,{"show-icon":!1},{default:t(()=>[h(" 发送添加朋友申请给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ee,[n(w,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Ge,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Qe=I(Ke,[["__scopeId","data-v-60be56a2"]]),Ye={key:0,class:"profile-baseinfo"},Je={class:"avatar"},Xe={class:"base-info"},Ze={class:"username"},es={class:"uid"},ss={key:0,class:"user-opts"},ns={key:0,class:"skeleton-wrap"},ts={key:1},as={key:0,class:"empty-wrap"},os={key:0,class:"pagination-wrap"},ls=q({__name:"User",setup(r){fe();const U=ge(),u=Te(),a=Ae(),o=c(!1),e=qe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),l=c(!1),p=c(!1),d=c(!1),v=c([]),f=c(a.query.username||""),g=c(+a.query.p||1),w=c(20),y=c(0),k=()=>{o.value=!0,me({username:f.value,page:g.value,page_size:w.value}).then(s=>{o.value=!1,v.value=s.list,y.value=Math.ceil(s.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(s=>{o.value=!1})},b=()=>{l.value=!0,de({username:f.value}).then(s=>{l.value=!1,e.id=s.id,e.avatar=s.avatar,e.username=s.username,e.nickname=s.nickname,e.is_admin=s.is_admin,e.is_friend=s.is_friend,e.status=s.status,k()}).catch(s=>{l.value=!1,console.log(s)})},D=s=>{g.value=s,k()},N=()=>{p.value=!0},V=()=>{d.value=!0},L=()=>{p.value=!1},O=()=>{d.value=!1},j=We(()=>{let s=[{label:"私信",key:"whisper"}];return u.state.userInfo.is_admin&&(e.status===1?s.push({label:"禁言",key:"banned"}):s.push({label:"解封",key:"deblocking"})),e.is_friend?s.push({label:"删除好友",key:"delete"}):s.push({label:"添加朋友",key:"requesting"}),s}),H=s=>{switch(s){case"whisper":N();break;case"delete":E();break;case"requesting":V();break;case"banned":case"deblocking":G();break}},E=()=>{U.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,he({user_id:e.id}).then(s=>{l.value=!1,e.is_friend=!1,k()}).catch(s=>{l.value=!1,console.log(s)})}})},G=()=>{U.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,ve({id:e.id,status:e.status===1?2:1}).then(s=>{l.value=!1,b()}).catch(s=>{l.value=!1,console.log(s)})}})};return Me(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(f.value=a.query.username||"",b())}),Be(()=>{b()}),(s,W)=>{const K=Re,Q=ke,M=be,Y=xe,J=S,X=$e,Z=je,ee=Ue,se=ze,ne=Fe,te=re,ae=Ie,oe=_e,le=Se,ie=we,ce=ye;return i(),m("div",null,[n(K,{title:"用户详情"}),n(ie,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(ee,{show:l.value},{default:t(()=>[e.id>0?(i(),m("div",Ye,[_("div",Je,[n(Q,{size:"large",src:e.avatar},null,8,["src"])]),_("div",Xe,[_("div",Ze,[_("strong",null,$(e.nickname),1),_("span",null," @"+$(e.username),1),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username&&e.is_friend?(i(),F(M,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[h(" 好友 ")]),_:1})):z("",!0),e.is_admin?(i(),F(M,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[h(" 管理员 ")]),_:1})):z("",!0)]),_("div",es,"UID. "+$(e.id),1)]),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username?(i(),m("div",ss,[n(X,{placement:"bottom-end",trigger:"click",size:"small",options:x(j),onSelect:H},{default:t(()=>[n(J,{quaternary:"",circle:""},{icon:t(()=>[n(Y,null,{default:t(()=>[n(x(De))]),_:1})]),_:1})]),_:1},8,["options"])])):z("",!0)])):z("",!0),n(Z,{show:p.value,user:e,onSuccess:L},null,8,["show","user"]),n(Qe,{show:d.value,user:e,onSuccess:O},null,8,["show","user"])]),_:1},8,["show"]),n(ne,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(se,{name:"post",tab:"泡泡"})]),_:1}),o.value?(i(),m("div",ns,[n(te,{num:w.value},null,8,["num"])])):(i(),m("div",ts,[v.value.length===0?(i(),m("div",as,[n(ae,{size:"large",description:"暂无数据"})])):z("",!0),(i(!0),m(Ce,null,Pe(v.value,B=>(i(),F(le,{key:B.id},{default:t(()=>[n(oe,{post:B},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),y.value>0?(i(),m("div",os,[n(ce,{page:g.value,"onUpdate:page":D,"page-slot":x(u).state.collapsedRight?5:8,"page-count":y.value},null,8,["page","page-slot","page-count"])])):z("",!0)])}}});const Ps=I(ls,[["__scopeId","data-v-46a0183a"]]);export{Ps as default}; diff --git a/web/dist/assets/Wallet-94982dc4.js b/web/dist/assets/Wallet-6cbfa968.js similarity index 96% rename from web/dist/assets/Wallet-94982dc4.js rename to web/dist/assets/Wallet-6cbfa968.js index 8d8ed1f0..e0bd62b2 100644 --- a/web/dist/assets/Wallet-94982dc4.js +++ b/web/dist/assets/Wallet-6cbfa968.js @@ -1 +1 @@ -import{_ as H}from"./post-skeleton-fdf95824.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js";import{d as J,r as c,j as X,c as _,L as e,Y as o,o as n,U as y,O as w,a,e as k,F as N,$,z as ee,v as te,M as r,K as q,a1 as oe,Z as ae,a4 as ne,a5 as se}from"./@vue-f70ab1bd.js";import{u as le}from"./vuex-cc1858c6.js";import{b as ce}from"./vue-router-29025daf.js";import{b as ie}from"./qrcode-23069ad7.js";import{K as _e,L as re,M as ue,N as pe,_ as me}from"./index-f6017bc3.js";import{a as de}from"./formatTime-936c40eb.js";import{s as ge}from"./@vicons-2f3cb6b9.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,G as be,I as xe,j as Ce,l as Ie,h as Se,H as Re}from"./naive-ui-ddb574dd.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-59d11638.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";const L=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},Ne={class:"balance-opts"},$e={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Le={key:1},Be={key:0,class:"empty-wrap"},Fe={class:"bill-line"},Me={key:0,class:"amount-options"},Oe={key:1,style:{"margin-top":"10px"}},Pe={class:"qrcode-wrap"},Te=L(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ue={class:"pay-tips"},We={class:"pay-sub-tips"},Ee=L(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=J({__name:"Wallet",setup(d){const i=le(),B=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+B.query.p||1),C=c(20),I=c(0),F=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,I.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},M=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},O=()=>{g.value=!0},P=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const S=setInterval(()=>{pe({id:l.id}).then(m=>{m.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(m=>{console.log(m)})},2e3)}).catch(l=>{v.value=!1})},T=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Q,m=fe,U=ye,f=we,z=ke,W=be,E=H,V=xe,D=Re,K=ve,j=Ce,Y=Ie,Z=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(K,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",$e,[e(W,{page:x.value,"onUpdate:page":M,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(U,{label:"账户余额 (元)"},{default:o(()=>[e(m,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["from","to"])]),_:1}),a("div",Ne,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:O},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:T},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",Le,[b.value.length===0?(n(),_("div",Be,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(N,null,$(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Fe,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Z,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Me,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_(N,null,$(F.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(De=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Oe,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:P},{icon:o(()=>[e(j,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Pe,[Te,a("div",Ue," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",We,[e(Y,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=me(Ve,[["__scopeId","data-v-870bd246"]]);export{yt as default}; +import{_ as H}from"./post-skeleton-a79b6d6f.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-5681167a.js";import{d as J,r as c,j as X,c as _,L as e,Y as o,o as n,U as y,O as w,a,e as k,F as N,$,z as ee,v as te,M as r,K as q,a1 as oe,Z as ae,a4 as ne,a5 as se}from"./@vue-f70ab1bd.js";import{u as le}from"./vuex-cc1858c6.js";import{b as ce}from"./vue-router-29025daf.js";import{b as ie}from"./qrcode-23069ad7.js";import{K as _e,L as re,M as ue,N as pe,_ as me}from"./index-cfa0bdbf.js";import{a as de}from"./formatTime-936c40eb.js";import{s as ge}from"./@vicons-2f3cb6b9.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,G as be,I as xe,j as Ce,l as Ie,h as Se,H as Re}from"./naive-ui-ddb574dd.js";import"./vooks-dfdd6eef.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-59d11638.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./@css-render-66126308.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";const L=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},Ne={class:"balance-opts"},$e={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Le={key:1},Be={key:0,class:"empty-wrap"},Fe={class:"bill-line"},Me={key:0,class:"amount-options"},Oe={key:1,style:{"margin-top":"10px"}},Pe={class:"qrcode-wrap"},Te=L(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ue={class:"pay-tips"},We={class:"pay-sub-tips"},Ee=L(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=J({__name:"Wallet",setup(d){const i=le(),B=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+B.query.p||1),C=c(20),I=c(0),F=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,I.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},M=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},O=()=>{g.value=!0},P=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const S=setInterval(()=>{pe({id:l.id}).then(m=>{m.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(m=>{console.log(m)})},2e3)}).catch(l=>{v.value=!1})},T=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Q,m=fe,U=ye,f=we,z=ke,W=be,E=H,V=xe,D=Re,K=ve,j=Ce,Y=Ie,Z=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(K,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",$e,[e(W,{page:x.value,"onUpdate:page":M,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(U,{label:"账户余额 (元)"},{default:o(()=>[e(m,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["from","to"])]),_:1}),a("div",Ne,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:O},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:T},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",Le,[b.value.length===0?(n(),_("div",Be,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(N,null,$(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Fe,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Z,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Me,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_(N,null,$(F.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(De=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Oe,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:P},{icon:o(()=>[e(j,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Pe,[Te,a("div",Ue," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",We,[e(Y,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=me(Ve,[["__scopeId","data-v-870bd246"]]);export{yt as default}; diff --git a/web/dist/assets/content-0b348d1e.js b/web/dist/assets/content-43b82f8f.js similarity index 98% rename from web/dist/assets/content-0b348d1e.js rename to web/dist/assets/content-43b82f8f.js index 73594536..df291f47 100644 --- a/web/dist/assets/content-0b348d1e.js +++ b/web/dist/assets/content-43b82f8f.js @@ -1 +1 @@ -import{d as h,o as e,c as r,F as a,$ as m,L as s,Y as o,U as c,a as j,M as I,Z as k,K as _,O as g,r as C,e as B,s as b}from"./@vue-f70ab1bd.js";import{q as D,r as L}from"./@vicons-2f3cb6b9.js";import{j as $,V as N,W as V,m as U,X as z,e as F,i as M}from"./naive-ui-ddb574dd.js";import{_ as A,H as O,I as T}from"./index-f6017bc3.js";import{N as P}from"./nonesir-video-29a967e9.js";const R={class:"link-wrap"},Z=["href"],q={class:"link-txt"},H=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(D))]),_:1}),j("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[j("span",q,I(n.content),1)],8,Z)]))),128))])}}});const nt=A(H,[["__scopeId","data-v-6c4d1eb6"]]),K={key:0},ot=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=N,n=V;return l.videos.length>0?(e(),r("div",K,[s(n,{"x-gap":4,"y-gap":4,cols:y.full?1:5},{default:o(()=>[s(x,{span:y.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),_(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),S={class:"images-wrap"},st=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=U,d=N,f=V,w=z;return e(),r("div",S,[[1].includes(l.imgs.length)?(e(),_(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),_(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),_(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),_(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),_(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),_(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),_(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),_(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const W={class:"attachment-wrap"},X=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=C(!1),u=C(""),x=C(0),n=d=>{p.value=!0,x.value=d.id,u.value="这是一个免费附件,您可以直接下载?",d.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),O({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{T({id:x.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,f)=>{const w=$,t=F,i=M;return e(),r("div",W,[(e(!0),r(a,null,m(y.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(Y=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(L))]),_:1})]),default:o(()=>[B(" "+I(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const rt=A(X,[["__scopeId","data-v-22563084"]]),lt=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{st as _,rt as a,ot as b,nt as c,lt as p}; +import{d as h,o as e,c as r,F as a,$ as m,L as s,Y as o,U as c,a as j,M as I,Z as k,K as _,O as g,r as C,e as B,s as b}from"./@vue-f70ab1bd.js";import{q as D,r as L}from"./@vicons-2f3cb6b9.js";import{j as $,V as N,W as V,m as U,X as z,e as F,i as M}from"./naive-ui-ddb574dd.js";import{_ as A,H as O,I as T}from"./index-cfa0bdbf.js";import{N as P}from"./nonesir-video-29a967e9.js";const R={class:"link-wrap"},Z=["href"],q={class:"link-txt"},H=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(D))]),_:1}),j("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[j("span",q,I(n.content),1)],8,Z)]))),128))])}}});const nt=A(H,[["__scopeId","data-v-6c4d1eb6"]]),K={key:0},ot=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=N,n=V;return l.videos.length>0?(e(),r("div",K,[s(n,{"x-gap":4,"y-gap":4,cols:y.full?1:5},{default:o(()=>[s(x,{span:y.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),_(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),S={class:"images-wrap"},st=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=U,d=N,f=V,w=z;return e(),r("div",S,[[1].includes(l.imgs.length)?(e(),_(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),_(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),_(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),_(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),_(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),_(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),_(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),_(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const W={class:"attachment-wrap"},X=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=C(!1),u=C(""),x=C(0),n=d=>{p.value=!0,x.value=d.id,u.value="这是一个免费附件,您可以直接下载?",d.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),O({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{T({id:x.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,f)=>{const w=$,t=F,i=M;return e(),r("div",W,[(e(!0),r(a,null,m(y.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(Y=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(L))]),_:1})]),default:o(()=>[B(" "+I(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const rt=A(X,[["__scopeId","data-v-22563084"]]),lt=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{st as _,rt as a,ot as b,nt as c,lt as p}; diff --git a/web/dist/assets/index-6c46cd46.css b/web/dist/assets/index-91393603.css similarity index 83% rename from web/dist/assets/index-6c46cd46.css rename to web/dist/assets/index-91393603.css index bacc863a..bf4f1be3 100644 --- a/web/dist/assets/index-6c46cd46.css +++ b/web/dist/assets/index-91393603.css @@ -1 +1 @@ -.auth-wrap[data-v-52205ad0]{margin-top:-30px}.dark .auth-wrap[data-v-52205ad0]{background-color:#101014bf}.rightbar-wrap[data-v-200967dd]{width:240px;position:fixed;left:calc(50% + var(--content-main) / 2 + 10px)}.rightbar-wrap .search-wrap[data-v-200967dd]{margin:12px 0}.rightbar-wrap .hot-tag-item[data-v-200967dd]{line-height:2;position:relative}.rightbar-wrap .hot-tag-item .hash-link[data-v-200967dd]{width:calc(100% - 60px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.rightbar-wrap .hot-tag-item .post-num[data-v-200967dd]{position:absolute;right:0;top:0;width:60px;text-align:right;line-height:2;opacity:.5}.rightbar-wrap .hottopic-wrap[data-v-200967dd]{margin-bottom:10px}.rightbar-wrap .copyright-wrap .copyright[data-v-200967dd]{font-size:12px;opacity:.75}.rightbar-wrap .copyright-wrap .hash-link[data-v-200967dd]{font-size:12px}.dark .hottopic-wrap[data-v-200967dd],.dark .copyright-wrap[data-v-200967dd]{background-color:#18181c}.sidebar-wrap{z-index:99;width:200px;height:100vh;position:fixed;right:calc(50% + var(--content-main) / 2 + 10px);padding:12px 0;box-sizing:border-box}.sidebar-wrap .n-menu .n-menu-item-content:before{border-radius:21px}.logo-wrap{display:flex;justify-content:flex-start;margin-bottom:12px}.logo-wrap .logo-img{margin-left:24px}.logo-wrap .logo-img:hover{cursor:pointer}.user-wrap{display:flex;align-items:center;position:absolute;bottom:12px;left:12px;right:12px}.user-wrap .user-mini-wrap{display:none}.user-wrap .user-avatar{margin-right:8px}.user-wrap .user-info{display:flex;flex-direction:column}.user-wrap .user-info .nickname{font-size:16px;font-weight:700;line-height:16px;height:16px;margin-bottom:2px;display:flex;align-items:center}.user-wrap .user-info .nickname .nickname-txt{max-width:90px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.user-wrap .user-info .nickname .logout{margin-left:6px}.user-wrap .user-info .username{font-size:14px;line-height:16px;height:16px;width:120px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;opacity:.75}.user-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.user-wrap .login-only-wrap button{margin:0 4px;width:80%}.user-wrap .login-wrap{display:flex;justify-content:center;width:100%}.user-wrap .login-wrap button{margin:0 4px}.auth-card .n-card-header{z-index:999}@media screen and (max-width: 821px){.sidebar-wrap{width:200px;right:calc(100% - 200px)}.logo-wrap .logo-img{margin-left:12px!important}.user-wrap .user-avatar,.user-wrap .user-info,.user-wrap .login-only-wrap,.user-wrap .login-wrap{margin-bottom:32px}}:root{--content-main: 544px}.app-container{margin:0}.app-container .app-wrap{width:100%;margin:0 auto}.main-wrap{min-height:100vh;display:flex;flex-direction:row;justify-content:center}.main-wrap .content-wrap{width:100%;max-width:var(--content-main);position:relative}.main-wrap .main-content-wrap{margin:0;border-top:none;border-radius:0}.main-wrap .main-content-wrap .n-list-item{padding:0}.empty-wrap{min-height:300px;display:flex;align-items:center;justify-content:center}.hash-link,.user-link{color:#18a058;text-decoration:none;cursor:pointer}.hash-link:hover,.user-link:hover{opacity:.8}.beian-link{color:#333;text-decoration:none}.beian-link:hover{opacity:.75}.username-link{color:#000;color:none;text-decoration:none;cursor:pointer}.username-link:hover{text-decoration:underline}.dark .hash-link,.dark .user-link{color:#63e2b7}.dark .username-link{color:#eee}.dark .beian-link{color:#ddd}@media screen and (max-width: 821px){.content-wrap{top:0;position:absolute!important}} +.auth-wrap[data-v-52205ad0]{margin-top:-30px}.dark .auth-wrap[data-v-52205ad0]{background-color:#101014bf}.rightbar-wrap[data-v-54a02510]{width:240px;position:fixed;left:calc(50% + var(--content-main) / 2 + 10px)}.rightbar-wrap .search-wrap[data-v-54a02510]{margin:12px 0}.rightbar-wrap .hot-tag-item[data-v-54a02510]{line-height:2;position:relative}.rightbar-wrap .hot-tag-item .hash-link[data-v-54a02510]{width:calc(100% - 60px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.rightbar-wrap .hot-tag-item .post-num[data-v-54a02510]{position:absolute;right:0;top:0;width:60px;text-align:right;line-height:2;opacity:.5}.rightbar-wrap .hottopic-wrap[data-v-54a02510]{margin-bottom:10px}.rightbar-wrap .copyright-wrap .copyright[data-v-54a02510]{font-size:12px;opacity:.75}.rightbar-wrap .copyright-wrap .hash-link[data-v-54a02510]{font-size:12px}.dark .hottopic-wrap[data-v-54a02510],.dark .copyright-wrap[data-v-54a02510]{background-color:#18181c}.sidebar-wrap{z-index:99;width:200px;height:100vh;position:fixed;right:calc(50% + var(--content-main) / 2 + 10px);padding:12px 0;box-sizing:border-box}.sidebar-wrap .n-menu .n-menu-item-content:before{border-radius:21px}.logo-wrap{display:flex;justify-content:flex-start;margin-bottom:12px}.logo-wrap .logo-img{margin-left:24px}.logo-wrap .logo-img:hover{cursor:pointer}.user-wrap{display:flex;align-items:center;position:absolute;bottom:12px;left:12px;right:12px}.user-wrap .user-mini-wrap{display:none}.user-wrap .user-avatar{margin-right:8px}.user-wrap .user-info{display:flex;flex-direction:column}.user-wrap .user-info .nickname{font-size:16px;font-weight:700;line-height:16px;height:16px;margin-bottom:2px;display:flex;align-items:center}.user-wrap .user-info .nickname .nickname-txt{max-width:90px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.user-wrap .user-info .nickname .logout{margin-left:6px}.user-wrap .user-info .username{font-size:14px;line-height:16px;height:16px;width:120px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;opacity:.75}.user-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.user-wrap .login-only-wrap button{margin:0 4px;width:80%}.user-wrap .login-wrap{display:flex;justify-content:center;width:100%}.user-wrap .login-wrap button{margin:0 4px}.auth-card .n-card-header{z-index:999}@media screen and (max-width: 821px){.sidebar-wrap{width:200px;right:calc(100% - 200px)}.logo-wrap .logo-img{margin-left:12px!important}.user-wrap .user-avatar,.user-wrap .user-info,.user-wrap .login-only-wrap,.user-wrap .login-wrap{margin-bottom:32px}}:root{--content-main: 544px}.app-container{margin:0}.app-container .app-wrap{width:100%;margin:0 auto}.main-wrap{min-height:100vh;display:flex;flex-direction:row;justify-content:center}.main-wrap .content-wrap{width:100%;max-width:var(--content-main);position:relative}.main-wrap .main-content-wrap{margin:0;border-top:none;border-radius:0}.main-wrap .main-content-wrap .n-list-item{padding:0}.empty-wrap{min-height:300px;display:flex;align-items:center;justify-content:center}.hash-link,.user-link{color:#18a058;text-decoration:none;cursor:pointer}.hash-link:hover,.user-link:hover{opacity:.8}.beian-link{color:#333;text-decoration:none}.beian-link:hover{opacity:.75}.username-link{color:#000;color:none;text-decoration:none;cursor:pointer}.username-link:hover{text-decoration:underline}.dark .hash-link,.dark .user-link{color:#63e2b7}.dark .username-link{color:#eee}.dark .beian-link{color:#ddd}@media screen and (max-width: 821px){.content-wrap{top:0;position:absolute!important}} diff --git a/web/dist/assets/index-cfa0bdbf.js b/web/dist/assets/index-cfa0bdbf.js new file mode 100644 index 00000000..9169bb53 --- /dev/null +++ b/web/dist/assets/index-cfa0bdbf.js @@ -0,0 +1 @@ +import{d as z,r as R,D as J,j,o as v,K as N,Y as a,a as k,L as o,c as T,e as S,P as K,Z as q,O as M,U as m,n as Q,w as H,_ as ae,F as Y,$ as Z,M as I,s as P,a0 as he,Q as X,a1 as ge,a2 as fe}from"./@vue-f70ab1bd.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-29025daf.js";import{c as ke,u as B}from"./vuex-cc1858c6.js";import{a as be}from"./axios-707ed124.js";import{_ as Pe,N as Oe,a as ue,b as ie,c as Le,d as Ae,e as ce,f as Te,g as Re,h as de,i as Ee,j as x,k as $e,u as Ce,l as Ie,m as Se,n as Me,o as Ue,p as Ke,q as qe,r as Ne,s as De,t as xe}from"./naive-ui-ddb574dd.js";import{S as Fe,M as Ve,L as ze,C as Be,B as We,P as He,W as je,a as Qe,H as ee,b as te,c as oe}from"./@vicons-2f3cb6b9.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))c(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const h of n.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function l(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function c(i){if(i.ep)return;i.ep=!0;const n=l(i);fetch(i.href,n)}})();const Ge="modulepreload",Je=function(e){return"/"+e},se={},A=function(t,l,c){if(!l||l.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Je(n),n in se)return;se[n]=!0;const h=n.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(!!c)for(let b=i.length-1;b>=0;b--){const _=i[b];if(_.href===n&&(!h||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":Ge,h||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),h)return new Promise((b,_)=>{g.addEventListener("load",b),g.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Ye=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-227299a1.js"),["assets/Home-227299a1.js","assets/post-item.vue_vue_type_style_index_0_lang-bc7656ee.js","assets/content-43b82f8f.js","assets/@vue-f70ab1bd.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/post-item-3a63e077.css","assets/post-skeleton-a79b6d6f.js","assets/post-skeleton-f1900002.css","assets/lodash-3329902d.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/IEnum-ea67d3af.js","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Home-47eb20e2.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"话题详情"},component:()=>A(()=>import("./Post-1eee200c.js"),["assets/Post-1eee200c.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/@vue-f70ab1bd.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/vuex-cc1858c6.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/@vicons-2f3cb6b9.js","assets/content-43b82f8f.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vue-router-29025daf.js","assets/post-skeleton-a79b6d6f.js","assets/post-skeleton-f1900002.css","assets/lodash-3329902d.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/IEnum-ea67d3af.js","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Post-03f1477b.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-e86f3eee.js"),["assets/Topic-e86f3eee.js","assets/@vicons-2f3cb6b9.js","assets/@vue-f70ab1bd.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Topic-8dbcebb5.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>A(()=>import("./Anouncement-c45d8cb5.js"),["assets/Anouncement-c45d8cb5.js","assets/post-skeleton-a79b6d6f.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/@vue-f70ab1bd.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/@vicons-2f3cb6b9.js","assets/main-nav-3ef9bae6.css","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/axios-707ed124.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>A(()=>import("./Profile-35bca462.js"),["assets/Profile-35bca462.js","assets/post-item.vue_vue_type_style_index_0_lang-bc7656ee.js","assets/content-43b82f8f.js","assets/@vue-f70ab1bd.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/post-item-3a63e077.css","assets/post-skeleton-a79b6d6f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Profile-5d71a5c2.css","assets/vfonts-7afd136d.css"])},{path:"/user",name:"user",meta:{title:"用户详情"},component:()=>A(()=>import("./User-50645c66.js"),["assets/User-50645c66.js","assets/post-item.vue_vue_type_style_index_0_lang-bc7656ee.js","assets/content-43b82f8f.js","assets/@vue-f70ab1bd.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/post-item-3a63e077.css","assets/post-skeleton-a79b6d6f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/User-4f525d0f.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>A(()=>import("./Messages-2ff8f262.js"),["assets/Messages-2ff8f262.js","assets/@vue-f70ab1bd.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/vuex-cc1858c6.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Messages-7ed31ecd.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>A(()=>import("./Collection-161cc0df.js"),["assets/Collection-161cc0df.js","assets/post-item.vue_vue_type_style_index_0_lang-bc7656ee.js","assets/content-43b82f8f.js","assets/@vue-f70ab1bd.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/post-item-3a63e077.css","assets/post-skeleton-a79b6d6f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Collection-e1365ea0.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>A(()=>import("./Contacts-0f2e935d.js"),["assets/Contacts-0f2e935d.js","assets/vue-router-29025daf.js","assets/@vue-f70ab1bd.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-a79b6d6f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/vuex-cc1858c6.js","assets/@vicons-2f3cb6b9.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Contacts-b60e5e0d.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>A(()=>import("./Wallet-6cbfa968.js"),["assets/Wallet-6cbfa968.js","assets/post-skeleton-a79b6d6f.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/@vue-f70ab1bd.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/@vicons-2f3cb6b9.js","assets/main-nav-3ef9bae6.css","assets/qrcode-23069ad7.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-59d11638.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/axios-707ed124.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>A(()=>import("./Setting-90459374.js"),["assets/Setting-90459374.js","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/vuex-cc1858c6.js","assets/@vue-f70ab1bd.js","assets/vue-router-29025daf.js","assets/vooks-dfdd6eef.js","assets/evtd-b614532e.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/@css-render-66126308.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>A(()=>import("./404-b496ccad.js"),["assets/404-b496ccad.js","assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js","assets/vuex-cc1858c6.js","assets/@vue-f70ab1bd.js","assets/vue-router-29025daf.js","assets/vooks-dfdd6eef.js","assets/evtd-b614532e.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/@css-render-66126308.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],pe=ve({history:we(),routes:Ye});pe.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Ze=ke({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",userLogined:!1,userInfo:{id:0,username:"",nickname:""}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:""},e.userLogined=!1}},actions:{},modules:{}}),G=be.create({baseURL:"",timeout:3e4});G.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));G.interceptors.response.use(e=>{const{data:t={},code:l=0}=(e==null?void 0:e.data)||{};if(+l==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var l;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((l=t==null?void 0:t.data)==null?void 0:l.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function s(e){return G(e)}const ne=e=>s({method:"post",url:"/v1/auth/login",data:e}),Xe=e=>s({method:"post",url:"/v1/auth/register",data:e}),W=(e="")=>s({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=z({__name:"auth",setup(e){const t=R("true".toLowerCase()==="true"),l=B(),c=R(!1),i=R(),n=J({username:"",password:""}),h=R(),d=J({username:"",password:"",repassword:""}),U={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=i.value)==null||u.validate(O=>{O||(c.value=!0,ne({username:n.username,password:n.password}).then(p=>{const r=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",r),W(r)}).then(p=>{window.$message.success("登录成功"),c.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),n.username="",n.password=""}).catch(p=>{c.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=h.value)==null||u.validate(O=>{O||(c.value=!0,Xe({username:d.username,password:d.password}).then(p=>ne({username:d.username,password:d.password})).then(p=>{const r=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",r),W(r)}).then(p=>{window.$message.success("注册成功"),c.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{c.value=!1}))})};return j(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?W(_).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(_,u)=>{const O=Pe,p=Oe,r=ue,w=ie,L=Le,y=Ae,$=ce,C=Te,D=Re,F=de,V=Ee;return v(),N(V,{show:m(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=f=>m(l).state.authModalShow=f),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[k("div",et,[o(F,{bordered:!1},{default:a(()=>[t.value?M("",!0):(v(),T("div",tt,[o(r,{justify:"center"},{default:a(()=>[o(p,null,{default:a(()=>[o(O,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),o(y,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(L,{label:"账户",path:"username"},{default:a(()=>[o(w,{value:n.username,"onUpdate:value":u[0]||(u[0]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(L,{label:"密码",path:"password"},{default:a(()=>[o(w,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o($,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),N(D,{key:1,"default-value":m(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[o(C,{name:"signin",tab:"登录"},{default:a(()=>[o(y,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(L,{label:"账户",path:"username"},{default:a(()=>[o(w,{value:n.username,"onUpdate:value":u[2]||(u[2]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(L,{label:"密码",path:"password"},{default:a(()=>[o(w,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o($,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),o(C,{name:"signup",tab:"注册"},{default:a(()=>[o(y,{ref_key:"registerRef",ref:h,model:d,rules:U},{default:a(()=>[o(L,{label:"用户名",path:"username"},{default:a(()=>[o(w,{value:d.username,"onUpdate:value":u[4]||(u[4]=f=>d.username=f),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),o(L,{label:"密码",path:"password"},{default:a(()=>[o(w,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=f=>d.password=f),onKeyup:K(q(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(L,{label:"重复密码",path:"repassword"},{default:a(()=>[o(w,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=f=>d.repassword=f),onKeyup:K(q(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o($,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:b},{default:a(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const me=(e,t)=>{const l=e.__vccOpts||e;for(const[c,i]of t)l[c]=i;return l},st=me(ot,[["__scopeId","data-v-52205ad0"]]),Yt=e=>s({method:"get",url:"/v1/posts",params:e}),nt=e=>s({method:"get",url:"/v1/tags",params:e}),Zt=e=>s({method:"get",url:"/v1/post",params:e}),Xt=e=>s({method:"get",url:"/v1/post/star",params:e}),eo=e=>s({method:"post",url:"/v1/post/star",data:e}),to=e=>s({method:"get",url:"/v1/post/collection",params:e}),oo=e=>s({method:"post",url:"/v1/post/collection",data:e}),so=e=>s({method:"get",url:"/v1/post/comments",params:e}),no=e=>s({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>s({method:"post",url:"/v1/post",data:e}),ao=e=>s({method:"delete",url:"/v1/post",data:e}),lo=e=>s({method:"post",url:"/v1/post/lock",data:e}),uo=e=>s({method:"post",url:"/v1/post/stick",data:e}),io=e=>s({method:"post",url:"/v1/post/visibility",data:e}),co=e=>s({method:"post",url:"/v1/post/comment",data:e}),po=e=>s({method:"delete",url:"/v1/post/comment",data:e}),mo=e=>s({method:"post",url:"/v1/post/comment/reply",data:e}),_o=e=>s({method:"delete",url:"/v1/post/comment/reply",data:e}),ho=e=>s({method:"post",url:"/v1/topic/stick",data:e}),go=e=>s({method:"post",url:"/v1/topic/follow",data:e}),fo=e=>s({method:"post",url:"/v1/topic/unfollow",data:e}),rt={key:0,class:"rightbar-wrap"},at={class:"search-wrap"},lt={class:"post-num"},ut={class:"post-num"},it={class:"copyright"},ct=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=R([]),l=R([]),c=R(!1),i=R(""),n=B(),h=le(),d="2023 paopao.info",U="Roc's Me",g="",b="泡泡(PaoPao)开源社区",_="https://www.paopao.info",u=+"6",O=+"12",p=()=>{c.value=!0,nt({type:"hot_extral",num:O,extral_num:u}).then(y=>{t.value=y.topics,l.value=y.extral_topics??[],L.value=!0,c.value=!1}).catch(y=>{c.value=!1})},r=y=>y>=1e3?(y/1e3).toFixed(1)+"k":y,w=()=>{h.push({name:"home",query:{q:i.value}})},L=Q({get:()=>n.state.userLogined&&l.value.length!==0,set:y=>{}});return H(()=>({refreshTopicFollow:n.state.refreshTopicFollow}),(y,$)=>{y.refreshTopicFollow!==$.refreshTopicFollow&&p()}),j(()=>{p()}),(y,$)=>{const C=x,D=ie,F=ae("router-link"),V=$e,f=de,_e=ue;return m(n).state.collapsedRight?M("",!0):(v(),T("div",rt,[k("div",at,[o(D,{round:"",clearable:"",placeholder:"搜一搜...",value:i.value,"onUpdate:value":$[0]||($[0]=E=>i.value=E),onKeyup:K(q(w,["prevent"]),["enter"])},{prefix:a(()=>[o(C,{component:m(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),m(L)?(v(),N(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:c.value},{default:a(()=>[(v(!0),T(Y,null,Z(l.value,E=>(v(),T("div",{class:"hot-tag-item",key:E.id},[o(F,{class:"hash-link",to:{name:"home",query:{q:E.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(E.tag),1)]),_:2},1032,["to"]),k("div",lt,I(r(E.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),o(f,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:c.value},{default:a(()=>[(v(!0),T(Y,null,Z(t.value,E=>(v(),T("div",{class:"hot-tag-item",key:E.id},[o(F,{class:"hash-link",to:{name:"home",query:{q:E.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(E.tag),1)]),_:2},1032,["to"]),k("div",ut,I(r(E.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),o(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",it,"© "+I(m(d)),1),k("div",null,[o(_e,null,{default:a(()=>[k("a",{href:m(g),target:"_blank",class:"hash-link"},I(m(U)),9,ct),k("a",{href:m(_),target:"_blank",class:"hash-link"},I(m(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=me(pt,[["__scopeId","data-v-54a02510"]]),vo=(e={})=>s({method:"get",url:"/v1/captcha",params:e}),wo=e=>s({method:"post",url:"/v1/captcha",data:e}),yo=e=>s({method:"post",url:"/v1/user/whisper",data:e}),ko=e=>s({method:"post",url:"/v1/friend/requesting",data:e}),bo=e=>s({method:"post",url:"/v1/friend/add",data:e}),Po=e=>s({method:"post",url:"/v1/friend/reject",data:e}),Oo=e=>s({method:"post",url:"/v1/friend/delete",data:e}),Lo=e=>s({method:"post",url:"/v1/user/phone",data:e}),Ao=e=>s({method:"post",url:"/v1/user/activate",data:e}),To=e=>s({method:"post",url:"/v1/user/password",data:e}),Ro=e=>s({method:"post",url:"/v1/user/nickname",data:e}),Eo=e=>s({method:"post",url:"/v1/user/avatar",data:e}),re=(e={})=>s({method:"get",url:"/v1/user/msgcount/unread",params:e}),$o=e=>s({method:"get",url:"/v1/user/messages",params:e}),Co=e=>s({method:"post",url:"/v1/user/message/read",data:e}),Io=e=>s({method:"get",url:"/v1/user/collections",params:e}),So=e=>s({method:"get",url:"/v1/user/profile",params:e}),Mo=e=>s({method:"get",url:"/v1/user/posts",params:e}),Uo=e=>s({method:"get",url:"/v1/user/wallet/bills",params:e}),Ko=e=>s({method:"post",url:"/v1/user/recharge",data:e}),qo=e=>s({method:"get",url:"/v1/user/recharge",params:e}),No=e=>s({method:"get",url:"/v1/suggest/users",params:e}),Do=e=>s({method:"get",url:"/v1/suggest/tags",params:e}),xo=e=>s({method:"get",url:"/v1/attachment/precheck",params:e}),Fo=e=>s({method:"get",url:"/v1/attachment",params:e}),Vo=e=>s({method:"post",url:"/v1/admin/user/status",data:e}),_t="/assets/logo-52afee68.png",ht={class:"sidebar-wrap"},gt={class:"logo-wrap"},ft={key:0,class:"user-wrap"},vt={class:"user-info"},wt={class:"nickname"},yt={class:"nickname-txt"},kt={class:"username"},bt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Ot={key:0,class:"login-only-wrap"},Lt={key:1,class:"login-wrap"},At=z({__name:"sidebar",setup(e){const t=B(),l=ye(),c=le(),i=R(!1),n=R(l.name||""),h=R(),d=R("true".toLowerCase()==="true");H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?h.value||(re().then(r=>{i.value=r.count>0}).catch(r=>{console.log(r)}),h.value=setInterval(()=>{re().then(r=>{i.value=r.count>0}).catch(r=>{console.log(r)})},5e3)):h.value&&clearInterval(h.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const U=Q(()=>{const r=[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}];return"false".toLowerCase()==="true"&&r.push({label:"公告",key:"anouncement",icon:()=>P(Ve),href:"/anouncement"}),r.push({label:"主页",key:"profile",icon:()=>P(ze),href:"/profile"}),r.push({label:"消息",key:"messages",icon:()=>P(Be),href:"/messages"}),r.push({label:"收藏",key:"collection",icon:()=>P(We),href:"/collection"}),r.push({label:"好友",key:"contacts",icon:()=>P(He),href:"/contacts"}),"false".toLocaleLowerCase()==="true"&&r.push({label:"钱包",key:"wallet",icon:()=>P(je),href:"/wallet"}),r.push({label:"设置",key:"setting",icon:()=>P(Qe),href:"/setting"}),t.state.userInfo.id>0?r:[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}]}),g=r=>"href"in r?P("div",{},r.label):r.label,b=r=>r.key==="messages"?P(Ie,{dot:!0,show:i.value,processing:!0},{default:()=>P(x,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(x,null,{default:r.icon}),_=(r,w={})=>{n.value=r,c.push({name:r})},u=()=>{l.path==="/"&&t.commit("refresh"),_("home")},O=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},p=()=>{t.commit("userLogout"),u()};return window.$store=t,window.$message=Ce(),(r,w)=>{const L=Se,y=Me,$=Ue,C=ce;return v(),T("div",ht,[k("div",gt,[o(L,{class:"logo-img",width:"36",src:m(_t),"preview-disabled":!0,onClick:u},null,8,["src"])]),o(y,{accordion:!0,"icon-size":24,options:m(U),"render-label":g,"render-icon":b,value:n.value,"onUpdate:value":_},null,8,["options","value"]),m(t).state.userInfo.id>0?(v(),T("div",ft,[o($,{class:"user-avatar",round:"",size:34,src:m(t).state.userInfo.avatar},null,8,["src"]),k("div",vt,[k("div",wt,[k("span",yt,I(m(t).state.userInfo.nickname),1),o(C,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:p},{icon:a(()=>[o(m(x),null,{default:a(()=>[o(m(oe))]),_:1})]),_:1})]),k("div",kt,"@"+I(m(t).state.userInfo.username),1)]),k("div",bt,[o(C,{class:"logout",quaternary:"",circle:"",onClick:p},{icon:a(()=>[o(m(x),{size:24},{default:a(()=>[o(m(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?M("",!0):(v(),T("div",Ot,[o(C,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=D=>O("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Lt,[o(C,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=D=>O("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),o(C,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=D=>O("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):M("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Rt={key:0},Et={class:"content-wrap"},$t=z({__name:"App",setup(e){const t=B(),l=Q(()=>t.state.theme==="dark"?qe:null);return(c,i)=>{const n=At,h=ae("router-view"),d=mt,U=st,g=Ne,b=De,_=xe,u=Ke;return v(),N(u,{theme:m(l)},{default:a(()=>[o(b,null,{default:a(()=>[o(g,null,{default:a(()=>{var O;return[k("div",{class:ge(["app-container",{dark:((O=m(l))==null?void 0:O.name)==="dark"}])},[k("div",Tt,[m(t).state.desktopModelShow?(v(),T("div",Rt,[o(n)])):M("",!0),k("div",Et,[o(h,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),N(he,null,[c.$route.meta.keepAlive?(v(),N(X(p),{key:0})):M("",!0)],1024)),c.$route.meta.keepAlive?M("",!0):(v(),N(X(p),{key:0}))]),_:1})]),o(d)]),o(U)],2)]}),_:1})]),_:1}),o(_)]),_:1},8,["theme"])}}});fe($t).use(pe).use(Ze).mount("#app");export{Oo as A,Vo as B,bo as C,Po as D,Co as E,$o as F,Io as G,xo as H,Fo as I,no as J,W as K,Uo as L,Ko as M,qo as N,vo as O,Eo as P,To as Q,Lo as R,Ao as S,Ro as T,wo as U,At as V,me as _,Do as a,Yt as b,ro as c,mo as d,_o as e,po as f,No as g,co as h,Xt as i,to as j,ao as k,lo as l,oo as m,Zt as n,so as o,eo as p,ho as q,go as r,uo as s,nt as t,fo as u,io as v,Mo as w,yo as x,ko as y,So as z}; diff --git a/web/dist/assets/index-f6017bc3.js b/web/dist/assets/index-f6017bc3.js deleted file mode 100644 index f8d7cabb..00000000 --- a/web/dist/assets/index-f6017bc3.js +++ /dev/null @@ -1 +0,0 @@ -import{d as F,r as T,D as G,j,o as w,K as D,Y as a,a as y,L as o,c as A,e as $,P as M,Z as q,O as C,U as h,n as H,w as W,_ as re,F as J,$ as Y,M as E,s as P,a0 as me,Q as Z,a1 as _e,a2 as he}from"./@vue-f70ab1bd.js";import{c as ge,a as fe,u as ae,b as ve}from"./vue-router-29025daf.js";import{c as we,u as V}from"./vuex-cc1858c6.js";import{a as ye}from"./axios-707ed124.js";import{_ as ke,N as be,a as le,b as ue,c as Pe,d as Oe,e as ce,f as Le,g as Ae,h as ie,i as Te,j as x,k as Re,u as Ee,l as $e,m as Ce,n as Ie,o as Se,p as Ue,q as Ke,r as Me,s as qe,t as De}from"./naive-ui-ddb574dd.js";import{S as Ne,M as xe,L as Fe,C as Ve,B as ze,P as Be,W as We,a as je,H as X,b as ee,c as te}from"./@vicons-2f3cb6b9.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const n of c)if(n.type==="childList")for(const f of n.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const n={};return c.integrity&&(n.integrity=c.integrity),c.referrerPolicy&&(n.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?n.credentials="include":c.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(c){if(c.ep)return;c.ep=!0;const n=l(c);fetch(c.href,n)}})();const He="modulepreload",Qe=function(e){return"/"+e},oe={},L=function(t,l,i){if(!l||l.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Qe(n),n in oe)return;oe[n]=!0;const f=n.endsWith(".css"),m=f?'[rel="stylesheet"]':"";if(!!i)for(let k=c.length-1;k>=0;k--){const g=c[k];if(g.href===n&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${m}`))return;const v=document.createElement("link");if(v.rel=f?"stylesheet":He,f||(v.as="script",v.crossOrigin=""),v.href=n,document.head.appendChild(v),f)return new Promise((k,g)=>{v.addEventListener("load",k),v.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Ge=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>L(()=>import("./Home-adef1ded.js"),["assets/Home-adef1ded.js","assets/post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js","assets/content-0b348d1e.js","assets/@vue-f70ab1bd.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/post-item-3a63e077.css","assets/post-skeleton-fdf95824.js","assets/post-skeleton-f1900002.css","assets/lodash-3329902d.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/IEnum-ea67d3af.js","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Home-47eb20e2.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"话题详情"},component:()=>L(()=>import("./Post-ea11be7c.js"),["assets/Post-ea11be7c.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/@vue-f70ab1bd.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/vuex-cc1858c6.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/@vicons-2f3cb6b9.js","assets/content-0b348d1e.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vue-router-29025daf.js","assets/post-skeleton-fdf95824.js","assets/post-skeleton-f1900002.css","assets/lodash-3329902d.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/IEnum-ea67d3af.js","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Post-03f1477b.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>L(()=>import("./Topic-7bd6ba6c.js"),["assets/Topic-7bd6ba6c.js","assets/@vicons-2f3cb6b9.js","assets/@vue-f70ab1bd.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Topic-8dbcebb5.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>L(()=>import("./Anouncement-1028ef75.js"),["assets/Anouncement-1028ef75.js","assets/post-skeleton-fdf95824.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/@vue-f70ab1bd.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/@vicons-2f3cb6b9.js","assets/main-nav-3ef9bae6.css","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/axios-707ed124.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>L(()=>import("./Profile-b16dccf8.js"),["assets/Profile-b16dccf8.js","assets/post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js","assets/content-0b348d1e.js","assets/@vue-f70ab1bd.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/post-item-3a63e077.css","assets/post-skeleton-fdf95824.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Profile-5d71a5c2.css","assets/vfonts-7afd136d.css"])},{path:"/user",name:"user",meta:{title:"用户详情"},component:()=>L(()=>import("./User-63f42059.js"),["assets/User-63f42059.js","assets/post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js","assets/content-0b348d1e.js","assets/@vue-f70ab1bd.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/post-item-3a63e077.css","assets/post-skeleton-fdf95824.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/User-4f525d0f.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>L(()=>import("./Messages-b6f6d433.js"),["assets/Messages-b6f6d433.js","assets/@vue-f70ab1bd.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/vuex-cc1858c6.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Messages-7ed31ecd.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>L(()=>import("./Collection-209a2041.js"),["assets/Collection-209a2041.js","assets/post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js","assets/content-0b348d1e.js","assets/@vue-f70ab1bd.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-29a967e9.js","assets/content-cc55174b.css","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/post-item-3a63e077.css","assets/post-skeleton-fdf95824.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Collection-e1365ea0.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>L(()=>import("./Contacts-d49a42ff.js"),["assets/Contacts-d49a42ff.js","assets/vue-router-29025daf.js","assets/@vue-f70ab1bd.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-fdf95824.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/vuex-cc1858c6.js","assets/@vicons-2f3cb6b9.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Contacts-b60e5e0d.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>L(()=>import("./Wallet-94982dc4.js"),["assets/Wallet-94982dc4.js","assets/post-skeleton-fdf95824.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/@vue-f70ab1bd.js","assets/vueuc-804c4158.js","assets/evtd-b614532e.js","assets/@css-render-66126308.js","assets/vooks-dfdd6eef.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/vuex-cc1858c6.js","assets/vue-router-29025daf.js","assets/@vicons-2f3cb6b9.js","assets/main-nav-3ef9bae6.css","assets/qrcode-23069ad7.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-59d11638.js","assets/formatTime-936c40eb.js","assets/moment-b7869f98.js","assets/axios-707ed124.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>L(()=>import("./Setting-6508bd8c.js"),["assets/Setting-6508bd8c.js","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/vuex-cc1858c6.js","assets/@vue-f70ab1bd.js","assets/vue-router-29025daf.js","assets/vooks-dfdd6eef.js","assets/evtd-b614532e.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/@css-render-66126308.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>L(()=>import("./404-74e48212.js"),["assets/404-74e48212.js","assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js","assets/vuex-cc1858c6.js","assets/@vue-f70ab1bd.js","assets/vue-router-29025daf.js","assets/vooks-dfdd6eef.js","assets/evtd-b614532e.js","assets/@vicons-2f3cb6b9.js","assets/naive-ui-ddb574dd.js","assets/seemly-76b7b838.js","assets/vueuc-804c4158.js","assets/@css-render-66126308.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],de=ge({history:fe(),routes:Ge});de.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Je=we({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",userLogined:!1,userInfo:{id:0,username:"",nickname:""}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:""},e.userLogined=!1}},actions:{},modules:{}}),Q=ye.create({baseURL:"",timeout:3e4});Q.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Q.interceptors.response.use(e=>{const{data:t={},code:l=0}=(e==null?void 0:e.data)||{};if(+l==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var l;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((l=t==null?void 0:t.data)==null?void 0:l.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function s(e){return Q(e)}const se=e=>s({method:"post",url:"/v1/auth/login",data:e}),Ye=e=>s({method:"post",url:"/v1/auth/register",data:e}),B=(e="")=>s({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),Ze={class:"auth-wrap"},Xe={key:0},et=F({__name:"auth",setup(e){const t=T("true".toLowerCase()==="true"),l=V(),i=T(!1),c=T(),n=G({username:"",password:""}),f=T(),m=G({username:"",password:"",repassword:""}),I={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(g,u)=>!!m.password&&m.password.startsWith(u)&&m.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},v=g=>{var u;g.preventDefault(),g.stopPropagation(),(u=c.value)==null||u.validate(b=>{b||(i.value=!0,se({username:n.username,password:n.password}).then(_=>{const r=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",r),B(r)}).then(_=>{window.$message.success("登录成功"),i.value=!1,l.commit("updateUserinfo",_),l.commit("triggerAuth",!1),n.username="",n.password=""}).catch(_=>{i.value=!1}))})},k=g=>{var u;g.preventDefault(),g.stopPropagation(),(u=f.value)==null||u.validate(b=>{b||(i.value=!0,Ye({username:m.username,password:m.password}).then(_=>se({username:m.username,password:m.password})).then(_=>{const r=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",r),B(r)}).then(_=>{window.$message.success("注册成功"),i.value=!1,l.commit("updateUserinfo",_),l.commit("triggerAuth",!1),m.username="",m.password="",m.repassword=""}).catch(_=>{i.value=!1}))})};return j(()=>{const g=localStorage.getItem("PAOPAO_TOKEN")||"";g?B(g).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(g,u)=>{const b=ke,_=be,r=le,d=ue,O=Pe,S=Oe,U=ce,R=Le,K=Ae,N=ie,z=Te;return w(),D(z,{show:h(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=p=>h(l).state.authModalShow=p),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[y("div",Ze,[o(N,{bordered:!1},{default:a(()=>[t.value?C("",!0):(w(),A("div",Xe,[o(r,{justify:"center"},{default:a(()=>[o(_,null,{default:a(()=>[o(b,{type:"success"},{default:a(()=>[$("账号登录")]),_:1})]),_:1})]),_:1}),o(S,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(O,{label:"账户",path:"username"},{default:a(()=>[o(d,{value:n.username,"onUpdate:value":u[0]||(u[0]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:M(q(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(O,{label:"密码",path:"password"},{default:a(()=>[o(d,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:M(q(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(U,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:v},{default:a(()=>[$(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),D(K,{key:1,"default-value":h(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[o(R,{name:"signin",tab:"登录"},{default:a(()=>[o(S,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(O,{label:"账户",path:"username"},{default:a(()=>[o(d,{value:n.username,"onUpdate:value":u[2]||(u[2]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:M(q(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(O,{label:"密码",path:"password"},{default:a(()=>[o(d,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:M(q(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(U,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:v},{default:a(()=>[$(" 登录 ")]),_:1},8,["loading"])]),_:1}),o(R,{name:"signup",tab:"注册"},{default:a(()=>[o(S,{ref_key:"registerRef",ref:f,model:m,rules:I},{default:a(()=>[o(O,{label:"用户名",path:"username"},{default:a(()=>[o(d,{value:m.username,"onUpdate:value":u[4]||(u[4]=p=>m.username=p),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),o(O,{label:"密码",path:"password"},{default:a(()=>[o(d,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:m.password,"onUpdate:value":u[5]||(u[5]=p=>m.password=p),onKeyup:M(q(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(O,{label:"重复密码",path:"repassword"},{default:a(()=>[o(d,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:m.repassword,"onUpdate:value":u[6]||(u[6]=p=>m.repassword=p),onKeyup:M(q(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(U,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:k},{default:a(()=>[$(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):C("",!0)]),_:1})])]),_:1},8,["show"])}}});const pe=(e,t)=>{const l=e.__vccOpts||e;for(const[i,c]of t)l[i]=c;return l},tt=pe(et,[["__scopeId","data-v-52205ad0"]]),Gt=e=>s({method:"get",url:"/v1/posts",params:e}),ot=e=>s({method:"get",url:"/v1/tags",params:e}),Jt=e=>s({method:"get",url:"/v1/post",params:e}),Yt=e=>s({method:"get",url:"/v1/post/star",params:e}),Zt=e=>s({method:"post",url:"/v1/post/star",data:e}),Xt=e=>s({method:"get",url:"/v1/post/collection",params:e}),eo=e=>s({method:"post",url:"/v1/post/collection",data:e}),to=e=>s({method:"get",url:"/v1/post/comments",params:e}),oo=e=>s({method:"get",url:"/v1/user/contacts",params:e}),so=e=>s({method:"post",url:"/v1/post",data:e}),no=e=>s({method:"delete",url:"/v1/post",data:e}),ro=e=>s({method:"post",url:"/v1/post/lock",data:e}),ao=e=>s({method:"post",url:"/v1/post/stick",data:e}),lo=e=>s({method:"post",url:"/v1/post/visibility",data:e}),uo=e=>s({method:"post",url:"/v1/post/comment",data:e}),co=e=>s({method:"delete",url:"/v1/post/comment",data:e}),io=e=>s({method:"post",url:"/v1/post/comment/reply",data:e}),po=e=>s({method:"delete",url:"/v1/post/comment/reply",data:e}),mo=e=>s({method:"post",url:"/v1/topic/stick",data:e}),_o=e=>s({method:"post",url:"/v1/topic/follow",data:e}),ho=e=>s({method:"post",url:"/v1/topic/unfollow",data:e}),st={key:0,class:"rightbar-wrap"},nt={class:"search-wrap"},rt={class:"post-num"},at={class:"post-num"},lt={class:"copyright"},ut=["href"],ct=["href"],it=F({__name:"rightbar",setup(e){const t=T([]),l=T([]),i=T(!1),c=T(""),n=V(),f=ae(),m="2023 paopao.info",I="Roc's Me",v="",k="泡泡(PaoPao)开源社区",g="https://www.paopao.info",u=()=>{i.value=!0,ot({type:"hot_extral",num:12,extral_num:8}).then(d=>{t.value=d.topics,l.value=d.extral_topics??[],r.value=!0,i.value=!1}).catch(d=>{i.value=!1})},b=d=>d>=1e3?(d/1e3).toFixed(1)+"k":d,_=()=>{f.push({name:"home",query:{q:c.value}})},r=H({get:()=>n.state.userLogined&&l.value.length!==0,set:d=>{}});return W(()=>({refreshTopicFollow:n.state.refreshTopicFollow}),(d,O)=>{d.refreshTopicFollow!==O.refreshTopicFollow&&u()}),j(()=>{u()}),(d,O)=>{const S=x,U=ue,R=re("router-link"),K=Re,N=ie,z=le;return h(n).state.collapsedRight?C("",!0):(w(),A("div",st,[y("div",nt,[o(U,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":O[0]||(O[0]=p=>c.value=p),onKeyup:M(q(_,["prevent"]),["enter"])},{prefix:a(()=>[o(S,{component:h(Ne)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),h(r)?(w(),D(N,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(K,{show:i.value},{default:a(()=>[(w(!0),A(J,null,Y(l.value,p=>(w(),A("div",{class:"hot-tag-item",key:p.id},[o(R,{class:"hash-link",to:{name:"home",query:{q:p.tag,t:"tag"}}},{default:a(()=>[$(" #"+E(p.tag),1)]),_:2},1032,["to"]),y("div",rt,E(b(p.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):C("",!0),o(N,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(K,{show:i.value},{default:a(()=>[(w(!0),A(J,null,Y(t.value,p=>(w(),A("div",{class:"hot-tag-item",key:p.id},[o(R,{class:"hash-link",to:{name:"home",query:{q:p.tag,t:"tag"}}},{default:a(()=>[$(" #"+E(p.tag),1)]),_:2},1032,["to"]),y("div",at,E(b(p.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),o(N,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[y("div",lt,"© "+E(h(m)),1),y("div",null,[o(z,null,{default:a(()=>[y("a",{href:h(v),target:"_blank",class:"hash-link"},E(h(I)),9,ut),y("a",{href:h(g),target:"_blank",class:"hash-link"},E(h(k)),9,ct)]),_:1})])]),_:1})]))}}});const dt=pe(it,[["__scopeId","data-v-200967dd"]]),go=(e={})=>s({method:"get",url:"/v1/captcha",params:e}),fo=e=>s({method:"post",url:"/v1/captcha",data:e}),vo=e=>s({method:"post",url:"/v1/user/whisper",data:e}),wo=e=>s({method:"post",url:"/v1/friend/requesting",data:e}),yo=e=>s({method:"post",url:"/v1/friend/add",data:e}),ko=e=>s({method:"post",url:"/v1/friend/reject",data:e}),bo=e=>s({method:"post",url:"/v1/friend/delete",data:e}),Po=e=>s({method:"post",url:"/v1/user/phone",data:e}),Oo=e=>s({method:"post",url:"/v1/user/activate",data:e}),Lo=e=>s({method:"post",url:"/v1/user/password",data:e}),Ao=e=>s({method:"post",url:"/v1/user/nickname",data:e}),To=e=>s({method:"post",url:"/v1/user/avatar",data:e}),ne=(e={})=>s({method:"get",url:"/v1/user/msgcount/unread",params:e}),Ro=e=>s({method:"get",url:"/v1/user/messages",params:e}),Eo=e=>s({method:"post",url:"/v1/user/message/read",data:e}),$o=e=>s({method:"get",url:"/v1/user/collections",params:e}),Co=e=>s({method:"get",url:"/v1/user/profile",params:e}),Io=e=>s({method:"get",url:"/v1/user/posts",params:e}),So=e=>s({method:"get",url:"/v1/user/wallet/bills",params:e}),Uo=e=>s({method:"post",url:"/v1/user/recharge",data:e}),Ko=e=>s({method:"get",url:"/v1/user/recharge",params:e}),Mo=e=>s({method:"get",url:"/v1/suggest/users",params:e}),qo=e=>s({method:"get",url:"/v1/suggest/tags",params:e}),Do=e=>s({method:"get",url:"/v1/attachment/precheck",params:e}),No=e=>s({method:"get",url:"/v1/attachment",params:e}),xo=e=>s({method:"post",url:"/v1/admin/user/status",data:e}),pt="/assets/logo-52afee68.png",mt={class:"sidebar-wrap"},_t={class:"logo-wrap"},ht={key:0,class:"user-wrap"},gt={class:"user-info"},ft={class:"nickname"},vt={class:"nickname-txt"},wt={class:"username"},yt={class:"user-mini-wrap"},kt={key:1,class:"user-wrap"},bt={key:0,class:"login-only-wrap"},Pt={key:1,class:"login-wrap"},Ot=F({__name:"sidebar",setup(e){const t=V(),l=ve(),i=ae(),c=T(!1),n=T(l.name||""),f=T(),m=T("true".toLowerCase()==="true");W(l,()=>{n.value=l.name}),W(t.state,()=>{t.state.userInfo.id>0?f.value||(ne().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)}),f.value=setInterval(()=>{ne().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)})},5e3)):f.value&&clearInterval(f.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const I=H(()=>{const r=[{label:"广场",key:"home",icon:()=>P(X),href:"/"},{label:"话题",key:"topic",icon:()=>P(ee),href:"/topic"}];return"false".toLowerCase()==="true"&&r.push({label:"公告",key:"anouncement",icon:()=>P(xe),href:"/anouncement"}),r.push({label:"主页",key:"profile",icon:()=>P(Fe),href:"/profile"}),r.push({label:"消息",key:"messages",icon:()=>P(Ve),href:"/messages"}),r.push({label:"收藏",key:"collection",icon:()=>P(ze),href:"/collection"}),r.push({label:"好友",key:"contacts",icon:()=>P(Be),href:"/contacts"}),"false".toLocaleLowerCase()==="true"&&r.push({label:"钱包",key:"wallet",icon:()=>P(We),href:"/wallet"}),r.push({label:"设置",key:"setting",icon:()=>P(je),href:"/setting"}),t.state.userInfo.id>0?r:[{label:"广场",key:"home",icon:()=>P(X),href:"/"},{label:"话题",key:"topic",icon:()=>P(ee),href:"/topic"}]}),v=r=>"href"in r?P("div",{},r.label):r.label,k=r=>r.key==="messages"?P($e,{dot:!0,show:c.value,processing:!0},{default:()=>P(x,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(x,null,{default:r.icon}),g=(r,d={})=>{n.value=r,i.push({name:r})},u=()=>{l.path==="/"&&t.commit("refresh"),g("home")},b=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},_=()=>{t.commit("userLogout"),u()};return window.$store=t,window.$message=Ee(),(r,d)=>{const O=Ce,S=Ie,U=Se,R=ce;return w(),A("div",mt,[y("div",_t,[o(O,{class:"logo-img",width:"36",src:h(pt),"preview-disabled":!0,onClick:u},null,8,["src"])]),o(S,{accordion:!0,"icon-size":24,options:h(I),"render-label":v,"render-icon":k,value:n.value,"onUpdate:value":g},null,8,["options","value"]),h(t).state.userInfo.id>0?(w(),A("div",ht,[o(U,{class:"user-avatar",round:"",size:34,src:h(t).state.userInfo.avatar},null,8,["src"]),y("div",gt,[y("div",ft,[y("span",vt,E(h(t).state.userInfo.nickname),1),o(R,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:_},{icon:a(()=>[o(h(x),null,{default:a(()=>[o(h(te))]),_:1})]),_:1})]),y("div",wt,"@"+E(h(t).state.userInfo.username),1)]),y("div",yt,[o(R,{class:"logout",quaternary:"",circle:"",onClick:_},{icon:a(()=>[o(h(x),{size:24},{default:a(()=>[o(h(te))]),_:1})]),_:1})])])):(w(),A("div",kt,[m.value?C("",!0):(w(),A("div",bt,[o(R,{strong:"",secondary:"",round:"",type:"primary",onClick:d[0]||(d[0]=K=>b("signin"))},{default:a(()=>[$(" 登录 ")]),_:1})])),m.value?(w(),A("div",Pt,[o(R,{strong:"",secondary:"",round:"",type:"primary",onClick:d[1]||(d[1]=K=>b("signin"))},{default:a(()=>[$(" 登录 ")]),_:1}),o(R,{strong:"",secondary:"",round:"",type:"info",onClick:d[2]||(d[2]=K=>b("signup"))},{default:a(()=>[$(" 注册 ")]),_:1})])):C("",!0)]))])}}});const Lt={"has-sider":"",class:"main-wrap",position:"static"},At={key:0},Tt={class:"content-wrap"},Rt=F({__name:"App",setup(e){const t=V(),l=H(()=>t.state.theme==="dark"?Ke:null);return(i,c)=>{const n=Ot,f=re("router-view"),m=dt,I=tt,v=Me,k=qe,g=De,u=Ue;return w(),D(u,{theme:h(l)},{default:a(()=>[o(k,null,{default:a(()=>[o(v,null,{default:a(()=>{var b;return[y("div",{class:_e(["app-container",{dark:((b=h(l))==null?void 0:b.name)==="dark"}])},[y("div",Lt,[h(t).state.desktopModelShow?(w(),A("div",At,[o(n)])):C("",!0),y("div",Tt,[o(f,{class:"app-wrap"},{default:a(({Component:_})=>[(w(),D(me,null,[i.$route.meta.keepAlive?(w(),D(Z(_),{key:0})):C("",!0)],1024)),i.$route.meta.keepAlive?C("",!0):(w(),D(Z(_),{key:0}))]),_:1})]),o(m)]),o(I)],2)]}),_:1})]),_:1}),o(g)]),_:1},8,["theme"])}}});he(Rt).use(de).use(Je).mount("#app");export{bo as A,xo as B,yo as C,ko as D,Eo as E,Ro as F,$o as G,Do as H,No as I,oo as J,B as K,So as L,Uo as M,Ko as N,go as O,To as P,Lo as Q,Po as R,Oo as S,Ao as T,fo as U,Ot as V,pe as _,qo as a,Gt as b,so as c,io as d,po as e,co as f,Mo as g,uo as h,Yt as i,Xt as j,no as k,ro as l,eo as m,Jt as n,to as o,Zt as p,mo as q,_o as r,ao as s,ot as t,ho as u,lo as v,Io as w,vo as x,wo as y,Co as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js index 57b56f7d..34bd57a4 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-5f0e81a4.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-5681167a.js @@ -1 +1 @@ -import{V as E}from"./index-f6017bc3.js";import{u as S}from"./vuex-cc1858c6.js";import{u as z}from"./vue-router-29025daf.js";import{j as A}from"./vooks-dfdd6eef.js";import{D as C,u as D,v as N,w as P}from"./@vicons-2f3cb6b9.js";import{a3 as x,a4 as R,j as V,e as I,a5 as j,h as H}from"./naive-ui-ddb574dd.js";import{d as L,r as f,j as U,o as a,c as g,U as o,L as e,Y as t,O as c,a as q,K as _,e as F,M as $,F as K}from"./@vue-f70ab1bd.js";const Y={key:0},G={class:"navbar"},oe=L({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(r){const i=r,n=S(),m=z(),l=f(!1),k=f("left"),u=d=>{d?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return U(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(d,p)=>{const y=E,b=x,O=R,s=V,h=I,M=j,T=H;return a(),g(K,null,[o(n).state.drawerModelShow?(a(),g("div",Y,[e(O,{show:l.value,"onUpdate:show":p[0]||(p[0]=B=>l.value=B),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[q("div",G,[o(n).state.drawerModelShow&&!r.back?(a(),_(h,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),r.back?(a(),_(h,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(D))]),_:1})]),_:1})):c("",!0),F(" "+$(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(s,{component:o(N)},null,8,["component"])]),"unchecked-icon":t(()=>[e(s,{component:o(P)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; +import{V as E}from"./index-cfa0bdbf.js";import{u as S}from"./vuex-cc1858c6.js";import{u as z}from"./vue-router-29025daf.js";import{j as A}from"./vooks-dfdd6eef.js";import{D as C,u as D,v as N,w as P}from"./@vicons-2f3cb6b9.js";import{a3 as x,a4 as R,j as V,e as I,a5 as j,h as H}from"./naive-ui-ddb574dd.js";import{d as L,r as f,j as U,o as a,c as g,U as o,L as e,Y as t,O as c,a as q,K as _,e as F,M as $,F as K}from"./@vue-f70ab1bd.js";const Y={key:0},G={class:"navbar"},oe=L({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(r){const i=r,n=S(),m=z(),l=f(!1),k=f("left"),u=d=>{d?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return U(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(d,p)=>{const y=E,b=x,O=R,s=V,h=I,M=j,T=H;return a(),g(K,null,[o(n).state.drawerModelShow?(a(),g("div",Y,[e(O,{show:l.value,"onUpdate:show":p[0]||(p[0]=B=>l.value=B),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[q("div",G,[o(n).state.drawerModelShow&&!r.back?(a(),_(h,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),r.back?(a(),_(h,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(D))]),_:1})]),_:1})):c("",!0),F(" "+$(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(s,{component:o(N)},null,8,["component"])]),"unchecked-icon":t(()=>[e(s,{component:o(P)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-bc7656ee.js similarity index 96% rename from web/dist/assets/post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js rename to web/dist/assets/post-item.vue_vue_type_style_index_0_lang-bc7656ee.js index 321ebe21..21fc50a2 100644 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-c48fe5cf.js +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-bc7656ee.js @@ -1 +1 @@ -import{p as N,a as S,_ as $,b as V,c as j}from"./content-0b348d1e.js";import{d as H,n as R,_ as D,o as i,c as f,L as a,a3 as F,U as t,Y as n,F as I,$ as P,Z as v,a as l,e as r,M as c,K as p,O as _}from"./@vue-f70ab1bd.js";import{u as E}from"./vuex-cc1858c6.js";import{b as K,u as U}from"./vue-router-29025daf.js";import{a as Y}from"./formatTime-936c40eb.js";import{f as Z,h as A,i as G,k as J}from"./@vicons-2f3cb6b9.js";import{o as Q,M as W,j as X,a as tt,L as et}from"./naive-ui-ddb574dd.js";const st={class:"nickname-wrap"},nt={class:"username-wrap"},ot={class:"timestamp"},at=["innerHTML"],it={class:"opt-item"},rt={class:"opt-item"},ct={class:"opt-item"},pt={class:"opt-item"},ft=H({__name:"post-item",props:{post:null},setup(x){const C=x;K();const d=U(),z=E(),e=R(()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},C.post);return o.contents.map(s=>{(+s.type==1||+s.type==2)&&o.texts.push(s),+s.type==3&&o.imgs.push(s),+s.type==4&&o.videos.push(s),+s.type==6&&o.links.push(s),+s.type==7&&o.attachments.push(s),+s.type==8&&o.charge_attachments.push(s)}),o}),k=o=>{d.push({name:"post",query:{id:o}})},b=(o,s)=>{if(o.target.dataset.detail){const m=o.target.dataset.detail.split(":");if(m.length===2){z.commit("refresh"),m[0]==="tag"?d.push({name:"home",query:{q:m[1],t:"tag"}}):d.push({name:"user",query:{username:m[1]}});return}}k(s)};return(o,s)=>{const m=Q,w=D("router-link"),h=W,y=S,O=$,T=V,q=j,u=X,B=tt,L=et;return i(),f("div",{class:"post-item",onClick:s[2]||(s[2]=g=>k(t(e).id))},[a(L,{"content-indented":""},F({avatar:n(()=>[a(m,{round:"",size:30,src:t(e).user.avatar},null,8,["src"])]),header:n(()=>[l("span",st,[a(w,{onClick:s[0]||(s[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(e).user.username}}},{default:n(()=>[r(c(t(e).user.nickname),1)]),_:1},8,["to"])]),l("span",nt," @"+c(t(e).user.username),1),t(e).is_top?(i(),p(h,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[r(" 置顶 ")]),_:1})):_("",!0),t(e).visibility==1?(i(),p(h,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[r(" 私密 ")]),_:1})):_("",!0),t(e).visibility==2?(i(),p(h,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[r(" 好友可见 ")]),_:1})):_("",!0)]),"header-extra":n(()=>[l("span",ot,c(t(e).ip_loc?t(e).ip_loc+" · ":t(e).ip_loc)+" "+c(t(Y)(t(e).created_on)),1)]),footer:n(()=>[t(e).attachments.length>0?(i(),p(y,{key:0,attachments:t(e).attachments},null,8,["attachments"])):_("",!0),t(e).charge_attachments.length>0?(i(),p(y,{key:1,attachments:t(e).charge_attachments,price:t(e).attachment_price},null,8,["attachments","price"])):_("",!0),t(e).imgs.length>0?(i(),p(O,{key:2,imgs:t(e).imgs},null,8,["imgs"])):_("",!0),t(e).videos.length>0?(i(),p(T,{key:3,videos:t(e).videos},null,8,["videos"])):_("",!0),t(e).links.length>0?(i(),p(q,{key:4,links:t(e).links},null,8,["links"])):_("",!0)]),action:n(()=>[a(B,{justify:"space-between"},{default:n(()=>[l("div",it,[a(u,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(Z))]),_:1}),r(" "+c(t(e).upvote_count),1)]),l("div",rt,[a(u,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(A))]),_:1}),r(" "+c(t(e).comment_count),1)]),l("div",ct,[a(u,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(G))]),_:1}),r(" "+c(t(e).collection_count),1)]),l("div",pt,[a(u,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(J))]),_:1}),r(" "+c(t(e).share_count),1)])]),_:1})]),_:2},[t(e).texts.length>0?{name:"description",fn:n(()=>[(i(!0),f(I,null,P(t(e).texts,g=>(i(),f("span",{key:g.id,class:"post-text",onClick:s[1]||(s[1]=v(M=>b(M,t(e).id),["stop"])),innerHTML:t(N)(g.content).content},null,8,at))),128))]),key:"0"}:void 0]),1024)])}}});export{ft as _}; +import{p as N,a as S,_ as $,b as V,c as j}from"./content-43b82f8f.js";import{d as H,n as R,_ as D,o as i,c as f,L as a,a3 as F,U as t,Y as n,F as I,$ as P,Z as v,a as l,e as r,M as c,K as p,O as _}from"./@vue-f70ab1bd.js";import{u as E}from"./vuex-cc1858c6.js";import{b as K,u as U}from"./vue-router-29025daf.js";import{a as Y}from"./formatTime-936c40eb.js";import{f as Z,h as A,i as G,k as J}from"./@vicons-2f3cb6b9.js";import{o as Q,M as W,j as X,a as tt,L as et}from"./naive-ui-ddb574dd.js";const st={class:"nickname-wrap"},nt={class:"username-wrap"},ot={class:"timestamp"},at=["innerHTML"],it={class:"opt-item"},rt={class:"opt-item"},ct={class:"opt-item"},pt={class:"opt-item"},ft=H({__name:"post-item",props:{post:null},setup(x){const C=x;K();const d=U(),z=E(),e=R(()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},C.post);return o.contents.map(s=>{(+s.type==1||+s.type==2)&&o.texts.push(s),+s.type==3&&o.imgs.push(s),+s.type==4&&o.videos.push(s),+s.type==6&&o.links.push(s),+s.type==7&&o.attachments.push(s),+s.type==8&&o.charge_attachments.push(s)}),o}),k=o=>{d.push({name:"post",query:{id:o}})},b=(o,s)=>{if(o.target.dataset.detail){const m=o.target.dataset.detail.split(":");if(m.length===2){z.commit("refresh"),m[0]==="tag"?d.push({name:"home",query:{q:m[1],t:"tag"}}):d.push({name:"user",query:{username:m[1]}});return}}k(s)};return(o,s)=>{const m=Q,w=D("router-link"),h=W,y=S,O=$,T=V,q=j,u=X,B=tt,L=et;return i(),f("div",{class:"post-item",onClick:s[2]||(s[2]=g=>k(t(e).id))},[a(L,{"content-indented":""},F({avatar:n(()=>[a(m,{round:"",size:30,src:t(e).user.avatar},null,8,["src"])]),header:n(()=>[l("span",st,[a(w,{onClick:s[0]||(s[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(e).user.username}}},{default:n(()=>[r(c(t(e).user.nickname),1)]),_:1},8,["to"])]),l("span",nt," @"+c(t(e).user.username),1),t(e).is_top?(i(),p(h,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[r(" 置顶 ")]),_:1})):_("",!0),t(e).visibility==1?(i(),p(h,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[r(" 私密 ")]),_:1})):_("",!0),t(e).visibility==2?(i(),p(h,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[r(" 好友可见 ")]),_:1})):_("",!0)]),"header-extra":n(()=>[l("span",ot,c(t(e).ip_loc?t(e).ip_loc+" · ":t(e).ip_loc)+" "+c(t(Y)(t(e).created_on)),1)]),footer:n(()=>[t(e).attachments.length>0?(i(),p(y,{key:0,attachments:t(e).attachments},null,8,["attachments"])):_("",!0),t(e).charge_attachments.length>0?(i(),p(y,{key:1,attachments:t(e).charge_attachments,price:t(e).attachment_price},null,8,["attachments","price"])):_("",!0),t(e).imgs.length>0?(i(),p(O,{key:2,imgs:t(e).imgs},null,8,["imgs"])):_("",!0),t(e).videos.length>0?(i(),p(T,{key:3,videos:t(e).videos},null,8,["videos"])):_("",!0),t(e).links.length>0?(i(),p(q,{key:4,links:t(e).links},null,8,["links"])):_("",!0)]),action:n(()=>[a(B,{justify:"space-between"},{default:n(()=>[l("div",it,[a(u,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(Z))]),_:1}),r(" "+c(t(e).upvote_count),1)]),l("div",rt,[a(u,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(A))]),_:1}),r(" "+c(t(e).comment_count),1)]),l("div",ct,[a(u,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(G))]),_:1}),r(" "+c(t(e).collection_count),1)]),l("div",pt,[a(u,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(J))]),_:1}),r(" "+c(t(e).share_count),1)])]),_:1})]),_:2},[t(e).texts.length>0?{name:"description",fn:n(()=>[(i(!0),f(I,null,P(t(e).texts,g=>(i(),f("span",{key:g.id,class:"post-text",onClick:s[1]||(s[1]=v(M=>b(M,t(e).id),["stop"])),innerHTML:t(N)(g.content).content},null,8,at))),128))]),key:"0"}:void 0]),1024)])}}});export{ft as _}; diff --git a/web/dist/assets/post-skeleton-fdf95824.js b/web/dist/assets/post-skeleton-a79b6d6f.js similarity index 88% rename from web/dist/assets/post-skeleton-fdf95824.js rename to web/dist/assets/post-skeleton-a79b6d6f.js index dbae81ee..83b83c7b 100644 --- a/web/dist/assets/post-skeleton-fdf95824.js +++ b/web/dist/assets/post-skeleton-a79b6d6f.js @@ -1 +1 @@ -import{U as c}from"./naive-ui-ddb574dd.js";import{d as r,o as s,c as n,$ as l,a as o,L as t,F as p}from"./@vue-f70ab1bd.js";import{_ as i}from"./index-f6017bc3.js";const m={class:"user"},d={class:"content"},u=r({__name:"post-skeleton",props:{num:{default:1}},setup(_){return(f,k)=>{const e=c;return s(!0),n(p,null,l(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; +import{U as c}from"./naive-ui-ddb574dd.js";import{d as r,o as s,c as n,$ as l,a as o,L as t,F as p}from"./@vue-f70ab1bd.js";import{_ as i}from"./index-cfa0bdbf.js";const m={class:"user"},d={class:"content"},u=r({__name:"post-skeleton",props:{num:{default:1}},setup(_){return(f,k)=>{const e=c;return s(!0),n(p,null,l(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/index.html b/web/dist/index.html index 35b71f4c..e0db4122 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + @@ -28,7 +28,7 @@ - + diff --git a/web/src/components/rightbar.vue b/web/src/components/rightbar.vue index 3a4d6a43..d1ac922f 100644 --- a/web/src/components/rightbar.vue +++ b/web/src/components/rightbar.vue @@ -99,13 +99,15 @@ const copyrightLeft = import.meta.env.VITE_COPYRIGHT_LEFT const copyrightLeftLink = import.meta.env.VITE_COPYRIGHT_LEFT_LINK const copyrightRight = import.meta.env.VITE_COPYRIGHT_RIGHT const copyrightRightLink = import.meta.env.VITE_COPYRIGHT_RIGHT_LINK +const rightFollowTopicMaxSize = Number(import.meta.env.VITE_RIGHT_FOLLOW_TOPIC_MAX_SIZE) +const rightHotTopicMaxSize = Number(import.meta.env.VITE_RIGHT_HOT_TOPIC_MAX_SIZE) const loadHotTags = () => { loading.value = true; getTags({ type: 'hot_extral', - num: 12, - extral_num: 8, + num: rightHotTopicMaxSize, + extral_num: rightFollowTopicMaxSize, }) .then((res) => { hotTags.value = res.topics; diff --git a/web/src/vite-env.d.ts b/web/src/vite-env.d.ts index a7eaba84..6f387fc3 100644 --- a/web/src/vite-env.d.ts +++ b/web/src/vite-env.d.ts @@ -19,6 +19,8 @@ interface ImportMetaEnv { readonly VITE_DEFAULT_TWEET_VISIBILITY: string; readonly VITE_DEFAULT_TWEET_IMAGE_404: string; readonly VITE_TWEET_IMAGE_THUMBNAIL: string; + readonly VITE_RIGHT_FOLLOW_TOPIC_MAX_SIZE: number; + readonly VITE_RIGHT_HOT_TOPIC_MAX_SIZE: number; readonly VITE_COPYRIGHT_TOP: string; readonly VITE_COPYRIGHT_LEFT: string; readonly VITE_COPYRIGHT_LEFT_LINK: string;