diff --git a/web/dist/assets/404-35be31b4.js b/web/dist/assets/404-3e96b6c8.js similarity index 84% rename from web/dist/assets/404-35be31b4.js rename to web/dist/assets/404-3e96b6c8.js index 575357a3..8cfb4860 100644 --- a/web/dist/assets/404-35be31b4.js +++ b/web/dist/assets/404-3e96b6c8.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{u as a}from"./vue-router-88cc84d1.js";import{F as i,e as c,a2 as u}from"./naive-ui-2035804c.js";import{d as l,c as d,L as t,$ as o,o as f,e as x}from"./@vue-ca177dbe.js";import{_ as g}from"./index-f400f811.js";import"./vuex-d28e9067.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-6d35273b.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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-4a70c6fc.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 M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{u as a}from"./vue-router-88cc84d1.js";import{F as i,e as c,a2 as u}from"./naive-ui-2035804c.js";import{d as l,c as d,L as t,$ as o,o as f,e as x}from"./@vue-ca177dbe.js";import{_ as g}from"./index-effb87c4.js";import"./vuex-d28e9067.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-6d35273b.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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-4a70c6fc.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 M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; diff --git a/web/dist/assets/Anouncement-9495a781.js b/web/dist/assets/Anouncement-97cee4d9.js similarity index 91% rename from web/dist/assets/Anouncement-9495a781.js rename to web/dist/assets/Anouncement-97cee4d9.js index 7b6c9e13..f6983b9b 100644 --- a/web/dist/assets/Anouncement-9495a781.js +++ b/web/dist/assets/Anouncement-97cee4d9.js @@ -1 +1 @@ -import{_ as F}from"./post-skeleton-78c5cb50.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{u as z}from"./vuex-d28e9067.js";import{b as A}from"./vue-router-88cc84d1.js";import{a as R}from"./formatTime-000dbebb.js";import{d as S,r as n,j as V,c as o,L as a,$ as p,o as e,Y as u,O as l,F as I,a2 as L,K as M,a as s,M as _,a4 as O}from"./@vue-ca177dbe.js";import{F as P,G as $,I as j,H as q}from"./naive-ui-2035804c.js";import{_ as D}from"./index-f400f811.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-6d35273b.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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-4a70c6fc.js";/* empty css */const E={key:0,class:"pagination-wrap"},G={key:0,class:"skeleton-wrap"},H={key:1},K={key:0,class:"empty-wrap"},T={class:"bill-line"},U=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=$,x=F,w=j,B=q,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",E,[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",G,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",H,[r.value.length===0?(e(),o("div",K,[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",T,[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=D(U,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; +import{_ as F}from"./post-skeleton-6893dc8f.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{u as z}from"./vuex-d28e9067.js";import{b as A}from"./vue-router-88cc84d1.js";import{a as R}from"./formatTime-000dbebb.js";import{d as S,r as n,j as V,c as o,L as a,$ as p,o as e,Y as u,O as l,F as I,a2 as L,K as M,a as s,M as _,a4 as O}from"./@vue-ca177dbe.js";import{F as P,G as $,I as j,H as q}from"./naive-ui-2035804c.js";import{_ as D}from"./index-effb87c4.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-6d35273b.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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-4a70c6fc.js";/* empty css */const E={key:0,class:"pagination-wrap"},G={key:0,class:"skeleton-wrap"},H={key:1},K={key:0,class:"empty-wrap"},T={class:"bill-line"},U=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=$,x=F,w=j,B=q,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",E,[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",G,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",H,[r.value.length===0?(e(),o("div",K,[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",T,[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=D(U,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; diff --git a/web/dist/assets/Collection-40445a32.js b/web/dist/assets/Collection-f016c683.js similarity index 89% rename from web/dist/assets/Collection-40445a32.js rename to web/dist/assets/Collection-f016c683.js index e2ba30da..9f00e422 100644 --- a/web/dist/assets/Collection-40445a32.js +++ b/web/dist/assets/Collection-f016c683.js @@ -1 +1 @@ -import{_ as M,a as P}from"./post-item.vue_vue_type_style_index_0_lang-a8faecc0.js";import{_ as S}from"./post-skeleton-78c5cb50.js";import{_ as I}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{u as K}from"./vuex-d28e9067.js";import{b as L}from"./vue-router-88cc84d1.js";import{K as N,_ as R}from"./index-f400f811.js";import{d as V,r as a,j,c as o,L as e,$ as c,Y as g,O as v,o as t,F as f,a2 as h,K as k}from"./@vue-ca177dbe.js";import{F as q,G as E,I as G,H}from"./naive-ui-2035804c.js";import"./content-b7753a95.js";import"./@vicons-6d35273b.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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={key:0,class:"skeleton-wrap"},T={key:1},U={key:0,class:"empty-wrap"},Y={key:1},A={key:2},D={key:0,class:"pagination-wrap"},J=V({__name:"Collection",setup(Q){const m=K(),y=L(),_=a(!1),i=a([]),p=a(+y.query.p||1),l=a(20),r=a(0),u=()=>{_.value=!0,N({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return j(()=>{u()}),(n,W)=>{const C=I,b=S,x=G,$=M,d=H,z=P,B=q,F=E;return t(),o("div",null,[e(C,{title:"收藏"}),e(B,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",O,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",U,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",Y,[(t(!0),o(f,null,h(i.value,s=>(t(),k(d,{key:s.id},{default:c(()=>[e($,{post:s},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",A,[(t(!0),o(f,null,h(i.value,s=>(t(),k(d,{key:s.id},{default:c(()=>[e(z,{post:s},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",D,[e(F,{page:p.value,"onUpdate:page":w,"page-slot":g(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const Ft=R(J,[["__scopeId","data-v-a5302c9b"]]);export{Ft as default}; +import{_ as M,a as P}from"./post-item.vue_vue_type_style_index_0_lang-9289ab28.js";import{_ as S}from"./post-skeleton-6893dc8f.js";import{_ as I}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{u as K}from"./vuex-d28e9067.js";import{b as L}from"./vue-router-88cc84d1.js";import{K as N,_ as R}from"./index-effb87c4.js";import{d as V,r as a,j,c as o,L as e,$ as c,Y as g,O as v,o as t,F as f,a2 as h,K as k}from"./@vue-ca177dbe.js";import{F as q,G as E,I as G,H}from"./naive-ui-2035804c.js";import"./content-6a6aebc0.js";import"./@vicons-6d35273b.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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={key:0,class:"skeleton-wrap"},T={key:1},U={key:0,class:"empty-wrap"},Y={key:1},A={key:2},D={key:0,class:"pagination-wrap"},J=V({__name:"Collection",setup(Q){const m=K(),y=L(),_=a(!1),i=a([]),p=a(+y.query.p||1),l=a(20),r=a(0),u=()=>{_.value=!0,N({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return j(()=>{u()}),(n,W)=>{const C=I,b=S,x=G,$=M,d=H,z=P,B=q,F=E;return t(),o("div",null,[e(C,{title:"收藏"}),e(B,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",O,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",U,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",Y,[(t(!0),o(f,null,h(i.value,s=>(t(),k(d,{key:s.id},{default:c(()=>[e($,{post:s},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",A,[(t(!0),o(f,null,h(i.value,s=>(t(),k(d,{key:s.id},{default:c(()=>[e(z,{post:s},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",D,[e(F,{page:p.value,"onUpdate:page":w,"page-slot":g(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const Ft=R(J,[["__scopeId","data-v-a5302c9b"]]);export{Ft as default}; diff --git a/web/dist/assets/Contacts-0884bcb5.js b/web/dist/assets/Contacts-1a24d8d9.js similarity index 93% rename from web/dist/assets/Contacts-0884bcb5.js rename to web/dist/assets/Contacts-1a24d8d9.js index 1f4859ab..d3f1a47f 100644 --- a/web/dist/assets/Contacts-0884bcb5.js +++ b/web/dist/assets/Contacts-1a24d8d9.js @@ -1 +1 @@ -import{u as M,b as P}from"./vue-router-88cc84d1.js";import{d as b,o as t,c as n,a,L as s,M as v,r as i,j as R,$ as h,Y as S,O as y,F as k,a2 as U,K as V}from"./@vue-ca177dbe.js";import{o as q,F as D,G as L,I as T,H as j}from"./naive-ui-2035804c.js";import{_ as C,N as E}from"./index-f400f811.js";import{_ as G}from"./post-skeleton-78c5cb50.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{u as K}from"./vuex-d28e9067.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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-4a70c6fc.js";import"./@vicons-6d35273b.js";/* empty css */const O={class:"avatar"},Y={class:"base-info"},A={class:"username"},J={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))},[a("div",O,[s(_,{size:"large",src:c.contact.avatar},null,8,["src"])]),a("div",Y,[a("div",A,[a("strong",null,v(c.contact.nickname),1),a("span",null," @"+v(c.contact.username),1)]),a("div",J,"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=K(),m=P(),e=i(!1),o=i([]),_=i(+m.query.p||1),l=i(20),d=i(0),$=r=>{_.value=r,g()};R(()=>{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,N=D,F=L;return t(),n(k,null,[a("div",null,[s(w,{title:"好友"}),s(N,{class:"main-content-wrap",bordered:""},{default:h(()=>[e.value?(t(),n("div",X,[s(x,{num:l.value},null,8,["num"])])):(t(),n("div",Z,[o.value.length===0?(t(),n("div",tt,[s(I,{size:"large",description:"暂无数据"})])):y("",!0),(t(!0),n(k,null,U(o.value,f=>(t(),V(B,{key:f.user_id},{default:h(()=>[s(z,{contact:f},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(t(),n("div",et,[s(F,{page:_.value,"onUpdate:page":$,"page-slot":S(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 P}from"./vue-router-88cc84d1.js";import{d as b,o as t,c as n,a,L as s,M as v,r as i,j as R,$ as h,Y as S,O as y,F as k,a2 as U,K as V}from"./@vue-ca177dbe.js";import{o as q,F as D,G as L,I as T,H as j}from"./naive-ui-2035804c.js";import{_ as C,N as E}from"./index-effb87c4.js";import{_ as G}from"./post-skeleton-6893dc8f.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{u as K}from"./vuex-d28e9067.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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-4a70c6fc.js";import"./@vicons-6d35273b.js";/* empty css */const O={class:"avatar"},Y={class:"base-info"},A={class:"username"},J={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))},[a("div",O,[s(_,{size:"large",src:c.contact.avatar},null,8,["src"])]),a("div",Y,[a("div",A,[a("strong",null,v(c.contact.nickname),1),a("span",null," @"+v(c.contact.username),1)]),a("div",J,"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=K(),m=P(),e=i(!1),o=i([]),_=i(+m.query.p||1),l=i(20),d=i(0),$=r=>{_.value=r,g()};R(()=>{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,N=D,F=L;return t(),n(k,null,[a("div",null,[s(w,{title:"好友"}),s(N,{class:"main-content-wrap",bordered:""},{default:h(()=>[e.value?(t(),n("div",X,[s(x,{num:l.value},null,8,["num"])])):(t(),n("div",Z,[o.value.length===0?(t(),n("div",tt,[s(I,{size:"large",description:"暂无数据"})])):y("",!0),(t(!0),n(k,null,U(o.value,f=>(t(),V(B,{key:f.user_id},{default:h(()=>[s(z,{contact:f},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(t(),n("div",et,[s(F,{page:_.value,"onUpdate:page":$,"page-slot":S(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-14a552e0.js b/web/dist/assets/Home-7bf0efc5.js similarity index 97% rename from web/dist/assets/Home-14a552e0.js rename to web/dist/assets/Home-7bf0efc5.js index 21eb5f2c..219762be 100644 --- a/web/dist/assets/Home-14a552e0.js +++ b/web/dist/assets/Home-7bf0efc5.js @@ -1 +1 @@ -import{_ as Te,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-a8faecc0.js";import{_ as xe}from"./post-skeleton-78c5cb50.js";import{d as W,r as i,j as ee,o as c,c as v,Y as $,a as x,L as a,$ as s,K as S,O as T,a0 as Q,e as P,M as X,F as G,a2 as J,n as Ie,w as ze}from"./@vue-ca177dbe.js";import{u as te}from"./vuex-d28e9067.js";import{l as Y}from"./lodash-94eb5868.js";import{g as Ue,a as Re,c as Ae,b as Ee,_ as Le}from"./index-f400f811.js";import{p as Pe}from"./content-b7753a95.js";import{V as z,P as V}from"./IEnum-a180d93e.js";import{I as Se,V as Ne,A as Ve,d as Fe,E as Be}from"./@vicons-6d35273b.js";import{o as Me,v as Oe,j as je,e as De,w as He,x as Ke,y as Ge,z as Je,A as Ze,B as Qe,C as Xe,a as Ye,D as We,E as et,F as tt,G as at,H as ot,I as nt}from"./naive-ui-2035804c.js";import{_ as st}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{b as lt,u as it}from"./vue-router-88cc84d1.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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-db921567.js";const rt=F=>{const q=new FileReader,r=_=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(_),I=()=>{const _=new Uint8Array(q.result).subarray(0,4);let d="";for(let p=0;p<_.length;p++)d+=_[p].toString(16);switch(d){case"504b0304":case"504b0506":case"504b0708":return r("application/zip");case"504b030414":return r("application/x-zip-compressed");case"504b0508":return r("application/x-zip");case"504b5370":return r("application/octet-stream");default:return!1}};return new Promise((_,d)=>{q.onloadend=()=>{const p=F.type;_(p===""||p==="application/octet-stream"?I():r(p))},q.readAsArrayBuffer(F.slice(0,4))})},ut={key:0,class:"compose-wrap"},ct={class:"compose-line"},pt={class:"compose-user"},_t={class:"compose-line compose-options"},dt={class:"attachment"},mt={class:"submit-wrap"},vt={class:"attachment-list-wrap"},gt={key:0,class:"attachment-price-wrap"},ft=x("span",null," 附件价格¥",-1),yt={key:0,class:"eye-wrap"},ht={key:1,class:"link-wrap"},wt={key:1,class:"compose-wrap"},bt=x("div",{class:"login-wrap"},[x("span",{class:"login-banner"}," 登录后,精彩更多")],-1),kt={key:0,class:"login-only-wrap"},Ct={key:1,class:"login-wrap"},$t=W({__name:"compose",emits:["post-success"],setup(F,{emit:q}){const r=te(),I=i([]),_=i(!1),d=i(!1),p=i(!1),b=i(!1),w=i(""),U=i([]),E=i(),N=i(0),f=i("public/image"),u=i([]),h=i([]),k=i([]),y=i([]),C=i(z.FRIEND),R=i(z.FRIEND),M=[{value:z.PUBLIC,label:"公开"},{value:z.PRIVATE,label:"私密"},{value:z.FRIEND,label:"好友可见"}],L=+"300",B=i("true".toLowerCase()==="true"),O=i("true".toLowerCase()==="true"),j=i("true".toLowerCase()==="true"),A=i("false".toLowerCase()==="true"),ae=i("true".toLowerCase()==="true"),oe="/v1/attachment",Z=i(),ne=()=>{p.value=!p.value,p.value&&b.value&&(b.value=!1)},se=()=>{b.value=!b.value,b.value&&p.value&&(p.value=!1)},le=Y.debounce(t=>{Ue({k:t}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),ie=Y.debounce(t=>{Re({k:t}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),re=(t,e)=>{_.value||(_.value=!0,e==="@"?le(t):ie(t))},ue=t=>{t.length>L?w.value=t.substring(0,L):w.value=t},D=t=>{f.value=t},ce=t=>{for(let l=0;l30&&(t[l].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+o)}u.value=t},pe=async t=>{var e,n,o,l,g;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=t.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((n=t.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=t.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((l=t.file.file)==null?void 0:l.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await rt(t.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((g=t.file.file)==null?void 0:g.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(f.value==="public/image"&&h.value.push({id:t.id,content:o.data.content}),f.value==="public/video"&&k.value.push({id:t.id,content:o.data.content}),f.value==="attachment"&&y.value.push({id:t.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let l=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(g=>{l+=":"+g}),window.$message.error(l)}}catch{window.$message.error("上传失败")}},me=({file:t})=>{let e=h.value.findIndex(n=>n.id===t.id);e>-1&&h.value.splice(e,1),e=k.value.findIndex(n=>n.id===t.id),e>-1&&k.value.splice(e,1),e=y.value.findIndex(n=>n.id===t.id),e>-1&&y.value.splice(e,1)},ve=()=>{if(w.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:t,users:e}=Pe(w.value);const n=[];let o=100;n.push({content:w.value,type:V.TEXT,sort:o}),h.value.map(l=>{o++,n.push({content:l.content,type:V.IMAGEURL,sort:o})}),k.value.map(l=>{o++,n.push({content:l.content,type:V.VIDEOURL,sort:o})}),y.value.map(l=>{o++,n.push({content:l.content,type:V.ATTACHMENT,sort:o})}),U.value.length>0&&U.value.map(l=>{o++,n.push({content:l,type:V.LINKURL,sort:o})}),d.value=!0,Ae({contents:n,tags:Array.from(new Set(t)),users:Array.from(new Set(e)),attachment_price:+N.value*100,visibility:C.value}).then(l=>{var g;window.$message.success("发布成功"),d.value=!1,q("post-success",l),p.value=!1,b.value=!1,(g=E.value)==null||g.clear(),u.value=[],w.value="",U.value=[],h.value=[],k.value=[],y.value=[],C.value=R.value}).catch(l=>{d.value=!1})},H=t=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",t)};return ee(()=>{"friend".toLowerCase()==="friend"?R.value=z.FRIEND:"friend".toLowerCase()==="public"?R.value=z.PUBLIC:R.value=z.PRIVATE,C.value=R.value,Z.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(t,e)=>{const n=Me,o=Oe,l=je,g=De,K=He,ge=Ke,fe=Ge,ye=Je,he=Ze,we=Qe,be=Xe,ke=Ye,Ce=We,$e=et;return c(),v("div",null,[$(r).state.userInfo.id>0?(c(),v("div",ut,[x("div",ct,[x("div",pt,[a(n,{round:"",size:30,src:$(r).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:w.value,prefix:["@","#"],options:I.value,onSearch:re,"onUpdate:value":ue,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(we,{ref_key:"uploadRef",ref:E,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:Z.value},data:{type:f.value},"file-list":u.value,onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[x("div",_t,[x("div",dt,[a(K,{abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),O.value?(c(),S(K,{key:0,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value!=="public/video"||u.value.length===9,onClick:()=>{D("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),j.value?(c(),S(K,{key:1,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ve))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),a(g,{quaternary:"",circle:"",type:"primary",onClick:Q(ne,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Fe))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),S(g,{key:2,quaternary:"",circle:"",type:"primary",onClick:Q(se,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Be))]),_:1})]),_:1},8,["onClick"])):T("",!0)]),x("div",mt,[a(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[a(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:w.value.length/$(L)*100},null,8,["percentage"])]),default:s(()=>[P(" "+X(w.value.length)+" / "+X($(L)),1)]),_:1}),a(g,{loading:d.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[P(" 发布 ")]),_:1},8,["loading"])])]),x("div",vt,[a(ye),y.value.length>0?(c(),v("div",gt,[A.value?(c(),S(he,{key:0,value:N.value,"onUpdate:value":e[0]||(e[0]=m=>N.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[ft]),_:1},8,["value"])):T("",!0)])):T("",!0)])]),_:1},8,["headers","data","file-list"]),b.value?(c(),v("div",yt,[a(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=m=>C.value=m),name:"radiogroup"},{default:s(()=>[a(ke,null,{default:s(()=>[(c(),v(G,null,J(M,m=>a(be,{key:m.value,value:m.value,label:m.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):T("",!0),p.value?(c(),v("div",ht,[a($e,{value:U.value,"onUpdate:value":e[2]||(e[2]=m=>U.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[P(" 创建链接 ")]),_:1},8,["value"])])):T("",!0)])):(c(),v("div",wt,[bt,B.value?T("",!0):(c(),v("div",kt,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=m=>H("signin"))},{default:s(()=>[P(" 登录 ")]),_:1})])),B.value?(c(),v("div",Ct,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=m=>H("signin"))},{default:s(()=>[P(" 登录 ")]),_:1}),a(g,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=m=>H("signup"))},{default:s(()=>[P(" 注册 ")]),_:1})])):T("",!0)]))])}}});const Tt={key:0,class:"skeleton-wrap"},qt={key:1},xt={key:0,class:"empty-wrap"},It={key:1},zt={key:2},Ut={key:0,class:"pagination-wrap"},Rt=W({__name:"Home",setup(F){const q=te(),r=lt(),I=it(),_=i(!1),d=i([]),p=i(+r.query.p||1),b=i(20),w=i(0),U=Ie(()=>{let u="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?u="#"+decodeURIComponent(r.query.q):u="搜索: "+decodeURIComponent(r.query.q)),u}),E=()=>{_.value=!0,Ee({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:p.value,page_size:b.value}).then(u=>{_.value=!1,d.value=u.list,w.value=Math.ceil(u.pager.total_rows/b.value),window.scrollTo(0,0)}).catch(u=>{_.value=!1})},N=u=>{if(p.value!=1){I.push({name:"post",query:{id:u.id}});return}let h=[],k=d.value.length;k==b.value&&k--;for(var y=0;y{I.push({name:"home",query:{...r.query,p:u}})};return ee(()=>{E()}),ze(()=>({path:r.path,query:r.query,refresh:q.state.refresh}),(u,h)=>{if(u.refresh!==h.refresh){p.value=+r.query.p||1,setTimeout(()=>{E()},0);return}h.path!=="/post"&&u.path==="/"&&(p.value=+r.query.p||1,setTimeout(()=>{E()},0))}),(u,h)=>{const k=st,y=$t,C=ot,R=xe,M=nt,L=Te,B=qe,O=tt,j=at;return c(),v("div",null,[a(k,{title:$(U)},null,8,["title"]),a(O,{class:"main-content-wrap",bordered:""},{default:s(()=>[a(C,null,{default:s(()=>[a(y,{onPostSuccess:N})]),_:1}),_.value?(c(),v("div",Tt,[a(R,{num:b.value},null,8,["num"])])):(c(),v("div",qt,[d.value.length===0?(c(),v("div",xt,[a(M,{size:"large",description:"暂无数据"})])):T("",!0),$(q).state.desktopModelShow?(c(),v("div",It,[(c(!0),v(G,null,J(d.value,A=>(c(),S(C,{key:A.id},{default:s(()=>[a(L,{post:A},null,8,["post"])]),_:2},1024))),128))])):(c(),v("div",zt,[(c(!0),v(G,null,J(d.value,A=>(c(),S(C,{key:A.id},{default:s(()=>[a(B,{post:A},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),w.value>0?(c(),v("div",Ut,[a(j,{page:p.value,"onUpdate:page":f,"page-slot":$(q).state.collapsedRight?5:8,"page-count":w.value},null,8,["page","page-slot","page-count"])])):T("",!0)])}}});const ca=Le(Rt,[["__scopeId","data-v-f42b0645"]]);export{ca as default}; +import{_ as Te,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-9289ab28.js";import{_ as xe}from"./post-skeleton-6893dc8f.js";import{d as W,r as i,j as ee,o as c,c as v,Y as $,a as x,L as a,$ as s,K as S,O as T,a0 as Q,e as P,M as X,F as G,a2 as J,n as Ie,w as ze}from"./@vue-ca177dbe.js";import{u as te}from"./vuex-d28e9067.js";import{l as Y}from"./lodash-94eb5868.js";import{g as Ue,a as Re,c as Ae,b as Ee,_ as Le}from"./index-effb87c4.js";import{p as Pe}from"./content-6a6aebc0.js";import{V as z,P as V}from"./IEnum-a180d93e.js";import{I as Se,V as Ne,A as Ve,d as Fe,E as Be}from"./@vicons-6d35273b.js";import{o as Me,v as Oe,j as je,e as De,w as He,x as Ke,y as Ge,z as Je,A as Ze,B as Qe,C as Xe,a as Ye,D as We,E as et,F as tt,G as at,H as ot,I as nt}from"./naive-ui-2035804c.js";import{_ as st}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{b as lt,u as it}from"./vue-router-88cc84d1.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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-db921567.js";const rt=F=>{const q=new FileReader,r=_=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(_),I=()=>{const _=new Uint8Array(q.result).subarray(0,4);let d="";for(let p=0;p<_.length;p++)d+=_[p].toString(16);switch(d){case"504b0304":case"504b0506":case"504b0708":return r("application/zip");case"504b030414":return r("application/x-zip-compressed");case"504b0508":return r("application/x-zip");case"504b5370":return r("application/octet-stream");default:return!1}};return new Promise((_,d)=>{q.onloadend=()=>{const p=F.type;_(p===""||p==="application/octet-stream"?I():r(p))},q.readAsArrayBuffer(F.slice(0,4))})},ut={key:0,class:"compose-wrap"},ct={class:"compose-line"},pt={class:"compose-user"},_t={class:"compose-line compose-options"},dt={class:"attachment"},mt={class:"submit-wrap"},vt={class:"attachment-list-wrap"},gt={key:0,class:"attachment-price-wrap"},ft=x("span",null," 附件价格¥",-1),yt={key:0,class:"eye-wrap"},ht={key:1,class:"link-wrap"},wt={key:1,class:"compose-wrap"},bt=x("div",{class:"login-wrap"},[x("span",{class:"login-banner"}," 登录后,精彩更多")],-1),kt={key:0,class:"login-only-wrap"},Ct={key:1,class:"login-wrap"},$t=W({__name:"compose",emits:["post-success"],setup(F,{emit:q}){const r=te(),I=i([]),_=i(!1),d=i(!1),p=i(!1),b=i(!1),w=i(""),U=i([]),E=i(),N=i(0),f=i("public/image"),u=i([]),h=i([]),k=i([]),y=i([]),C=i(z.FRIEND),R=i(z.FRIEND),M=[{value:z.PUBLIC,label:"公开"},{value:z.PRIVATE,label:"私密"},{value:z.FRIEND,label:"好友可见"}],L=+"300",B=i("true".toLowerCase()==="true"),O=i("true".toLowerCase()==="true"),j=i("true".toLowerCase()==="true"),A=i("false".toLowerCase()==="true"),ae=i("true".toLowerCase()==="true"),oe="/v1/attachment",Z=i(),ne=()=>{p.value=!p.value,p.value&&b.value&&(b.value=!1)},se=()=>{b.value=!b.value,b.value&&p.value&&(p.value=!1)},le=Y.debounce(t=>{Ue({k:t}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),ie=Y.debounce(t=>{Re({k:t}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),re=(t,e)=>{_.value||(_.value=!0,e==="@"?le(t):ie(t))},ue=t=>{t.length>L?w.value=t.substring(0,L):w.value=t},D=t=>{f.value=t},ce=t=>{for(let l=0;l30&&(t[l].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+o)}u.value=t},pe=async t=>{var e,n,o,l,g;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=t.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((n=t.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=t.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((l=t.file.file)==null?void 0:l.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await rt(t.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((g=t.file.file)==null?void 0:g.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(f.value==="public/image"&&h.value.push({id:t.id,content:o.data.content}),f.value==="public/video"&&k.value.push({id:t.id,content:o.data.content}),f.value==="attachment"&&y.value.push({id:t.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let l=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(g=>{l+=":"+g}),window.$message.error(l)}}catch{window.$message.error("上传失败")}},me=({file:t})=>{let e=h.value.findIndex(n=>n.id===t.id);e>-1&&h.value.splice(e,1),e=k.value.findIndex(n=>n.id===t.id),e>-1&&k.value.splice(e,1),e=y.value.findIndex(n=>n.id===t.id),e>-1&&y.value.splice(e,1)},ve=()=>{if(w.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:t,users:e}=Pe(w.value);const n=[];let o=100;n.push({content:w.value,type:V.TEXT,sort:o}),h.value.map(l=>{o++,n.push({content:l.content,type:V.IMAGEURL,sort:o})}),k.value.map(l=>{o++,n.push({content:l.content,type:V.VIDEOURL,sort:o})}),y.value.map(l=>{o++,n.push({content:l.content,type:V.ATTACHMENT,sort:o})}),U.value.length>0&&U.value.map(l=>{o++,n.push({content:l,type:V.LINKURL,sort:o})}),d.value=!0,Ae({contents:n,tags:Array.from(new Set(t)),users:Array.from(new Set(e)),attachment_price:+N.value*100,visibility:C.value}).then(l=>{var g;window.$message.success("发布成功"),d.value=!1,q("post-success",l),p.value=!1,b.value=!1,(g=E.value)==null||g.clear(),u.value=[],w.value="",U.value=[],h.value=[],k.value=[],y.value=[],C.value=R.value}).catch(l=>{d.value=!1})},H=t=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",t)};return ee(()=>{"friend".toLowerCase()==="friend"?R.value=z.FRIEND:"friend".toLowerCase()==="public"?R.value=z.PUBLIC:R.value=z.PRIVATE,C.value=R.value,Z.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(t,e)=>{const n=Me,o=Oe,l=je,g=De,K=He,ge=Ke,fe=Ge,ye=Je,he=Ze,we=Qe,be=Xe,ke=Ye,Ce=We,$e=et;return c(),v("div",null,[$(r).state.userInfo.id>0?(c(),v("div",ut,[x("div",ct,[x("div",pt,[a(n,{round:"",size:30,src:$(r).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:w.value,prefix:["@","#"],options:I.value,onSearch:re,"onUpdate:value":ue,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(we,{ref_key:"uploadRef",ref:E,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:Z.value},data:{type:f.value},"file-list":u.value,onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[x("div",_t,[x("div",dt,[a(K,{abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),O.value?(c(),S(K,{key:0,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value!=="public/video"||u.value.length===9,onClick:()=>{D("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),j.value?(c(),S(K,{key:1,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ve))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),a(g,{quaternary:"",circle:"",type:"primary",onClick:Q(ne,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Fe))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),S(g,{key:2,quaternary:"",circle:"",type:"primary",onClick:Q(se,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Be))]),_:1})]),_:1},8,["onClick"])):T("",!0)]),x("div",mt,[a(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[a(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:w.value.length/$(L)*100},null,8,["percentage"])]),default:s(()=>[P(" "+X(w.value.length)+" / "+X($(L)),1)]),_:1}),a(g,{loading:d.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[P(" 发布 ")]),_:1},8,["loading"])])]),x("div",vt,[a(ye),y.value.length>0?(c(),v("div",gt,[A.value?(c(),S(he,{key:0,value:N.value,"onUpdate:value":e[0]||(e[0]=m=>N.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[ft]),_:1},8,["value"])):T("",!0)])):T("",!0)])]),_:1},8,["headers","data","file-list"]),b.value?(c(),v("div",yt,[a(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=m=>C.value=m),name:"radiogroup"},{default:s(()=>[a(ke,null,{default:s(()=>[(c(),v(G,null,J(M,m=>a(be,{key:m.value,value:m.value,label:m.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):T("",!0),p.value?(c(),v("div",ht,[a($e,{value:U.value,"onUpdate:value":e[2]||(e[2]=m=>U.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[P(" 创建链接 ")]),_:1},8,["value"])])):T("",!0)])):(c(),v("div",wt,[bt,B.value?T("",!0):(c(),v("div",kt,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=m=>H("signin"))},{default:s(()=>[P(" 登录 ")]),_:1})])),B.value?(c(),v("div",Ct,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=m=>H("signin"))},{default:s(()=>[P(" 登录 ")]),_:1}),a(g,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=m=>H("signup"))},{default:s(()=>[P(" 注册 ")]),_:1})])):T("",!0)]))])}}});const Tt={key:0,class:"skeleton-wrap"},qt={key:1},xt={key:0,class:"empty-wrap"},It={key:1},zt={key:2},Ut={key:0,class:"pagination-wrap"},Rt=W({__name:"Home",setup(F){const q=te(),r=lt(),I=it(),_=i(!1),d=i([]),p=i(+r.query.p||1),b=i(20),w=i(0),U=Ie(()=>{let u="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?u="#"+decodeURIComponent(r.query.q):u="搜索: "+decodeURIComponent(r.query.q)),u}),E=()=>{_.value=!0,Ee({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:p.value,page_size:b.value}).then(u=>{_.value=!1,d.value=u.list,w.value=Math.ceil(u.pager.total_rows/b.value),window.scrollTo(0,0)}).catch(u=>{_.value=!1})},N=u=>{if(p.value!=1){I.push({name:"post",query:{id:u.id}});return}let h=[],k=d.value.length;k==b.value&&k--;for(var y=0;y{I.push({name:"home",query:{...r.query,p:u}})};return ee(()=>{E()}),ze(()=>({path:r.path,query:r.query,refresh:q.state.refresh}),(u,h)=>{if(u.refresh!==h.refresh){p.value=+r.query.p||1,setTimeout(()=>{E()},0);return}h.path!=="/post"&&u.path==="/"&&(p.value=+r.query.p||1,setTimeout(()=>{E()},0))}),(u,h)=>{const k=st,y=$t,C=ot,R=xe,M=nt,L=Te,B=qe,O=tt,j=at;return c(),v("div",null,[a(k,{title:$(U)},null,8,["title"]),a(O,{class:"main-content-wrap",bordered:""},{default:s(()=>[a(C,null,{default:s(()=>[a(y,{onPostSuccess:N})]),_:1}),_.value?(c(),v("div",Tt,[a(R,{num:b.value},null,8,["num"])])):(c(),v("div",qt,[d.value.length===0?(c(),v("div",xt,[a(M,{size:"large",description:"暂无数据"})])):T("",!0),$(q).state.desktopModelShow?(c(),v("div",It,[(c(!0),v(G,null,J(d.value,A=>(c(),S(C,{key:A.id},{default:s(()=>[a(L,{post:A},null,8,["post"])]),_:2},1024))),128))])):(c(),v("div",zt,[(c(!0),v(G,null,J(d.value,A=>(c(),S(C,{key:A.id},{default:s(()=>[a(B,{post:A},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),w.value>0?(c(),v("div",Ut,[a(j,{page:p.value,"onUpdate:page":f,"page-slot":$(q).state.collapsedRight?5:8,"page-count":w.value},null,8,["page","page-slot","page-count"])])):T("",!0)])}}});const ca=Le(Rt,[["__scopeId","data-v-f42b0645"]]);export{ca as default}; diff --git a/web/dist/assets/Messages-f314d9ce.js b/web/dist/assets/Messages-52f808f4.js similarity index 97% rename from web/dist/assets/Messages-f314d9ce.js rename to web/dist/assets/Messages-52f808f4.js index a8a03cdd..c4cf3945 100644 --- a/web/dist/assets/Messages-f314d9ce.js +++ b/web/dist/assets/Messages-52f808f4.js @@ -1 +1 @@ -import{d as b,a1 as V,o as a,c as o,L as n,$ as i,a as k,a0 as $,e as u,M as g,K as z,O as l,Y as p,a4 as A,a2 as N,F as O,r as y,j as D}from"./@vue-ca177dbe.js";import{u as L,b as G}from"./vue-router-88cc84d1.js";import{G as H,H as P,I as T,_ as F,J as U}from"./index-f400f811.js";import{a as E}from"./formatTime-000dbebb.js";import{q as J,r as K,s as q,t as Y}from"./@vicons-6d35273b.js";import{o as Q,l as W,j as X,S as Z,L as ee,U as se,F as te,G as ne,I as ae,H as oe}from"./naive-ui-2035804c.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{u as le}from"./vuex-d28e9067.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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),H({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=Q,_=V("router-link"),I=W,m=X,C=Z,M=ee;return a(),o("div",{class:A(["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(),z(I,{key:0,dot:"",processing:""})):l("",!0),k("span",me,g(p(E)(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(J))]),_: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(K))]),_: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(q))]),_:1}),u(" 拒绝 ")])):l("",!0),e.message.reply_id===2?(a(),o("span",fe,[n(m,null,{default:i(()=>[n(p(Y))]),_:1}),u(" 已同意 ")])):l("",!0),e.message.reply_id===3?(a(),o("span",ye,[n(m,null,{default:i(()=>[n(p(q))]),_: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(O,null,N(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=G(),w=le(),r=y(!1),d=y(+h.query.p||1),v=y(10),c=y(0),s=y([]),t=()=>{r.value=!0,U({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 D(()=>{t()}),(_,I)=>{const m=ie,C=xe,M=ae,f=he,R=oe,j=te,B=ne;return a(),o("div",null,[n(m,{title:"消息"}),n(j,{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(O,null,N(s.value,S=>(a(),z(R,{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 Ze=F(Ie,[["__scopeId","data-v-4e7b1342"]]);export{Ze as default}; +import{d as b,a1 as V,o as a,c as o,L as n,$ as i,a as k,a0 as $,e as u,M as g,K as z,O as l,Y as p,a4 as A,a2 as N,F as O,r as y,j as D}from"./@vue-ca177dbe.js";import{u as L,b as G}from"./vue-router-88cc84d1.js";import{G as H,H as P,I as T,_ as F,J as U}from"./index-effb87c4.js";import{a as E}from"./formatTime-000dbebb.js";import{q as J,r as K,s as q,t as Y}from"./@vicons-6d35273b.js";import{o as Q,l as W,j as X,S as Z,L as ee,U as se,F as te,G as ne,I as ae,H as oe}from"./naive-ui-2035804c.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{u as le}from"./vuex-d28e9067.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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),H({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=Q,_=V("router-link"),I=W,m=X,C=Z,M=ee;return a(),o("div",{class:A(["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(),z(I,{key:0,dot:"",processing:""})):l("",!0),k("span",me,g(p(E)(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(J))]),_: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(K))]),_: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(q))]),_:1}),u(" 拒绝 ")])):l("",!0),e.message.reply_id===2?(a(),o("span",fe,[n(m,null,{default:i(()=>[n(p(Y))]),_:1}),u(" 已同意 ")])):l("",!0),e.message.reply_id===3?(a(),o("span",ye,[n(m,null,{default:i(()=>[n(p(q))]),_: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(O,null,N(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=G(),w=le(),r=y(!1),d=y(+h.query.p||1),v=y(10),c=y(0),s=y([]),t=()=>{r.value=!0,U({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 D(()=>{t()}),(_,I)=>{const m=ie,C=xe,M=ae,f=he,R=oe,j=te,B=ne;return a(),o("div",null,[n(m,{title:"消息"}),n(j,{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(O,null,N(s.value,S=>(a(),z(R,{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 Ze=F(Ie,[["__scopeId","data-v-4e7b1342"]]);export{Ze as default}; diff --git a/web/dist/assets/Post-12ff28aa.css b/web/dist/assets/Post-12ff28aa.css deleted file mode 100644 index dac80854..00000000 --- a/web/dist/assets/Post-12ff28aa.css +++ /dev/null @@ -1 +0,0 @@ -.reply-item[data-v-783f5693]{display:flex;flex-direction:column;font-size:12px;padding:8px;border-bottom:1px solid #f3f3f3}.reply-item .header-wrap[data-v-783f5693]{display:flex;align-items:center;justify-content:space-between}.reply-item .header-wrap .username[data-v-783f5693]{max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .header-wrap .username .reply-name[data-v-783f5693]{margin:0 3px;opacity:.75}.reply-item .header-wrap .timestamp[data-v-783f5693]{opacity:.75;text-align:right;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .base-wrap[data-v-783f5693]{display:block}.reply-item .base-wrap .content[data-v-783f5693]{width:calc(100% - 40px);margin-top:4px;font-size:12px;text-align:justify;line-height:2}.reply-item .base-wrap .reply-switch[data-v-783f5693]{display:flex;align-items:center;justify-content:space-between;font-size:12px}.reply-item .base-wrap .reply-switch .actions[data-v-783f5693]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-item .base-wrap .reply-switch .time-item[data-v-783f5693]{font-size:12px;opacity:.75;margin-right:18px}.reply-item .base-wrap .reply-switch .action-item[data-v-783f5693]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-item .base-wrap .reply-switch .action-item .upvote-count[data-v-783f5693]{margin-left:4px;font-size:12px}.reply-item .base-wrap .reply-switch .action-item.hover[data-v-783f5693]{cursor:pointer}.reply-item .base-wrap .reply-switch .opacity-item[data-v-783f5693]{opacity:.75}.reply-item .base-wrap .reply-switch .reply-btn[data-v-783f5693]{margin-left:18px}.reply-item .base-wrap .reply-switch .show[data-v-783f5693]{color:#18a058;cursor:pointer}.reply-item .base-wrap .reply-switch .hide[data-v-783f5693]{opacity:.75;cursor:pointer}.dark .reply-item[data-v-783f5693]{border-bottom:1px solid #262628;background-color:#101014bf}.dark .reply-item .base-wrap .reply-switch .show[data-v-783f5693]{color:#63e2b7}.reply-compose-wrap .reply-switch[data-v-8de6ada0]{display:flex;align-items:center;justify-content:space-between;text-align:right;font-size:12px}.reply-compose-wrap .reply-switch .actions[data-v-8de6ada0]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-compose-wrap .reply-switch .time-item[data-v-8de6ada0]{font-size:12px;opacity:.65;margin-right:18px}.reply-compose-wrap .reply-switch .action-item[data-v-8de6ada0]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-compose-wrap .reply-switch .action-item .upvote-count[data-v-8de6ada0]{margin-left:4px;font-size:12px}.reply-compose-wrap .reply-switch .action-item.hover[data-v-8de6ada0]{cursor:pointer}.reply-compose-wrap .reply-switch .reply-btn[data-v-8de6ada0]{margin-left:18px}.reply-compose-wrap .reply-switch .show[data-v-8de6ada0]{color:#18a058;cursor:pointer;opacity:.75}.reply-compose-wrap .reply-switch .hide[data-v-8de6ada0]{opacity:.75;cursor:pointer}.dark .reply-compose-wrap[data-v-8de6ada0]{background-color:#101014bf}.dark .reply-compose-wrap .reply-switch .show[data-v-8de6ada0]{color:#63e2b7}.comment-item[data-v-f206d4d8]{width:100%;padding:16px;box-sizing:border-box}.comment-item .nickname-wrap[data-v-f206d4d8]{font-size:14px}.comment-item .username-wrap[data-v-f206d4d8]{font-size:14px;opacity:.75}.comment-item .opt-wrap[data-v-f206d4d8]{display:flex;align-items:center}.comment-item .opt-wrap .timestamp[data-v-f206d4d8]{opacity:.75;font-size:12px}.comment-item .opt-wrap .del-btn[data-v-f206d4d8]{margin-left:4px}.comment-item .comment-text[data-v-f206d4d8]{display:block;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.comment-item .opt-item[data-v-f206d4d8]{display:flex;align-items:center;opacity:.7}.comment-item .opt-item .opt-item-icon[data-v-f206d4d8]{margin-right:10px}.reply-wrap[data-v-f206d4d8]{margin-top:10px;border-radius:5px;background:#fafafc}.reply-wrap .reply-item[data-v-f206d4d8]:last-child{border-bottom:none}.dark .reply-wrap[data-v-f206d4d8]{background:#18181c}.dark .comment-item[data-v-f206d4d8]{background-color:#101014bf}.compose-wrap[data-v-bd19dbe6]{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line[data-v-bd19dbe6]{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user[data-v-bd19dbe6]{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options[data-v-bd19dbe6]{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap[data-v-bd19dbe6]{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .cancel-btn[data-v-bd19dbe6]{margin-right:8px}.compose-wrap .login-only-wrap[data-v-bd19dbe6]{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button[data-v-bd19dbe6]{margin:0 4px;width:50%}.compose-wrap .login-wrap[data-v-bd19dbe6]{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner[data-v-bd19dbe6]{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button[data-v-bd19dbe6]{margin:0 4px}.attachment[data-v-bd19dbe6]{display:flex;align-items:center}.attachment .text-statistic[data-v-bd19dbe6]{margin-left:8px;width:18px;height:18px;transform:rotate(180deg)}.attachment-list-wrap[data-v-bd19dbe6]{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail[data-v-bd19dbe6]{overflow:hidden}.dark .compose-mention[data-v-bd19dbe6],.dark .compose-wrap[data-v-bd19dbe6]{background-color:#101014bf}.detail-item{width:100%;padding:16px;box-sizing:border-box;background:#f7f9f9}.detail-item .nickname-wrap{font-size:14px}.detail-item .username-wrap{font-size:14px;opacity:.75}.detail-item .top-tag{transform:scale(.75)}.detail-item .options{opacity:.75}.detail-item .post-text{font-size:16px;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.detail-item .opts-wrap{margin-top:20px}.detail-item .opts-wrap .opt-item{display:flex;align-items:center;opacity:.7}.detail-item .opts-wrap .opt-item .opt-item-icon{margin-right:10px}.detail-item .opts-wrap .opt-item.hover{cursor:pointer}.detail-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.detail-item .timestamp{opacity:.75;font-size:12px;margin-top:10px}.dark .detail-item{background:#18181c}.detail-wrap[data-v-0d01659f]{min-height:100px}.comment-opts-wrap[data-v-0d01659f]{padding-top:6px;padding-left:16px;padding-right:16px;opacity:.75}.comment-opts-wrap .comment-title-item[data-v-0d01659f]{padding-top:4px;font-size:16px;text-align:center}.main-content-wrap .load-more[data-v-0d01659f]{margin-bottom:8px}.main-content-wrap .load-more .load-more-spinner[data-v-0d01659f]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-0d01659f],.dark .skeleton-wrap[data-v-0d01659f]{background-color:#101014bf} diff --git a/web/dist/assets/Post-521adc02.css b/web/dist/assets/Post-521adc02.css new file mode 100644 index 00000000..300a07f9 --- /dev/null +++ b/web/dist/assets/Post-521adc02.css @@ -0,0 +1 @@ +.reply-item[data-v-1ac7a555]{display:flex;flex-direction:column;font-size:12px;padding:8px;border-bottom:1px solid #f3f3f3}.reply-item .header-wrap[data-v-1ac7a555]{display:flex;align-items:center;justify-content:space-between}.reply-item .header-wrap .username[data-v-1ac7a555]{max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .header-wrap .username .reply-name[data-v-1ac7a555]{margin:0 3px;opacity:.75}.reply-item .header-wrap .timestamp[data-v-1ac7a555]{opacity:.75;text-align:right;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .base-wrap[data-v-1ac7a555]{display:block}.reply-item .base-wrap .content[data-v-1ac7a555]{width:100%;margin-top:4px;font-size:12px;text-align:justify;line-height:2}.reply-item .base-wrap .reply-switch[data-v-1ac7a555]{display:flex;align-items:center;justify-content:space-between;font-size:12px}.reply-item .base-wrap .reply-switch .actions[data-v-1ac7a555]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-item .base-wrap .reply-switch .time-item[data-v-1ac7a555]{font-size:12px;opacity:.75;margin-right:18px}.reply-item .base-wrap .reply-switch .action-item[data-v-1ac7a555]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-item .base-wrap .reply-switch .action-item .upvote-count[data-v-1ac7a555]{margin-left:4px;font-size:12px}.reply-item .base-wrap .reply-switch .action-item.hover[data-v-1ac7a555]{cursor:pointer}.reply-item .base-wrap .reply-switch .opacity-item[data-v-1ac7a555]{opacity:.75}.reply-item .base-wrap .reply-switch .reply-btn[data-v-1ac7a555]{margin-left:18px}.reply-item .base-wrap .reply-switch .show[data-v-1ac7a555]{color:#18a058;cursor:pointer}.reply-item .base-wrap .reply-switch .hide[data-v-1ac7a555]{opacity:.75;cursor:pointer}.dark .reply-item[data-v-1ac7a555]{border-bottom:1px solid #262628;background-color:#101014bf}.dark .reply-item .base-wrap .reply-switch .show[data-v-1ac7a555]{color:#63e2b7}.reply-compose-wrap .reply-switch[data-v-f9af7a93]{display:flex;align-items:center;justify-content:space-between;text-align:right;font-size:12px}.reply-compose-wrap .reply-switch .actions[data-v-f9af7a93]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-compose-wrap .reply-switch .time-item[data-v-f9af7a93]{font-size:12px;opacity:.65;margin-right:18px}.reply-compose-wrap .reply-switch .action-item[data-v-f9af7a93]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-compose-wrap .reply-switch .action-item .upvote-count[data-v-f9af7a93]{margin-left:4px;font-size:12px}.reply-compose-wrap .reply-switch .action-item.hover[data-v-f9af7a93]{cursor:pointer}.reply-compose-wrap .reply-switch .reply-btn[data-v-f9af7a93]{margin-left:18px}.reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#18a058;cursor:pointer;opacity:.75}.reply-compose-wrap .reply-switch .hide[data-v-f9af7a93]{opacity:.75;cursor:pointer}.dark .reply-compose-wrap[data-v-f9af7a93]{background-color:#101014bf}.dark .reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#63e2b7}.comment-item[data-v-f206d4d8]{width:100%;padding:16px;box-sizing:border-box}.comment-item .nickname-wrap[data-v-f206d4d8]{font-size:14px}.comment-item .username-wrap[data-v-f206d4d8]{font-size:14px;opacity:.75}.comment-item .opt-wrap[data-v-f206d4d8]{display:flex;align-items:center}.comment-item .opt-wrap .timestamp[data-v-f206d4d8]{opacity:.75;font-size:12px}.comment-item .opt-wrap .del-btn[data-v-f206d4d8]{margin-left:4px}.comment-item .comment-text[data-v-f206d4d8]{display:block;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.comment-item .opt-item[data-v-f206d4d8]{display:flex;align-items:center;opacity:.7}.comment-item .opt-item .opt-item-icon[data-v-f206d4d8]{margin-right:10px}.reply-wrap[data-v-f206d4d8]{margin-top:10px;border-radius:5px;background:#fafafc}.reply-wrap .reply-item[data-v-f206d4d8]:last-child{border-bottom:none}.dark .reply-wrap[data-v-f206d4d8]{background:#18181c}.dark .comment-item[data-v-f206d4d8]{background-color:#101014bf}.compose-wrap[data-v-bd19dbe6]{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line[data-v-bd19dbe6]{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user[data-v-bd19dbe6]{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options[data-v-bd19dbe6]{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap[data-v-bd19dbe6]{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .cancel-btn[data-v-bd19dbe6]{margin-right:8px}.compose-wrap .login-only-wrap[data-v-bd19dbe6]{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button[data-v-bd19dbe6]{margin:0 4px;width:50%}.compose-wrap .login-wrap[data-v-bd19dbe6]{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner[data-v-bd19dbe6]{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button[data-v-bd19dbe6]{margin:0 4px}.attachment[data-v-bd19dbe6]{display:flex;align-items:center}.attachment .text-statistic[data-v-bd19dbe6]{margin-left:8px;width:18px;height:18px;transform:rotate(180deg)}.attachment-list-wrap[data-v-bd19dbe6]{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail[data-v-bd19dbe6]{overflow:hidden}.dark .compose-mention[data-v-bd19dbe6],.dark .compose-wrap[data-v-bd19dbe6]{background-color:#101014bf}.detail-item{width:100%;padding:16px;box-sizing:border-box;background:#f7f9f9}.detail-item .nickname-wrap{font-size:14px}.detail-item .username-wrap{font-size:14px;opacity:.75}.detail-item .top-tag{transform:scale(.75)}.detail-item .options{opacity:.75}.detail-item .post-text{font-size:16px;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.detail-item .opts-wrap{margin-top:20px}.detail-item .opts-wrap .opt-item{display:flex;align-items:center;opacity:.7}.detail-item .opts-wrap .opt-item .opt-item-icon{margin-right:10px}.detail-item .opts-wrap .opt-item.hover{cursor:pointer}.detail-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.detail-item .timestamp{opacity:.75;font-size:12px;margin-top:10px}.dark .detail-item{background:#18181c}.detail-wrap[data-v-0d01659f]{min-height:100px}.comment-opts-wrap[data-v-0d01659f]{padding-top:6px;padding-left:16px;padding-right:16px;opacity:.75}.comment-opts-wrap .comment-title-item[data-v-0d01659f]{padding-top:4px;font-size:16px;text-align:center}.main-content-wrap .load-more[data-v-0d01659f]{margin-bottom:8px}.main-content-wrap .load-more .load-more-spinner[data-v-0d01659f]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-0d01659f],.dark .skeleton-wrap[data-v-0d01659f]{background-color:#101014bf} diff --git a/web/dist/assets/Post-7dfd8928.js b/web/dist/assets/Post-7dfd8928.js deleted file mode 100644 index 047fca67..00000000 --- a/web/dist/assets/Post-7dfd8928.js +++ /dev/null @@ -1 +0,0 @@ -import{d as G,r as u,a1 as de,o as n,c,a as d,L as t,$ as a,e as U,M as z,K as P,O as i,Y as e,a0 as H,n as ne,a6 as Ue,F as ae,a2 as le,j as me,U as ge,V as ye,w as Pe}from"./@vue-ca177dbe.js";import{u as Z}from"./vuex-d28e9067.js";import{f as ie}from"./formatTime-000dbebb.js";import{t as Re,d as Se,e as Le,_ as ee,f as Me,h as Ae,i as De,j as Oe,g as qe,k as Ne,l as je,m as Be,n as Ee,o as Ve,s as He,v as Fe,p as Ye,q as Ke,r as Je,u as he}from"./index-f400f811.js";import{Y as ce,V as X}from"./IEnum-a180d93e.js";import{T as ke,e as ue,f as we,g as re,h as be,I as Ge,i as Qe,j as We,k as Xe,l as Ze,m as et,n as tt,o as st}from"./@vicons-6d35273b.js";import{j as te,e as se,J as $e,b as ot,K as nt,o as ve,L as Ce,v as at,w as lt,x as it,y as ct,z as ut,B as rt,M as _t,O as pt,i as dt,P as mt,a as xe,F as vt,I as ft,k as ht,H as gt,f as yt,g as kt}from"./naive-ui-2035804c.js";import{p as fe,_ as Ie,a as wt,b as bt,c as $t}from"./content-b7753a95.js";import{u as Te,b as Ct}from"./vue-router-88cc84d1.js";import{_ as xt}from"./post-skeleton-78c5cb50.js";import{l as It}from"./lodash-94eb5868.js";import{a as Tt}from"./copy-to-clipboard-1dd3075d.js";import{_ as zt}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{K as Ut}from"./v3-infinite-loading-fcb59c38.js";import"./moment-b7869f98.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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-db921567.js";import"./toggle-selection-93f4ad84.js";const Pt={class:"reply-item"},Rt={class:"header-wrap"},St={class:"username"},Lt={class:"reply-name"},Mt={class:"timestamp"},At={class:"base-wrap"},Dt={class:"content"},Ot={class:"reply-switch"},qt={class:"time-item"},Nt={class:"actions"},jt={class:"upvote-count"},Bt=["onClick"],Et={class:"upvote-count"},Vt={key:2,class:"action-item"},Ht=["onClick"],Ft=G({__name:"reply-item",props:{tweetId:null,reply:null},emits:["focusReply","reload"],setup(L,{emit:N}){const l=L,r=Z(),h=u(l.reply.is_thumbs_up==ce.YES),k=u(l.reply.is_thumbs_down==ce.YES),b=u(l.reply.thumbs_up_count),R=()=>{Re({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(f=>{h.value=!h.value,h.value?(b.value++,k.value=!1):b.value--}).catch(f=>{console.log(f)})},_=()=>{Se({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(f=>{k.value=!k.value,k.value&&h.value&&(b.value--,h.value=!1)}).catch(f=>{console.log(f)})},M=()=>{N("focusReply",l.reply)},v=()=>{Le({id:l.reply.id}).then(f=>{window.$message.success("删除成功"),setTimeout(()=>{N("reload")},50)}).catch(f=>{console.log(f)})};return(f,x)=>{const s=de("router-link"),w=te,g=se,A=$e;return n(),c("div",Pt,[d("div",Rt,[d("div",St,[t(s,{class:"user-link",to:{name:"user",query:{username:l.reply.user.username}}},{default:a(()=>[U(z(l.reply.user.username),1)]),_:1},8,["to"]),d("span",Lt,z(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(n(),P(s,{key:0,class:"user-link",to:{name:"user",query:{username:l.reply.at_user.username}}},{default:a(()=>[U(z(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),d("div",Mt,[U(z(l.reply.ip_loc)+" ",1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===l.reply.user.id?(n(),P(A,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:v},{trigger:a(()=>[t(g,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(w,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[U(" 是否确认删除? ")]),_:1})):i("",!0)])]),d("div",At,[d("div",Dt,z(l.reply.content),1),d("div",Ot,[d("span",qt,z(e(ie)(l.reply.created_on)),1),d("div",Nt,[e(r).state.userLogined?i("",!0):(n(),c("div",{key:0,class:"action-item",onClick:x[0]||(x[0]=H(()=>{},["stop"]))},[t(w,{size:"medium"},{default:a(()=>[t(e(ue))]),_:1}),d("span",jt,z(b.value),1)])),e(r).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:H(R,["stop"])},[t(w,{size:"medium"},{default:a(()=>[h.value?i("",!0):(n(),P(e(ue),{key:0})),h.value?(n(),P(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",Et,z(b.value),1)],8,Bt)):i("",!0),e(r).state.userLogined?i("",!0):(n(),c("div",Vt,[t(w,{size:"medium"},{default:a(()=>[t(e(re))]),_:1})])),e(r).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:H(_,["stop"])},[t(w,{size:"medium"},{default:a(()=>[k.value?i("",!0):(n(),P(e(re),{key:0})),k.value?(n(),P(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,Ht)):i("",!0),e(r).state.userLogined?(n(),c("span",{key:4,class:"show opacity-item reply-btn",onClick:M}," 回复 ")):i("",!0)])])])])}}});const Yt=ee(Ft,[["__scopeId","data-v-783f5693"]]),Kt={class:"reply-compose-wrap"},Jt={class:"reply-switch"},Gt={class:"time-item"},Qt={class:"actions"},Wt={key:0,class:"action-item"},Xt={class:"upvote-count"},Zt=["onClick"],es={class:"upvote-count"},ts={key:2,class:"action-item"},ss=["onClick"],os={key:0,class:"reply-input-wrap"},ns=G({__name:"compose-reply",props:{comment:null,atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(L,{expose:N,emit:l}){const r=L,h=Z(),k=u(),b=u(!1),R=u(""),_=u(!1),M=+"100",v=u(r.comment.is_thumbs_up==ce.YES),f=u(r.comment.is_thumbs_down==ce.YES),x=u(r.comment.thumbs_up_count),s=()=>{Me({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then(I=>{v.value=!v.value,v.value?(x.value++,f.value=!1):x.value--}).catch(I=>{console.log(I)})},w=()=>{Ae({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then(I=>{f.value=!f.value,f.value&&v.value&&(x.value--,v.value=!1)}).catch(I=>{console.log(I)})},g=I=>{b.value=I,I?setTimeout(()=>{var S;(S=k.value)==null||S.focus()},10):(_.value=!1,R.value="",l("reset"))},A=()=>{_.value=!0,De({comment_id:r.comment.id,at_user_id:r.atUserid,content:R.value}).then(I=>{g(!1),window.$message.success("评论成功"),l("reload")}).catch(I=>{_.value=!1})};return N({switchReply:g}),(I,S)=>{const O=te,K=ot,B=se,Y=nt;return n(),c("div",Kt,[d("div",Jt,[d("span",Gt,z(e(ie)(L.comment.created_on)),1),d("div",Qt,[e(h).state.userLogined?i("",!0):(n(),c("div",Wt,[t(O,{size:"medium"},{default:a(()=>[t(e(ue))]),_:1}),d("span",Xt,z(x.value),1)])),e(h).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:H(s,["stop"])},[t(O,{size:"medium"},{default:a(()=>[v.value?i("",!0):(n(),P(e(ue),{key:0})),v.value?(n(),P(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",es,z(x.value),1)],8,Zt)):i("",!0),e(h).state.userLogined?i("",!0):(n(),c("div",ts,[t(O,{size:"medium"},{default:a(()=>[t(e(re))]),_:1})])),e(h).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:H(w,["stop"])},[t(O,{size:"medium"},{default:a(()=>[f.value?i("",!0):(n(),P(e(re),{key:0})),f.value?(n(),P(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,ss)):i("",!0),e(h).state.userLogined&&!b.value?(n(),c("span",{key:4,class:"show reply-btn",onClick:S[0]||(S[0]=T=>g(!0))}," 回复 ")):i("",!0),e(h).state.userLogined&&b.value?(n(),c("span",{key:5,class:"hide reply-btn",onClick:S[1]||(S[1]=T=>g(!1))}," 取消 ")):i("",!0)])]),b.value?(n(),c("div",os,[t(Y,null,{default:a(()=>[t(K,{ref_key:"inputInstRef",ref:k,size:"small",placeholder:r.atUsername?"@"+r.atUsername:"请输入回复内容..",maxlength:e(M),value:R.value,"onUpdate:value":S[2]||(S[2]=T=>R.value=T),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(B,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:A},{default:a(()=>[U(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const as=ee(ns,[["__scopeId","data-v-8de6ada0"]]),ls={class:"comment-item"},is={class:"nickname-wrap"},cs={class:"username-wrap"},us={class:"opt-wrap"},rs={class:"timestamp"},_s=["innerHTML"],ps={class:"reply-wrap"},ds=G({__name:"comment-item",props:{comment:null},emits:["reload"],setup(L,{emit:N}){const l=L,r=Z(),h=Te(),k=u(0),b=u(""),R=u(),_=ne(()=>{let w=Object.assign({texts:[],imgs:[]},l.comment);return w.contents.map(g=>{(+g.type==1||+g.type==2)&&w.texts.push(g),+g.type==3&&w.imgs.push(g)}),w}),M=(w,g)=>{let A=w.target;if(A.dataset.detail){const I=A.dataset.detail.split(":");I.length===2&&(r.commit("refresh"),I[0]==="tag"?window.$message.warning("评论内的无效话题"):h.push({name:"user",query:{username:I[1]}}))}},v=w=>{var g,A;k.value=w.user_id,b.value=((g=w.user)==null?void 0:g.username)||"",(A=R.value)==null||A.switchReply(!0)},f=()=>{N("reload")},x=()=>{k.value=0,b.value=""},s=()=>{Oe({id:_.value.id}).then(w=>{window.$message.success("删除成功"),setTimeout(()=>{f()},50)}).catch(w=>{})};return(w,g)=>{const A=ve,I=de("router-link"),S=te,O=se,K=$e,B=Ie,Y=as,T=Yt,D=Ce;return n(),c("div",ls,[t(D,{"content-indented":""},Ue({avatar:a(()=>[t(A,{round:"",size:30,src:e(_).user.avatar},null,8,["src"])]),header:a(()=>[d("span",is,[t(I,{onClick:g[0]||(g[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(_).user.username}}},{default:a(()=>[U(z(e(_).user.nickname),1)]),_:1},8,["to"])]),d("span",cs," @"+z(e(_).user.username),1)]),"header-extra":a(()=>[d("div",us,[d("span",rs,z(e(_).ip_loc),1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(_).user.id?(n(),P(K,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:s},{trigger:a(()=>[t(O,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(S,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[U(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:a(()=>[e(_).imgs.length>0?(n(),P(B,{key:0,imgs:e(_).imgs},null,8,["imgs"])):i("",!0),t(Y,{ref_key:"replyComposeRef",ref:R,comment:e(_),"at-userid":k.value,"at-username":b.value,onReload:f,onReset:x},null,8,["comment","at-userid","at-username"]),d("div",ps,[(n(!0),c(ae,null,le(e(_).replies,o=>(n(),P(T,{key:o.id,reply:o,"tweet-id":e(_).post_id,onFocusReply:v,onReload:f},null,8,["reply","tweet-id"]))),128))])]),_:2},[e(_).texts.length>0?{name:"description",fn:a(()=>[(n(!0),c(ae,null,le(e(_).texts,o=>(n(),c("span",{key:o.id,class:"comment-text",onClick:g[1]||(g[1]=H(m=>M(m,e(_).id),["stop"])),innerHTML:e(fe)(o.content).content},null,8,_s))),128))]),key:"0"}:void 0]),1024)])}}});const ms=ee(ds,[["__scopeId","data-v-f206d4d8"]]),vs=L=>(ge("data-v-bd19dbe6"),L=L(),ye(),L),fs={key:0,class:"compose-wrap"},hs={class:"compose-line"},gs={class:"compose-user"},ys={class:"compose-line compose-options"},ks={class:"attachment"},ws={class:"submit-wrap"},bs={class:"attachment-list-wrap"},$s={key:1,class:"compose-wrap"},Cs=vs(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),xs={key:0,class:"login-only-wrap"},Is={key:1,class:"login-wrap"},Ts=G({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(L,{emit:N}){const l=L,r=Z(),h=u([]),k=u(!1),b=u(!1),R=u(!1),_=u(""),M=u(),v=u("public/image"),f=u([]),x=u([]),s=u("true".toLowerCase()==="true"),w=+"200",g="/v1/attachment",A=u(),I=It.debounce(p=>{qe({k:p}).then(y=>{let $=[];y.suggest.map(C=>{$.push({label:C,value:C})}),h.value=$,b.value=!1}).catch(y=>{b.value=!1})},200),S=(p,y)=>{b.value||(b.value=!0,y==="@"&&I(p))},O=p=>{p.length>200||(_.value=p)},K=p=>{v.value=p},B=p=>{for(let j=0;j30&&(p[j].name=$.substring(0,18)+"..."+$.substring($.length-9)+"."+C)}f.value=p},Y=async p=>{var y,$;return v.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((y=p.file.file)==null?void 0:y.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):v.value==="image"&&(($=p.file.file)==null?void 0:$.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},T=({file:p,event:y})=>{var $;try{let C=JSON.parse(($=y.target)==null?void 0:$.response);C.code===0&&v.value==="public/image"&&x.value.push({id:p.id,content:C.data.content})}catch{window.$message.error("上传失败")}},D=({file:p,event:y})=>{var $;try{let C=JSON.parse(($=y.target)==null?void 0:$.response);if(C.code!==0){let j=C.msg||"上传失败";C.details&&C.details.length>0&&C.details.map(V=>{j+=":"+V}),window.$message.error(j)}}catch{window.$message.error("上传失败")}},o=({file:p})=>{let y=x.value.findIndex($=>$.id===p.id);y>-1&&x.value.splice(y,1)},m=()=>{k.value=!0},E=()=>{var p;k.value=!1,(p=M.value)==null||p.clear(),f.value=[],_.value="",x.value=[]},Q=()=>{if(_.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:p}=fe(_.value);const y=[];let $=100;y.push({content:_.value,type:2,sort:$}),x.value.map(C=>{$++,y.push({content:C.content,type:3,sort:$})}),R.value=!0,Ne({contents:y,post_id:l.postId,users:Array.from(new Set(p))}).then(C=>{window.$message.success("发布成功"),R.value=!1,N("post-success"),E()}).catch(C=>{R.value=!1})},F=p=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",p)};return me(()=>{A.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(p,y)=>{const $=ve,C=at,j=te,V=se,W=lt,J=it,oe=ct,_e=ut,pe=rt;return n(),c("div",null,[e(r).state.userInfo.id>0?(n(),c("div",fs,[d("div",hs,[d("div",gs,[t($,{round:"",size:30,src:e(r).state.userInfo.avatar},null,8,["src"])]),t(C,{type:"textarea",size:"large",autosize:"",bordered:!1,options:h.value,prefix:["@"],loading:b.value,value:_.value,disabled:l.lock===1,"onUpdate:value":O,onSearch:S,onFocus:m,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),k.value?(n(),P(pe,{key:0,ref_key:"uploadRef",ref:M,abstract:"","list-type":"image",multiple:!0,max:9,action:g,headers:{Authorization:A.value},data:{type:v.value},"file-list":f.value,onBeforeUpload:Y,onFinish:T,onError:D,onRemove:o,"onUpdate:fileList":B},{default:a(()=>[d("div",ys,[d("div",ks,[t(W,{abstract:""},{default:a(({handleClick:q})=>[t(V,{disabled:f.value.length>0&&v.value==="public/video"||f.value.length===9,onClick:()=>{K("public/image"),q()},quaternary:"",circle:"",type:"primary"},{icon:a(()=>[t(j,{size:"20",color:"var(--primary-color)"},{default:a(()=>[t(e(Ge))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(oe,{trigger:"hover",placement:"bottom"},{trigger:a(()=>[t(J,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:_.value.length/e(w)*100},null,8,["percentage"])]),default:a(()=>[U(" "+z(_.value.length)+" / "+z(e(w)),1)]),_:1})]),d("div",ws,[t(V,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:E},{default:a(()=>[U(" 取消 ")]),_:1}),t(V,{loading:R.value,onClick:Q,type:"primary",secondary:"",size:"small",round:""},{default:a(()=>[U(" 发布 ")]),_:1},8,["loading"])])]),d("div",bs,[t(_e)])]),_:1},8,["headers","data","file-list"])):i("",!0)])):(n(),c("div",$s,[Cs,s.value?i("",!0):(n(),c("div",xs,[t(V,{strong:"",secondary:"",round:"",type:"primary",onClick:y[0]||(y[0]=q=>F("signin"))},{default:a(()=>[U(" 登录 ")]),_:1})])),s.value?(n(),c("div",Is,[t(V,{strong:"",secondary:"",round:"",type:"primary",onClick:y[1]||(y[1]=q=>F("signin"))},{default:a(()=>[U(" 登录 ")]),_:1}),t(V,{strong:"",secondary:"",round:"",type:"info",onClick:y[2]||(y[2]=q=>F("signup"))},{default:a(()=>[U(" 注册 ")]),_:1})])):i("",!0)]))])}}});const zs=ee(Ts,[["__scopeId","data-v-bd19dbe6"]]),Us={class:"username-wrap"},Ps={key:0,class:"options"},Rs={key:0},Ss=["innerHTML"],Ls={class:"timestamp"},Ms={key:0},As={key:1},Ds={class:"opts-wrap"},Os=["onClick"],qs={class:"opt-item"},Ns=["onClick"],js=["onClick"],Bs=G({__name:"post-detail",props:{post:null},emits:["reload"],setup(L,{emit:N}){const l=L,r=Z(),h=Te(),k=u(!1),b=u(!1),R=u(!1),_=u(!1),M=u(!1),v=u(!1),f=u(!1),x=u(X.PUBLIC),s=ne({get:()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return o.contents.map(m=>{(+m.type==1||+m.type==2)&&o.texts.push(m),+m.type==3&&o.imgs.push(m),+m.type==4&&o.videos.push(m),+m.type==6&&o.links.push(m),+m.type==7&&o.attachments.push(m),+m.type==8&&o.charge_attachments.push(m)}),o},set:o=>{l.post.upvote_count=o.upvote_count,l.post.comment_count=o.comment_count,l.post.collection_count=o.collection_count}}),w=ne(()=>{let o=[{label:"删除",key:"delete"}];return s.value.is_lock===0?o.push({label:"锁定",key:"lock"}):o.push({label:"解锁",key:"unlock"}),r.state.userInfo.is_admin&&(s.value.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"})),s.value.visibility===X.PUBLIC?o.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):s.value.visibility===X.PRIVATE?o.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):o.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),o}),g=o=>{h.push({name:"post",query:{id:o}})},A=(o,m)=>{if(o.target.dataset.detail){const E=o.target.dataset.detail.split(":");if(E.length===2){r.commit("refresh"),E[0]==="tag"?h.push({name:"home",query:{q:E[1],t:"tag"}}):h.push({name:"user",query:{username:E[1]}});return}}g(m)},I=o=>{switch(o){case"delete":R.value=!0;break;case"lock":case"unlock":_.value=!0;break;case"stick":case"unstick":M.value=!0;break;case"vpublic":x.value=0,v.value=!0;break;case"vprivate":x.value=1,v.value=!0;break;case"vfriend":x.value=2,v.value=!0;break}},S=()=>{Ee({id:s.value.id}).then(o=>{window.$message.success("删除成功"),h.replace("/"),setTimeout(()=>{r.commit("refresh")},50)}).catch(o=>{f.value=!1})},O=()=>{Ve({id:s.value.id}).then(o=>{N("reload"),o.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(o=>{f.value=!1})},K=()=>{He({id:s.value.id}).then(o=>{N("reload"),o.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(o=>{f.value=!1})},B=()=>{Fe({id:s.value.id,visibility:x.value}).then(o=>{N("reload"),window.$message.success("修改可见性成功")}).catch(o=>{f.value=!1})},Y=()=>{Ye({id:s.value.id}).then(o=>{k.value=o.status,o.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(o=>{console.log(o)})},T=()=>{Ke({id:s.value.id}).then(o=>{b.value=o.status,o.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(o=>{console.log(o)})},D=()=>{Tt(`${window.location.origin}/#/post?id=${s.value.id}`),window.$message.success("链接已复制到剪贴板")};return me(()=>{r.state.userInfo.id>0&&(je({id:s.value.id}).then(o=>{k.value=o.status}).catch(o=>{console.log(o)}),Be({id:s.value.id}).then(o=>{b.value=o.status}).catch(o=>{console.log(o)}))}),(o,m)=>{const E=ve,Q=de("router-link"),F=_t,p=te,y=se,$=pt,C=dt,j=wt,V=Ie,W=bt,J=$t,oe=mt,_e=xe,pe=Ce;return n(),c("div",{class:"detail-item",onClick:m[6]||(m[6]=q=>g(e(s).id))},[t(pe,null,{avatar:a(()=>[t(E,{round:"",size:30,src:e(s).user.avatar},null,8,["src"])]),header:a(()=>[t(Q,{onClick:m[0]||(m[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(s).user.username}}},{default:a(()=>[U(z(e(s).user.nickname),1)]),_:1},8,["to"]),d("span",Us," @"+z(e(s).user.username),1),e(s).is_top?(n(),P(F,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:a(()=>[U(" 置顶 ")]),_:1})):i("",!0),e(s).visibility==e(X).PRIVATE?(n(),P(F,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:a(()=>[U(" 私密 ")]),_:1})):i("",!0),e(s).visibility==e(X).FRIEND?(n(),P(F,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:a(()=>[U(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":a(()=>[e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(s).user.id?(n(),c("div",Ps,[t($,{placement:"bottom-end",trigger:"click",size:"small",options:e(w),onSelect:I},{default:a(()=>[t(y,{quaternary:"",circle:""},{icon:a(()=>[t(p,null,{default:a(()=>[t(e(Qe))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),t(C,{show:R.value,"onUpdate:show":m[1]||(m[1]=q=>R.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:S},null,8,["show"]),t(C,{show:_.value,"onUpdate:show":m[2]||(m[2]=q=>_.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:O},null,8,["show","content"]),t(C,{show:M.value,"onUpdate:show":m[3]||(m[3]=q=>M.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show","content"]),t(C,{show:v.value,"onUpdate:show":m[4]||(m[4]=q=>v.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(x.value==0?"公开":x.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:B},null,8,["show","content"])]),footer:a(()=>[t(j,{attachments:e(s).attachments},null,8,["attachments"]),t(j,{attachments:e(s).charge_attachments,price:e(s).attachment_price},null,8,["attachments","price"]),t(V,{imgs:e(s).imgs},null,8,["imgs"]),t(W,{videos:e(s).videos,full:!0},null,8,["videos"]),t(J,{links:e(s).links},null,8,["links"]),d("div",Ls,[U(" 发布于 "+z(e(ie)(e(s).created_on))+" ",1),e(s).ip_loc?(n(),c("span",Ms,[t(oe,{vertical:""}),U(" "+z(e(s).ip_loc),1)])):i("",!0),!e(r).state.collapsedLeft&&e(s).created_on!=e(s).latest_replied_on?(n(),c("span",As,[t(oe,{vertical:""}),U(" 最后回复 "+z(e(ie)(e(s).latest_replied_on)),1)])):i("",!0)])]),action:a(()=>[d("div",Ds,[t(_e,{justify:"space-between"},{default:a(()=>[d("div",{class:"opt-item hover",onClick:H(Y,["stop"])},[t(p,{size:"20",class:"opt-item-icon"},{default:a(()=>[k.value?i("",!0):(n(),P(e(We),{key:0})),k.value?(n(),P(e(Xe),{key:1,color:"red"})):i("",!0)]),_:1}),U(" "+z(e(s).upvote_count),1)],8,Os),d("div",qs,[t(p,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(Ze))]),_:1}),U(" "+z(e(s).comment_count),1)]),d("div",{class:"opt-item hover",onClick:H(T,["stop"])},[t(p,{size:"20",class:"opt-item-icon"},{default:a(()=>[b.value?i("",!0):(n(),P(e(et),{key:0})),b.value?(n(),P(e(tt),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),U(" "+z(e(s).collection_count),1)],8,Ns),d("div",{class:"opt-item hover",onClick:H(D,["stop"])},[t(p,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(st))]),_:1}),U(" "+z(e(s).share_count),1)],8,js)]),_:1})])]),default:a(()=>[e(s).texts.length>0?(n(),c("div",Rs,[(n(!0),c(ae,null,le(e(s).texts,q=>(n(),c("span",{key:q.id,class:"post-text",onClick:m[5]||(m[5]=H(ze=>A(ze,e(s).id),["stop"])),innerHTML:e(fe)(q.content).content},null,8,Ss))),128))])):i("",!0)]),_:1})])}}});const Es=L=>(ge("data-v-0d01659f"),L=L(),ye(),L),Vs={key:0,class:"detail-wrap"},Hs={key:1,class:"empty-wrap"},Fs={key:0,class:"comment-opts-wrap"},Ys=Es(()=>d("span",{class:"comment-title-item"},"评论",-1)),Ks={key:2},Js={key:0,class:"skeleton-wrap"},Gs={key:1},Qs={key:0,class:"empty-wrap"},Ws={key:0,class:"load-more-spinner"},Xs={key:1,class:"load-more-spinner"},Zs={key:2,class:"load-more-spinner"},eo={key:3,class:"load-more-spinner"},to=G({__name:"Post",setup(L){const N=Ct(),l=u({}),r=u(!1),h=u(!1),k=u([]),b=ne(()=>+N.query.id),R=u("default"),_=u(!0),M=20;let v={loading(){},loaded(){},complete(){},error(){}};const f=T=>{R.value=T,T==="default"&&(_.value=!0),B(v)},x=()=>{l.value={id:0},r.value=!0,Je({id:b.value}).then(T=>{r.value=!1,l.value=T,B(v)}).catch(T=>{r.value=!1})};let s=1;const w=u(!1),g=u([]),A=T=>{w.value||he({id:l.value.id,sort_strategy:"default",page:s,page_size:M}).then(D=>{T!==null&&(v=T),D.list.length0&&(s===1?g.value=D.list:g.value.push(...D.list),k.value=g.value),v.loaded(),h.value=!1}).catch(D=>{h.value=!1,v.error()})};let I=1,S=u(!1);const O=u([]),K=T=>{S.value||he({id:l.value.id,sort_strategy:"newest",page:I,page_size:M}).then(D=>{T!==null&&(v=T),D.list.length0&&(I===1?O.value=D.list:O.value.push(...D.list),k.value=O.value),v.loaded(),h.value=!1}).catch(D=>{h.value=!1,v.error()})},B=T=>{b.value<1||(k.value.length===0&&(h.value=!0),R.value==="default"?(k.value=g.value,A(T)):(k.value=O.value,K(T)),h.value=!1)},Y=()=>{s=1,w.value=!1,g.value=[],I=1,S.value=!1,O.value=[],B(v)};return me(()=>{x()}),Pe(b,()=>{b.value>0&&N.name==="post"&&x()}),(T,D)=>{const o=zt,m=Bs,E=ft,Q=ht,F=gt,p=yt,y=kt,$=zs,C=xt,j=ms,V=xe,W=vt;return n(),c("div",null,[t(o,{title:"泡泡详情",back:!0}),t(W,{class:"main-content-wrap",bordered:""},{default:a(()=>[t(F,null,{default:a(()=>[t(Q,{show:r.value},{default:a(()=>[l.value.id>1?(n(),c("div",Vs,[t(m,{post:l.value,onReload:x},null,8,["post"])])):(n(),c("div",Hs,[t(E,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(n(),c("div",Fs,[t(y,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":f},{prefix:a(()=>[Ys]),default:a(()=>[t(p,{name:"default",tab:"默认"}),t(p,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(n(),P(F,{key:1},{default:a(()=>[t($,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:Y},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(n(),c("div",Ks,[h.value?(n(),c("div",Js,[t(C,{num:5})])):(n(),c("div",Gs,[k.value.length===0?(n(),c("div",Qs,[t(E,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(n(!0),c(ae,null,le(k.value,J=>(n(),P(F,{key:J.id},{default:a(()=>[t(j,{comment:J,onReload:Y},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),k.value.length>=M?(n(),P(V,{key:3,justify:"center"},{default:a(()=>[t(e(Ut),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:B},{spinner:a(()=>[_.value&&w.value?(n(),c("span",Ws)):i("",!0),!_.value&&e(S)?(n(),c("span",Xs)):i("",!0),_.value&&!w.value?(n(),c("span",Zs,"加载评论")):i("",!0),!_.value&&!e(S)?(n(),c("span",eo,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const Ao=ee(to,[["__scopeId","data-v-0d01659f"]]);export{Ao as default}; diff --git a/web/dist/assets/Post-ace100c6.js b/web/dist/assets/Post-ace100c6.js new file mode 100644 index 00000000..c6d1f713 --- /dev/null +++ b/web/dist/assets/Post-ace100c6.js @@ -0,0 +1 @@ +import{d as G,r as u,a1 as de,o as n,c,a as d,L as t,$ as a,e as U,M as z,K as P,O as i,Y as e,a0 as H,n as ne,a6 as Ue,F as ae,a2 as le,j as me,U as ge,V as ye,w as Pe}from"./@vue-ca177dbe.js";import{u as Z}from"./vuex-d28e9067.js";import{f as ie}from"./formatTime-000dbebb.js";import{t as Re,d as Se,e as Le,_ as ee,f as Me,h as Ae,i as De,j as Oe,g as qe,k as Ne,l as je,m as Be,n as Ee,o as Ve,s as He,v as Fe,p as Ye,q as Ke,r as Je,u as he}from"./index-effb87c4.js";import{Y as ce,V as X}from"./IEnum-a180d93e.js";import{T as ke,e as ue,f as we,g as re,h as be,I as Ge,i as Qe,j as We,k as Xe,l as Ze,m as et,n as tt,o as st}from"./@vicons-6d35273b.js";import{j as te,e as se,J as $e,b as ot,K as nt,o as ve,L as Ce,v as at,w as lt,x as it,y as ct,z as ut,B as rt,M as _t,O as pt,i as dt,P as mt,a as xe,F as vt,I as ft,k as ht,H as gt,f as yt,g as kt}from"./naive-ui-2035804c.js";import{p as fe,_ as Ie,a as wt,b as bt,c as $t}from"./content-6a6aebc0.js";import{u as Te,b as Ct}from"./vue-router-88cc84d1.js";import{_ as xt}from"./post-skeleton-6893dc8f.js";import{l as It}from"./lodash-94eb5868.js";import{a as Tt}from"./copy-to-clipboard-1dd3075d.js";import{_ as zt}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{K as Ut}from"./v3-infinite-loading-fcb59c38.js";import"./moment-b7869f98.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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-db921567.js";import"./toggle-selection-93f4ad84.js";const Pt={class:"reply-item"},Rt={class:"header-wrap"},St={class:"username"},Lt={class:"reply-name"},Mt={class:"timestamp"},At={class:"base-wrap"},Dt={class:"content"},Ot={class:"reply-switch"},qt={class:"time-item"},Nt={class:"actions"},jt={class:"upvote-count"},Bt=["onClick"],Et={class:"upvote-count"},Vt={key:2,class:"action-item"},Ht=["onClick"],Ft=G({__name:"reply-item",props:{tweetId:null,reply:null},emits:["focusReply","reload"],setup(L,{emit:N}){const l=L,r=Z(),h=u(l.reply.is_thumbs_up==ce.YES),k=u(l.reply.is_thumbs_down==ce.YES),w=u(l.reply.thumbs_up_count),R=()=>{Re({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(f=>{h.value=!h.value,h.value?(w.value++,k.value=!1):w.value--}).catch(f=>{console.log(f)})},_=()=>{Se({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(f=>{k.value=!k.value,k.value&&h.value&&(w.value--,h.value=!1)}).catch(f=>{console.log(f)})},M=()=>{N("focusReply",l.reply)},v=()=>{Le({id:l.reply.id}).then(f=>{window.$message.success("删除成功"),setTimeout(()=>{N("reload")},50)}).catch(f=>{console.log(f)})};return(f,$)=>{const s=de("router-link"),b=te,g=se,A=$e;return n(),c("div",Pt,[d("div",Rt,[d("div",St,[t(s,{class:"user-link",to:{name:"user",query:{username:l.reply.user.username}}},{default:a(()=>[U(z(l.reply.user.username),1)]),_:1},8,["to"]),d("span",Lt,z(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(n(),P(s,{key:0,class:"user-link",to:{name:"user",query:{username:l.reply.at_user.username}}},{default:a(()=>[U(z(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),d("div",Mt,[U(z(l.reply.ip_loc)+" ",1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===l.reply.user.id?(n(),P(A,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:v},{trigger:a(()=>[t(g,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(b,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[U(" 是否确认删除? ")]),_:1})):i("",!0)])]),d("div",At,[d("div",Dt,z(l.reply.content),1),d("div",Ot,[d("span",qt,z(e(ie)(l.reply.created_on)),1),d("div",Nt,[e(r).state.userLogined?i("",!0):(n(),c("div",{key:0,class:"action-item",onClick:$[0]||($[0]=H(()=>{},["stop"]))},[t(b,{size:"medium"},{default:a(()=>[t(e(ue))]),_:1}),d("span",jt,z(w.value),1)])),e(r).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:H(R,["stop"])},[t(b,{size:"medium"},{default:a(()=>[h.value?i("",!0):(n(),P(e(ue),{key:0})),h.value?(n(),P(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",Et,z(w.value>0?w.value:"赞"),1)],8,Bt)):i("",!0),e(r).state.userLogined?i("",!0):(n(),c("div",Vt,[t(b,{size:"medium"},{default:a(()=>[t(e(re))]),_:1})])),e(r).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:H(_,["stop"])},[t(b,{size:"medium"},{default:a(()=>[k.value?i("",!0):(n(),P(e(re),{key:0})),k.value?(n(),P(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,Ht)):i("",!0),e(r).state.userLogined?(n(),c("span",{key:4,class:"show opacity-item reply-btn",onClick:M}," 回复 ")):i("",!0)])])])])}}});const Yt=ee(Ft,[["__scopeId","data-v-1ac7a555"]]),Kt={class:"reply-compose-wrap"},Jt={class:"reply-switch"},Gt={class:"time-item"},Qt={class:"actions"},Wt={key:0,class:"action-item"},Xt={class:"upvote-count"},Zt=["onClick"],es={class:"upvote-count"},ts={key:2,class:"action-item"},ss=["onClick"],os={key:0,class:"reply-input-wrap"},ns=G({__name:"compose-reply",props:{comment:null,atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(L,{expose:N,emit:l}){const r=L,h=Z(),k=u(),w=u(!1),R=u(""),_=u(!1),M=+"100",v=u(r.comment.is_thumbs_up==ce.YES),f=u(r.comment.is_thumbs_down==ce.YES),$=u(r.comment.thumbs_up_count),s=()=>{Me({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then(I=>{v.value=!v.value,v.value?($.value++,f.value=!1):$.value--}).catch(I=>{console.log(I)})},b=()=>{Ae({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then(I=>{f.value=!f.value,f.value&&v.value&&($.value--,v.value=!1)}).catch(I=>{console.log(I)})},g=I=>{w.value=I,I?setTimeout(()=>{var S;(S=k.value)==null||S.focus()},10):(_.value=!1,R.value="",l("reset"))},A=()=>{_.value=!0,De({comment_id:r.comment.id,at_user_id:r.atUserid,content:R.value}).then(I=>{g(!1),window.$message.success("评论成功"),l("reload")}).catch(I=>{_.value=!1})};return N({switchReply:g}),(I,S)=>{const O=te,K=ot,B=se,Y=nt;return n(),c("div",Kt,[d("div",Jt,[d("span",Gt,z(e(ie)(L.comment.created_on)),1),d("div",Qt,[e(h).state.userLogined?i("",!0):(n(),c("div",Wt,[t(O,{size:"medium"},{default:a(()=>[t(e(ue))]),_:1}),d("span",Xt,z($.value),1)])),e(h).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:H(s,["stop"])},[t(O,{size:"medium"},{default:a(()=>[v.value?i("",!0):(n(),P(e(ue),{key:0})),v.value?(n(),P(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",es,z($.value>0?$.value:"赞"),1)],8,Zt)):i("",!0),e(h).state.userLogined?i("",!0):(n(),c("div",ts,[t(O,{size:"medium"},{default:a(()=>[t(e(re))]),_:1})])),e(h).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:H(b,["stop"])},[t(O,{size:"medium"},{default:a(()=>[f.value?i("",!0):(n(),P(e(re),{key:0})),f.value?(n(),P(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,ss)):i("",!0),e(h).state.userLogined&&!w.value?(n(),c("span",{key:4,class:"show reply-btn",onClick:S[0]||(S[0]=T=>g(!0))}," 回复 ")):i("",!0),e(h).state.userLogined&&w.value?(n(),c("span",{key:5,class:"hide reply-btn",onClick:S[1]||(S[1]=T=>g(!1))}," 取消 ")):i("",!0)])]),w.value?(n(),c("div",os,[t(Y,null,{default:a(()=>[t(K,{ref_key:"inputInstRef",ref:k,size:"small",placeholder:r.atUsername?"@"+r.atUsername:"请输入回复内容..",maxlength:e(M),value:R.value,"onUpdate:value":S[2]||(S[2]=T=>R.value=T),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(B,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:A},{default:a(()=>[U(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const as=ee(ns,[["__scopeId","data-v-f9af7a93"]]),ls={class:"comment-item"},is={class:"nickname-wrap"},cs={class:"username-wrap"},us={class:"opt-wrap"},rs={class:"timestamp"},_s=["innerHTML"],ps={class:"reply-wrap"},ds=G({__name:"comment-item",props:{comment:null},emits:["reload"],setup(L,{emit:N}){const l=L,r=Z(),h=Te(),k=u(0),w=u(""),R=u(),_=ne(()=>{let b=Object.assign({texts:[],imgs:[]},l.comment);return b.contents.map(g=>{(+g.type==1||+g.type==2)&&b.texts.push(g),+g.type==3&&b.imgs.push(g)}),b}),M=(b,g)=>{let A=b.target;if(A.dataset.detail){const I=A.dataset.detail.split(":");I.length===2&&(r.commit("refresh"),I[0]==="tag"?window.$message.warning("评论内的无效话题"):h.push({name:"user",query:{username:I[1]}}))}},v=b=>{var g,A;k.value=b.user_id,w.value=((g=b.user)==null?void 0:g.username)||"",(A=R.value)==null||A.switchReply(!0)},f=()=>{N("reload")},$=()=>{k.value=0,w.value=""},s=()=>{Oe({id:_.value.id}).then(b=>{window.$message.success("删除成功"),setTimeout(()=>{f()},50)}).catch(b=>{})};return(b,g)=>{const A=ve,I=de("router-link"),S=te,O=se,K=$e,B=Ie,Y=as,T=Yt,D=Ce;return n(),c("div",ls,[t(D,{"content-indented":""},Ue({avatar:a(()=>[t(A,{round:"",size:30,src:e(_).user.avatar},null,8,["src"])]),header:a(()=>[d("span",is,[t(I,{onClick:g[0]||(g[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(_).user.username}}},{default:a(()=>[U(z(e(_).user.nickname),1)]),_:1},8,["to"])]),d("span",cs," @"+z(e(_).user.username),1)]),"header-extra":a(()=>[d("div",us,[d("span",rs,z(e(_).ip_loc),1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(_).user.id?(n(),P(K,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:s},{trigger:a(()=>[t(O,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(S,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[U(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:a(()=>[e(_).imgs.length>0?(n(),P(B,{key:0,imgs:e(_).imgs},null,8,["imgs"])):i("",!0),t(Y,{ref_key:"replyComposeRef",ref:R,comment:e(_),"at-userid":k.value,"at-username":w.value,onReload:f,onReset:$},null,8,["comment","at-userid","at-username"]),d("div",ps,[(n(!0),c(ae,null,le(e(_).replies,o=>(n(),P(T,{key:o.id,reply:o,"tweet-id":e(_).post_id,onFocusReply:v,onReload:f},null,8,["reply","tweet-id"]))),128))])]),_:2},[e(_).texts.length>0?{name:"description",fn:a(()=>[(n(!0),c(ae,null,le(e(_).texts,o=>(n(),c("span",{key:o.id,class:"comment-text",onClick:g[1]||(g[1]=H(m=>M(m,e(_).id),["stop"])),innerHTML:e(fe)(o.content).content},null,8,_s))),128))]),key:"0"}:void 0]),1024)])}}});const ms=ee(ds,[["__scopeId","data-v-f206d4d8"]]),vs=L=>(ge("data-v-bd19dbe6"),L=L(),ye(),L),fs={key:0,class:"compose-wrap"},hs={class:"compose-line"},gs={class:"compose-user"},ys={class:"compose-line compose-options"},ks={class:"attachment"},ws={class:"submit-wrap"},bs={class:"attachment-list-wrap"},$s={key:1,class:"compose-wrap"},Cs=vs(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),xs={key:0,class:"login-only-wrap"},Is={key:1,class:"login-wrap"},Ts=G({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(L,{emit:N}){const l=L,r=Z(),h=u([]),k=u(!1),w=u(!1),R=u(!1),_=u(""),M=u(),v=u("public/image"),f=u([]),$=u([]),s=u("true".toLowerCase()==="true"),b=+"200",g="/v1/attachment",A=u(),I=It.debounce(p=>{qe({k:p}).then(y=>{let C=[];y.suggest.map(x=>{C.push({label:x,value:x})}),h.value=C,w.value=!1}).catch(y=>{w.value=!1})},200),S=(p,y)=>{w.value||(w.value=!0,y==="@"&&I(p))},O=p=>{p.length>200||(_.value=p)},K=p=>{v.value=p},B=p=>{for(let j=0;j30&&(p[j].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+x)}f.value=p},Y=async p=>{var y,C;return v.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((y=p.file.file)==null?void 0:y.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):v.value==="image"&&((C=p.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},T=({file:p,event:y})=>{var C;try{let x=JSON.parse((C=y.target)==null?void 0:C.response);x.code===0&&v.value==="public/image"&&$.value.push({id:p.id,content:x.data.content})}catch{window.$message.error("上传失败")}},D=({file:p,event:y})=>{var C;try{let x=JSON.parse((C=y.target)==null?void 0:C.response);if(x.code!==0){let j=x.msg||"上传失败";x.details&&x.details.length>0&&x.details.map(V=>{j+=":"+V}),window.$message.error(j)}}catch{window.$message.error("上传失败")}},o=({file:p})=>{let y=$.value.findIndex(C=>C.id===p.id);y>-1&&$.value.splice(y,1)},m=()=>{k.value=!0},E=()=>{var p;k.value=!1,(p=M.value)==null||p.clear(),f.value=[],_.value="",$.value=[]},Q=()=>{if(_.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:p}=fe(_.value);const y=[];let C=100;y.push({content:_.value,type:2,sort:C}),$.value.map(x=>{C++,y.push({content:x.content,type:3,sort:C})}),R.value=!0,Ne({contents:y,post_id:l.postId,users:Array.from(new Set(p))}).then(x=>{window.$message.success("发布成功"),R.value=!1,N("post-success"),E()}).catch(x=>{R.value=!1})},F=p=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",p)};return me(()=>{A.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(p,y)=>{const C=ve,x=at,j=te,V=se,W=lt,J=it,oe=ct,_e=ut,pe=rt;return n(),c("div",null,[e(r).state.userInfo.id>0?(n(),c("div",fs,[d("div",hs,[d("div",gs,[t(C,{round:"",size:30,src:e(r).state.userInfo.avatar},null,8,["src"])]),t(x,{type:"textarea",size:"large",autosize:"",bordered:!1,options:h.value,prefix:["@"],loading:w.value,value:_.value,disabled:l.lock===1,"onUpdate:value":O,onSearch:S,onFocus:m,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),k.value?(n(),P(pe,{key:0,ref_key:"uploadRef",ref:M,abstract:"","list-type":"image",multiple:!0,max:9,action:g,headers:{Authorization:A.value},data:{type:v.value},"file-list":f.value,onBeforeUpload:Y,onFinish:T,onError:D,onRemove:o,"onUpdate:fileList":B},{default:a(()=>[d("div",ys,[d("div",ks,[t(W,{abstract:""},{default:a(({handleClick:q})=>[t(V,{disabled:f.value.length>0&&v.value==="public/video"||f.value.length===9,onClick:()=>{K("public/image"),q()},quaternary:"",circle:"",type:"primary"},{icon:a(()=>[t(j,{size:"20",color:"var(--primary-color)"},{default:a(()=>[t(e(Ge))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(oe,{trigger:"hover",placement:"bottom"},{trigger:a(()=>[t(J,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:_.value.length/e(b)*100},null,8,["percentage"])]),default:a(()=>[U(" "+z(_.value.length)+" / "+z(e(b)),1)]),_:1})]),d("div",ws,[t(V,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:E},{default:a(()=>[U(" 取消 ")]),_:1}),t(V,{loading:R.value,onClick:Q,type:"primary",secondary:"",size:"small",round:""},{default:a(()=>[U(" 发布 ")]),_:1},8,["loading"])])]),d("div",bs,[t(_e)])]),_:1},8,["headers","data","file-list"])):i("",!0)])):(n(),c("div",$s,[Cs,s.value?i("",!0):(n(),c("div",xs,[t(V,{strong:"",secondary:"",round:"",type:"primary",onClick:y[0]||(y[0]=q=>F("signin"))},{default:a(()=>[U(" 登录 ")]),_:1})])),s.value?(n(),c("div",Is,[t(V,{strong:"",secondary:"",round:"",type:"primary",onClick:y[1]||(y[1]=q=>F("signin"))},{default:a(()=>[U(" 登录 ")]),_:1}),t(V,{strong:"",secondary:"",round:"",type:"info",onClick:y[2]||(y[2]=q=>F("signup"))},{default:a(()=>[U(" 注册 ")]),_:1})])):i("",!0)]))])}}});const zs=ee(Ts,[["__scopeId","data-v-bd19dbe6"]]),Us={class:"username-wrap"},Ps={key:0,class:"options"},Rs={key:0},Ss=["innerHTML"],Ls={class:"timestamp"},Ms={key:0},As={key:1},Ds={class:"opts-wrap"},Os=["onClick"],qs={class:"opt-item"},Ns=["onClick"],js=["onClick"],Bs=G({__name:"post-detail",props:{post:null},emits:["reload"],setup(L,{emit:N}){const l=L,r=Z(),h=Te(),k=u(!1),w=u(!1),R=u(!1),_=u(!1),M=u(!1),v=u(!1),f=u(!1),$=u(X.PUBLIC),s=ne({get:()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return o.contents.map(m=>{(+m.type==1||+m.type==2)&&o.texts.push(m),+m.type==3&&o.imgs.push(m),+m.type==4&&o.videos.push(m),+m.type==6&&o.links.push(m),+m.type==7&&o.attachments.push(m),+m.type==8&&o.charge_attachments.push(m)}),o},set:o=>{l.post.upvote_count=o.upvote_count,l.post.comment_count=o.comment_count,l.post.collection_count=o.collection_count}}),b=ne(()=>{let o=[{label:"删除",key:"delete"}];return s.value.is_lock===0?o.push({label:"锁定",key:"lock"}):o.push({label:"解锁",key:"unlock"}),r.state.userInfo.is_admin&&(s.value.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"})),s.value.visibility===X.PUBLIC?o.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):s.value.visibility===X.PRIVATE?o.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):o.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),o}),g=o=>{h.push({name:"post",query:{id:o}})},A=(o,m)=>{if(o.target.dataset.detail){const E=o.target.dataset.detail.split(":");if(E.length===2){r.commit("refresh"),E[0]==="tag"?h.push({name:"home",query:{q:E[1],t:"tag"}}):h.push({name:"user",query:{username:E[1]}});return}}g(m)},I=o=>{switch(o){case"delete":R.value=!0;break;case"lock":case"unlock":_.value=!0;break;case"stick":case"unstick":M.value=!0;break;case"vpublic":$.value=0,v.value=!0;break;case"vprivate":$.value=1,v.value=!0;break;case"vfriend":$.value=2,v.value=!0;break}},S=()=>{Ee({id:s.value.id}).then(o=>{window.$message.success("删除成功"),h.replace("/"),setTimeout(()=>{r.commit("refresh")},50)}).catch(o=>{f.value=!1})},O=()=>{Ve({id:s.value.id}).then(o=>{N("reload"),o.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(o=>{f.value=!1})},K=()=>{He({id:s.value.id}).then(o=>{N("reload"),o.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(o=>{f.value=!1})},B=()=>{Fe({id:s.value.id,visibility:$.value}).then(o=>{N("reload"),window.$message.success("修改可见性成功")}).catch(o=>{f.value=!1})},Y=()=>{Ye({id:s.value.id}).then(o=>{k.value=o.status,o.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(o=>{console.log(o)})},T=()=>{Ke({id:s.value.id}).then(o=>{w.value=o.status,o.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(o=>{console.log(o)})},D=()=>{Tt(`${window.location.origin}/#/post?id=${s.value.id}`),window.$message.success("链接已复制到剪贴板")};return me(()=>{r.state.userInfo.id>0&&(je({id:s.value.id}).then(o=>{k.value=o.status}).catch(o=>{console.log(o)}),Be({id:s.value.id}).then(o=>{w.value=o.status}).catch(o=>{console.log(o)}))}),(o,m)=>{const E=ve,Q=de("router-link"),F=_t,p=te,y=se,C=pt,x=dt,j=wt,V=Ie,W=bt,J=$t,oe=mt,_e=xe,pe=Ce;return n(),c("div",{class:"detail-item",onClick:m[6]||(m[6]=q=>g(e(s).id))},[t(pe,null,{avatar:a(()=>[t(E,{round:"",size:30,src:e(s).user.avatar},null,8,["src"])]),header:a(()=>[t(Q,{onClick:m[0]||(m[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(s).user.username}}},{default:a(()=>[U(z(e(s).user.nickname),1)]),_:1},8,["to"]),d("span",Us," @"+z(e(s).user.username),1),e(s).is_top?(n(),P(F,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:a(()=>[U(" 置顶 ")]),_:1})):i("",!0),e(s).visibility==e(X).PRIVATE?(n(),P(F,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:a(()=>[U(" 私密 ")]),_:1})):i("",!0),e(s).visibility==e(X).FRIEND?(n(),P(F,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:a(()=>[U(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":a(()=>[e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(s).user.id?(n(),c("div",Ps,[t(C,{placement:"bottom-end",trigger:"click",size:"small",options:e(b),onSelect:I},{default:a(()=>[t(y,{quaternary:"",circle:""},{icon:a(()=>[t(p,null,{default:a(()=>[t(e(Qe))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),t(x,{show:R.value,"onUpdate:show":m[1]||(m[1]=q=>R.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:S},null,8,["show"]),t(x,{show:_.value,"onUpdate:show":m[2]||(m[2]=q=>_.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:O},null,8,["show","content"]),t(x,{show:M.value,"onUpdate:show":m[3]||(m[3]=q=>M.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show","content"]),t(x,{show:v.value,"onUpdate:show":m[4]||(m[4]=q=>v.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+($.value==0?"公开":$.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:B},null,8,["show","content"])]),footer:a(()=>[t(j,{attachments:e(s).attachments},null,8,["attachments"]),t(j,{attachments:e(s).charge_attachments,price:e(s).attachment_price},null,8,["attachments","price"]),t(V,{imgs:e(s).imgs},null,8,["imgs"]),t(W,{videos:e(s).videos,full:!0},null,8,["videos"]),t(J,{links:e(s).links},null,8,["links"]),d("div",Ls,[U(" 发布于 "+z(e(ie)(e(s).created_on))+" ",1),e(s).ip_loc?(n(),c("span",Ms,[t(oe,{vertical:""}),U(" "+z(e(s).ip_loc),1)])):i("",!0),!e(r).state.collapsedLeft&&e(s).created_on!=e(s).latest_replied_on?(n(),c("span",As,[t(oe,{vertical:""}),U(" 最后回复 "+z(e(ie)(e(s).latest_replied_on)),1)])):i("",!0)])]),action:a(()=>[d("div",Ds,[t(_e,{justify:"space-between"},{default:a(()=>[d("div",{class:"opt-item hover",onClick:H(Y,["stop"])},[t(p,{size:"20",class:"opt-item-icon"},{default:a(()=>[k.value?i("",!0):(n(),P(e(We),{key:0})),k.value?(n(),P(e(Xe),{key:1,color:"red"})):i("",!0)]),_:1}),U(" "+z(e(s).upvote_count),1)],8,Os),d("div",qs,[t(p,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(Ze))]),_:1}),U(" "+z(e(s).comment_count),1)]),d("div",{class:"opt-item hover",onClick:H(T,["stop"])},[t(p,{size:"20",class:"opt-item-icon"},{default:a(()=>[w.value?i("",!0):(n(),P(e(et),{key:0})),w.value?(n(),P(e(tt),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),U(" "+z(e(s).collection_count),1)],8,Ns),d("div",{class:"opt-item hover",onClick:H(D,["stop"])},[t(p,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(st))]),_:1}),U(" "+z(e(s).share_count),1)],8,js)]),_:1})])]),default:a(()=>[e(s).texts.length>0?(n(),c("div",Rs,[(n(!0),c(ae,null,le(e(s).texts,q=>(n(),c("span",{key:q.id,class:"post-text",onClick:m[5]||(m[5]=H(ze=>A(ze,e(s).id),["stop"])),innerHTML:e(fe)(q.content).content},null,8,Ss))),128))])):i("",!0)]),_:1})])}}});const Es=L=>(ge("data-v-0d01659f"),L=L(),ye(),L),Vs={key:0,class:"detail-wrap"},Hs={key:1,class:"empty-wrap"},Fs={key:0,class:"comment-opts-wrap"},Ys=Es(()=>d("span",{class:"comment-title-item"},"评论",-1)),Ks={key:2},Js={key:0,class:"skeleton-wrap"},Gs={key:1},Qs={key:0,class:"empty-wrap"},Ws={key:0,class:"load-more-spinner"},Xs={key:1,class:"load-more-spinner"},Zs={key:2,class:"load-more-spinner"},eo={key:3,class:"load-more-spinner"},to=G({__name:"Post",setup(L){const N=Ct(),l=u({}),r=u(!1),h=u(!1),k=u([]),w=ne(()=>+N.query.id),R=u("default"),_=u(!0),M=20;let v={loading(){},loaded(){},complete(){},error(){}};const f=T=>{R.value=T,T==="default"&&(_.value=!0),B(v)},$=()=>{l.value={id:0},r.value=!0,Je({id:w.value}).then(T=>{r.value=!1,l.value=T,B(v)}).catch(T=>{r.value=!1})};let s=1;const b=u(!1),g=u([]),A=T=>{b.value||he({id:l.value.id,sort_strategy:"default",page:s,page_size:M}).then(D=>{T!==null&&(v=T),D.list.length0&&(s===1?g.value=D.list:g.value.push(...D.list),k.value=g.value),v.loaded(),h.value=!1}).catch(D=>{h.value=!1,v.error()})};let I=1,S=u(!1);const O=u([]),K=T=>{S.value||he({id:l.value.id,sort_strategy:"newest",page:I,page_size:M}).then(D=>{T!==null&&(v=T),D.list.length0&&(I===1?O.value=D.list:O.value.push(...D.list),k.value=O.value),v.loaded(),h.value=!1}).catch(D=>{h.value=!1,v.error()})},B=T=>{w.value<1||(k.value.length===0&&(h.value=!0),R.value==="default"?(k.value=g.value,A(T)):(k.value=O.value,K(T)),h.value=!1)},Y=()=>{s=1,b.value=!1,g.value=[],I=1,S.value=!1,O.value=[],B(v)};return me(()=>{$()}),Pe(w,()=>{w.value>0&&N.name==="post"&&$()}),(T,D)=>{const o=zt,m=Bs,E=ft,Q=ht,F=gt,p=yt,y=kt,C=zs,x=xt,j=ms,V=xe,W=vt;return n(),c("div",null,[t(o,{title:"泡泡详情",back:!0}),t(W,{class:"main-content-wrap",bordered:""},{default:a(()=>[t(F,null,{default:a(()=>[t(Q,{show:r.value},{default:a(()=>[l.value.id>1?(n(),c("div",Vs,[t(m,{post:l.value,onReload:$},null,8,["post"])])):(n(),c("div",Hs,[t(E,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(n(),c("div",Fs,[t(y,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":f},{prefix:a(()=>[Ys]),default:a(()=>[t(p,{name:"default",tab:"默认"}),t(p,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(n(),P(F,{key:1},{default:a(()=>[t(C,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:Y},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(n(),c("div",Ks,[h.value?(n(),c("div",Js,[t(x,{num:5})])):(n(),c("div",Gs,[k.value.length===0?(n(),c("div",Qs,[t(E,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(n(!0),c(ae,null,le(k.value,J=>(n(),P(F,{key:J.id},{default:a(()=>[t(j,{comment:J,onReload:Y},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),k.value.length>=M?(n(),P(V,{key:3,justify:"center"},{default:a(()=>[t(e(Ut),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:B},{spinner:a(()=>[_.value&&b.value?(n(),c("span",Ws)):i("",!0),!_.value&&e(S)?(n(),c("span",Xs)):i("",!0),_.value&&!b.value?(n(),c("span",Zs,"加载评论")):i("",!0),!_.value&&!e(S)?(n(),c("span",eo,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const Ao=ee(to,[["__scopeId","data-v-0d01659f"]]);export{Ao as default}; diff --git a/web/dist/assets/Profile-6fe7cd67.js b/web/dist/assets/Profile-8cc07523.js similarity index 91% rename from web/dist/assets/Profile-6fe7cd67.js rename to web/dist/assets/Profile-8cc07523.js index 17331831..c57fd95b 100644 --- a/web/dist/assets/Profile-6fe7cd67.js +++ b/web/dist/assets/Profile-8cc07523.js @@ -1 +1 @@ -import{_ as U,a as V}from"./post-item.vue_vue_type_style_index_0_lang-a8faecc0.js";import{_ as D}from"./post-skeleton-78c5cb50.js";import{_ as L}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{u as R}from"./vuex-d28e9067.js";import{b as j}from"./vue-router-88cc84d1.js";import{A as q,_ as A}from"./index-f400f811.js";import{d as E,r,j as G,c as e,L as o,Y as n,K as f,$ as c,O as v,o as t,a,M as g,F as y,a2 as w}from"./@vue-ca177dbe.js";import{F as H,G as K,o as O,f as T,g as Y,I as J,H as Q}from"./naive-ui-2035804c.js";import"./content-b7753a95.js";import"./@vicons-6d35273b.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 W={class:"profile-baseinfo"},X={class:"avatar"},Z={class:"base-info"},tt={class:"username"},et={class:"uid"},ot={key:0,class:"skeleton-wrap"},st={key:1},nt={key:0,class:"empty-wrap"},at={key:1},_t={key:2},it={key:1,class:"pagination-wrap"},rt=E({__name:"Profile",setup(pt){const s=R(),b=j(),p=r(!1),l=r([]),u=r(+b.query.p||1),m=r(20),d=r(0),h=()=>{p.value=!0,q({username:s.state.userInfo.username,page:u.value,page_size:m.value}).then(_=>{p.value=!1,l.value=_.list,d.value=Math.ceil(_.pager.total_rows/m.value),window.scrollTo(0,0)}).catch(_=>{p.value=!1})},I=_=>{u.value=_,h()};return G(()=>{h()}),(_,lt)=>{const P=L,x=O,$=T,z=Y,B=D,M=J,S=U,k=Q,C=V,F=H,N=K;return t(),e("div",null,[o(P,{title:"主页"}),n(s).state.userInfo.id>0?(t(),f(F,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:c(()=>[a("div",W,[a("div",X,[o(x,{size:"large",src:n(s).state.userInfo.avatar},null,8,["src"])]),a("div",Z,[a("div",tt,[a("strong",null,g(n(s).state.userInfo.nickname),1),a("span",null," @"+g(n(s).state.userInfo.username),1)]),a("div",et,"UID. "+g(n(s).state.userInfo.id),1)])]),o(z,{class:"profile-tabs-wrap",animated:""},{default:c(()=>[o($,{name:"post",tab:"泡泡"})]),_:1}),p.value?(t(),e("div",ot,[o(B,{num:m.value},null,8,["num"])])):(t(),e("div",st,[l.value.length===0?(t(),e("div",nt,[o(M,{size:"large",description:"暂无数据"})])):v("",!0),n(s).state.desktopModelShow?(t(),e("div",at,[(t(!0),e(y,null,w(l.value,i=>(t(),f(k,{key:i.id},{default:c(()=>[o(S,{post:i},null,8,["post"])]),_:2},1024))),128))])):(t(),e("div",_t,[(t(!0),e(y,null,w(l.value,i=>(t(),f(k,{key:i.id},{default:c(()=>[o(C,{post:i},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):v("",!0),d.value>0?(t(),e("div",it,[o(N,{page:u.value,"onUpdate:page":I,"page-slot":n(s).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const At=A(rt,[["__scopeId","data-v-1f072d05"]]);export{At as default}; +import{_ as U,a as V}from"./post-item.vue_vue_type_style_index_0_lang-9289ab28.js";import{_ as D}from"./post-skeleton-6893dc8f.js";import{_ as L}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{u as R}from"./vuex-d28e9067.js";import{b as j}from"./vue-router-88cc84d1.js";import{A as q,_ as A}from"./index-effb87c4.js";import{d as E,r,j as G,c as e,L as o,Y as n,K as f,$ as c,O as v,o as t,a,M as g,F as y,a2 as w}from"./@vue-ca177dbe.js";import{F as H,G as K,o as O,f as T,g as Y,I as J,H as Q}from"./naive-ui-2035804c.js";import"./content-6a6aebc0.js";import"./@vicons-6d35273b.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 W={class:"profile-baseinfo"},X={class:"avatar"},Z={class:"base-info"},tt={class:"username"},et={class:"uid"},ot={key:0,class:"skeleton-wrap"},st={key:1},nt={key:0,class:"empty-wrap"},at={key:1},_t={key:2},it={key:1,class:"pagination-wrap"},rt=E({__name:"Profile",setup(pt){const s=R(),b=j(),p=r(!1),l=r([]),u=r(+b.query.p||1),m=r(20),d=r(0),h=()=>{p.value=!0,q({username:s.state.userInfo.username,page:u.value,page_size:m.value}).then(_=>{p.value=!1,l.value=_.list,d.value=Math.ceil(_.pager.total_rows/m.value),window.scrollTo(0,0)}).catch(_=>{p.value=!1})},I=_=>{u.value=_,h()};return G(()=>{h()}),(_,lt)=>{const P=L,x=O,$=T,z=Y,B=D,M=J,S=U,k=Q,C=V,F=H,N=K;return t(),e("div",null,[o(P,{title:"主页"}),n(s).state.userInfo.id>0?(t(),f(F,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:c(()=>[a("div",W,[a("div",X,[o(x,{size:"large",src:n(s).state.userInfo.avatar},null,8,["src"])]),a("div",Z,[a("div",tt,[a("strong",null,g(n(s).state.userInfo.nickname),1),a("span",null," @"+g(n(s).state.userInfo.username),1)]),a("div",et,"UID. "+g(n(s).state.userInfo.id),1)])]),o(z,{class:"profile-tabs-wrap",animated:""},{default:c(()=>[o($,{name:"post",tab:"泡泡"})]),_:1}),p.value?(t(),e("div",ot,[o(B,{num:m.value},null,8,["num"])])):(t(),e("div",st,[l.value.length===0?(t(),e("div",nt,[o(M,{size:"large",description:"暂无数据"})])):v("",!0),n(s).state.desktopModelShow?(t(),e("div",at,[(t(!0),e(y,null,w(l.value,i=>(t(),f(k,{key:i.id},{default:c(()=>[o(S,{post:i},null,8,["post"])]),_:2},1024))),128))])):(t(),e("div",_t,[(t(!0),e(y,null,w(l.value,i=>(t(),f(k,{key:i.id},{default:c(()=>[o(C,{post:i},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):v("",!0),d.value>0?(t(),e("div",it,[o(N,{page:u.value,"onUpdate:page":I,"page-slot":n(s).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const At=A(rt,[["__scopeId","data-v-1f072d05"]]);export{At as default}; diff --git a/web/dist/assets/Setting-415c10dd.js b/web/dist/assets/Setting-35b8a21e.js similarity index 97% rename from web/dist/assets/Setting-415c10dd.js rename to web/dist/assets/Setting-35b8a21e.js index 88eaf306..365bda4d 100644 --- a/web/dist/assets/Setting-415c10dd.js +++ b/web/dist/assets/Setting-35b8a21e.js @@ -1 +1 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{d as ye,r as d,D as Q,j as ke,c as g,L as t,$ as s,K as b,O as _,o as r,a as m,Y as u,e as c,M as R,z as be,v as Ce,P as q,a0 as B,U as Ie,V as $e}from"./@vue-ca177dbe.js";import{u as Pe}from"./vuex-d28e9067.js";import{S as Z,T as Ue,U as Se,V as Re,W as qe,X as Be,Y as Ae,_ as ze}from"./index-f400f811.js";import{x as Ke}from"./@vicons-6d35273b.js";import{h as Ne,o as xe,e as De,B as Fe,b as Ve,j as Te,S as je,$ as Oe,K as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-2035804c.js";import"./vue-router-88cc84d1.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 V=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),Ye={class:"base-line avatar"},Ge={class:"base-line"},Je=V(()=>m("span",{class:"base-label"},"昵称",-1)),Xe={key:0},He={class:"base-line"},Qe=V(()=>m("span",{class:"base-label"},"用户名",-1)),Ze={key:0},et={key:1},tt=V(()=>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=V(()=>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),K=d(!1),N=d(!1),M=d(),W=d(),C=d(!1),x=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),Y=d(),G=d(),J=d(),X=d(),a=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Q({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 D;window.$message.success("头像更新成功"),(D=M.value)==null||D.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=X.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(x.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=Y.value)==null||e.validate(v=>{v||(K.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{K.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=>{K.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||(N.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{N.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=>{N.value=!1,f.code===20012&&j()}))})},T=()=>{Z().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Z().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=W.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=xe,p=De,D=Fe,h=Ve,ge=Te,F=Ne,H=je,w=Oe,he=Ee,O=Le,E=Me,L=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ye,[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(D,{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,[Je,C.value?_("",!0):(r(),g("div",Xe,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,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(Ke))]),_:1})]),_:1})):_("",!0)]),m("div",He,[Qe,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",Ze,[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(H,{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:Y,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(O,{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:K.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(H,{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(O,{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:N.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:J,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:X,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(O,{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:x.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-1679b128.js";import{d as ye,r as d,D as Q,j as ke,c as g,L as t,$ as s,K as b,O as _,o as r,a as m,Y as u,e as c,M as R,z as be,v as Ce,P as q,a0 as B,U as Ie,V as $e}from"./@vue-ca177dbe.js";import{u as Pe}from"./vuex-d28e9067.js";import{S as Z,T as Ue,U as Se,V as Re,W as qe,X as Be,Y as Ae,_ as ze}from"./index-effb87c4.js";import{x as Ke}from"./@vicons-6d35273b.js";import{h as Ne,o as xe,e as De,B as Fe,b as Ve,j as Te,S as je,$ as Oe,K as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-2035804c.js";import"./vue-router-88cc84d1.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 V=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),Ye={class:"base-line avatar"},Ge={class:"base-line"},Je=V(()=>m("span",{class:"base-label"},"昵称",-1)),Xe={key:0},He={class:"base-line"},Qe=V(()=>m("span",{class:"base-label"},"用户名",-1)),Ze={key:0},et={key:1},tt=V(()=>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=V(()=>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),K=d(!1),N=d(!1),M=d(),W=d(),C=d(!1),x=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),Y=d(),G=d(),J=d(),X=d(),a=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Q({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 D;window.$message.success("头像更新成功"),(D=M.value)==null||D.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=X.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(x.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=Y.value)==null||e.validate(v=>{v||(K.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{K.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=>{K.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||(N.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{N.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=>{N.value=!1,f.code===20012&&j()}))})},T=()=>{Z().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Z().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=W.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=xe,p=De,D=Fe,h=Ve,ge=Te,F=Ne,H=je,w=Oe,he=Ee,O=Le,E=Me,L=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ye,[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(D,{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,[Je,C.value?_("",!0):(r(),g("div",Xe,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,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(Ke))]),_:1})]),_:1})):_("",!0)]),m("div",He,[Qe,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",Ze,[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(H,{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:Y,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(O,{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:K.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(H,{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(O,{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:N.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:J,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:X,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(O,{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:x.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-8b510446.js b/web/dist/assets/Topic-264d6837.js similarity index 97% rename from web/dist/assets/Topic-8b510446.js rename to web/dist/assets/Topic-264d6837.js index 5780d6e5..86a7985b 100644 --- a/web/dist/assets/Topic-8b510446.js +++ b/web/dist/assets/Topic-264d6837.js @@ -1 +1 @@ -import{w as x,x as S,y as z,z as I,_ as j}from"./index-f400f811.js";import{p as E}from"./@vicons-6d35273b.js";import{d as F,r as _,n as $,j as q,a1 as U,o as l,c as u,L as n,$ as a,K as T,e as A,M as w,O as m,Y as r,w as D,a6 as K,F as Y,a2 as G}from"./@vue-ca177dbe.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-2035804c.js";import{_ as ot}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{u as nt}from"./vuex-d28e9067.js";import"./vue-router-88cc84d1.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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":z({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=U("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(E))]),_: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,I({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{w as x,x as S,y as z,z as I,_ as j}from"./index-effb87c4.js";import{p as E}from"./@vicons-6d35273b.js";import{d as F,r as _,n as $,j as q,a1 as U,o as l,c as u,L as n,$ as a,K as T,e as A,M as w,O as m,Y as r,w as D,a6 as K,F as Y,a2 as G}from"./@vue-ca177dbe.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-2035804c.js";import{_ as ot}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{u as nt}from"./vuex-d28e9067.js";import"./vue-router-88cc84d1.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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":z({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=U("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(E))]),_: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,I({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-546de07a.js b/web/dist/assets/User-35076387.js similarity index 96% rename from web/dist/assets/User-546de07a.js rename to web/dist/assets/User-35076387.js index 1cf631e3..49035a28 100644 --- a/web/dist/assets/User-546de07a.js +++ b/web/dist/assets/User-35076387.js @@ -1 +1 @@ -import{_ as pe,a as de}from"./post-item.vue_vue_type_style_index_0_lang-a8faecc0.js";import{_ as me}from"./post-skeleton-78c5cb50.js";import{B as he,_ as S,C as ve,D as fe,A as ge,E as we,F as ye}from"./index-f400f811.js";import{Q as T,R as A,S as D,b as N,e as q,i as V,u as ke,T as be,F as xe,G as $e,o as Ue,M as Fe,j as ze,O as Ie,k as Se,f as qe,g as Me,I as We,H as Ce}from"./naive-ui-2035804c.js";import{d as M,r as c,o,K as z,$ as t,a as _,L as n,e as f,M as $,D as Be,n as Pe,w as Re,j as Te,c as u,Y as v,O as F,F as P,a2 as R}from"./@vue-ca177dbe.js";import{_ as Ae}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{u as De}from"./vuex-d28e9067.js";import{b as Ne}from"./vue-router-88cc84d1.js";import{i as Ve}from"./@vicons-6d35273b.js";import"./content-b7753a95.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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 Le={class:"whisper-wrap"},Oe={class:"whisper-line"},je={class:"whisper-line send-wrap"},Ee=M({__name:"whisper",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(p,{emit:U}){const r=p,a=c(""),l=c(!1),e=()=>{U("success")},i=()=>{l.value=!0,he({user_id:r.user.id,content:a.value}).then(d=>{window.$message.success("发送成功"),l.value=!1,a.value="",e()}).catch(d=>{l.value=!1})};return(d,m)=>{const h=T,g=A,w=D,y=N,k=q,b=V;return o(),z(b,{show:p.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Le,[n(w,{"show-icon":!1},{default:t(()=>[f(" 即将发送私信给: "),n(g,{style:{"max-width":"100%"}},{default:t(()=>[n(h,{type:"success"},{default:t(()=>[f($(p.user.nickname)+"@"+$(p.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Oe,[n(y,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":m[0]||(m[0]=x=>a.value=x),maxlength:"200","show-count":""},null,8,["value"])]),_("div",je,[n(k,{strong:"",secondary:"",type:"primary",loading:l.value,onClick:i},{default:t(()=>[f(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const He=S(Ee,[["__scopeId","data-v-0cbfe47c"]]),Ge={class:"whisper-wrap"},Ke={class:"whisper-line"},Qe={class:"whisper-line send-wrap"},Ye=M({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(p,{emit:U}){const r=p,a=c(""),l=c(!1),e=()=>{U("success")},i=()=>{l.value=!0,ve({user_id:r.user.id,greetings:a.value}).then(d=>{window.$message.success("发送成功"),l.value=!1,a.value="",e()}).catch(d=>{l.value=!1})};return(d,m)=>{const h=T,g=A,w=D,y=N,k=q,b=V;return o(),z(b,{show:p.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ge,[n(w,{"show-icon":!1},{default:t(()=>[f(" 发送添加朋友申请给: "),n(g,{style:{"max-width":"100%"}},{default:t(()=>[n(h,{type:"success"},{default:t(()=>[f($(p.user.nickname)+"@"+$(p.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ke,[n(y,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":m[0]||(m[0]=x=>a.value=x),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Qe,[n(k,{strong:"",secondary:"",type:"primary",loading:l.value,onClick:i},{default:t(()=>[f(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Je=S(Ye,[["__scopeId","data-v-60be56a2"]]),Xe={key:0,class:"profile-baseinfo"},Ze={class:"avatar"},es={class:"base-info"},ss={class:"username"},ns={class:"uid"},ts={key:0,class:"user-opts"},os={key:0,class:"skeleton-wrap"},as={key:1},ls={key:0,class:"empty-wrap"},is={key:1},cs={key:2},_s={key:0,class:"pagination-wrap"},rs=M({__name:"User",setup(p){ke();const U=be(),r=De(),a=Ne(),l=c(!1),e=Be({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),i=c(!1),d=c(!1),m=c(!1),h=c([]),g=c(a.query.username||""),w=c(+a.query.p||1),y=c(20),k=c(0),b=()=>{l.value=!0,ge({username:g.value,page:w.value,page_size:y.value}).then(s=>{l.value=!1,h.value=s.list,k.value=Math.ceil(s.pager.total_rows/y.value),window.scrollTo(0,0)}).catch(s=>{l.value=!1})},x=()=>{i.value=!0,fe({username:g.value}).then(s=>{i.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,b()}).catch(s=>{i.value=!1,console.log(s)})},L=s=>{w.value=s,b()},O=()=>{d.value=!0},j=()=>{m.value=!0},E=()=>{d.value=!1},H=()=>{m.value=!1},G=Pe(()=>{let s=[{label:"私信",key:"whisper"}];return r.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}),K=s=>{switch(s){case"whisper":O();break;case"delete":Q();break;case"requesting":j();break;case"banned":case"deblocking":Y();break}},Q=()=>{U.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.value=!0,we({user_id:e.id}).then(s=>{i.value=!1,e.is_friend=!1,b()}).catch(s=>{i.value=!1,console.log(s)})}})},Y=()=>{U.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.value=!0,ye({id:e.id,status:e.status===1?2:1}).then(s=>{i.value=!1,x()}).catch(s=>{i.value=!1,console.log(s)})}})};return Re(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(g.value=a.query.username||"",x())}),Te(()=>{x()}),(s,W)=>{const J=Ae,X=Ue,C=Fe,Z=ze,ee=q,se=Ie,ne=He,te=Se,oe=qe,ae=Me,le=me,ie=We,ce=pe,B=Ce,_e=de,re=xe,ue=$e;return o(),u("div",null,[n(J,{title:"用户详情"}),n(re,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(te,{show:i.value},{default:t(()=>[e.id>0?(o(),u("div",Xe,[_("div",Ze,[n(X,{size:"large",src:e.avatar},null,8,["src"])]),_("div",es,[_("div",ss,[_("strong",null,$(e.nickname),1),_("span",null," @"+$(e.username),1),v(r).state.userInfo.id>0&&v(r).state.userInfo.username!=e.username&&e.is_friend?(o(),z(C,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[f(" 好友 ")]),_:1})):F("",!0),e.is_admin?(o(),z(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[f(" 管理员 ")]),_:1})):F("",!0)]),_("div",ns,"UID. "+$(e.id),1)]),v(r).state.userInfo.id>0&&v(r).state.userInfo.username!=e.username?(o(),u("div",ts,[n(se,{placement:"bottom-end",trigger:"click",size:"small",options:v(G),onSelect:K},{default:t(()=>[n(ee,{quaternary:"",circle:""},{icon:t(()=>[n(Z,null,{default:t(()=>[n(v(Ve))]),_:1})]),_:1})]),_:1},8,["options"])])):F("",!0)])):F("",!0),n(ne,{show:d.value,user:e,onSuccess:E},null,8,["show","user"]),n(Je,{show:m.value,user:e,onSuccess:H},null,8,["show","user"])]),_:1},8,["show"]),n(ae,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(oe,{name:"post",tab:"泡泡"})]),_:1}),l.value?(o(),u("div",os,[n(le,{num:y.value},null,8,["num"])])):(o(),u("div",as,[h.value.length===0?(o(),u("div",ls,[n(ie,{size:"large",description:"暂无数据"})])):F("",!0),v(r).state.desktopModelShow?(o(),u("div",is,[(o(!0),u(P,null,R(h.value,I=>(o(),z(B,{key:I.id},{default:t(()=>[n(ce,{post:I},null,8,["post"])]),_:2},1024))),128))])):(o(),u("div",cs,[(o(!0),u(P,null,R(h.value,I=>(o(),z(B,{key:I.id},{default:t(()=>[n(_e,{post:I},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),k.value>0?(o(),u("div",_s,[n(ue,{page:w.value,"onUpdate:page":L,"page-slot":v(r).state.collapsedRight?5:8,"page-count":k.value},null,8,["page","page-slot","page-count"])])):F("",!0)])}}});const Vs=S(rs,[["__scopeId","data-v-31cfec9c"]]);export{Vs as default}; +import{_ as pe,a as de}from"./post-item.vue_vue_type_style_index_0_lang-9289ab28.js";import{_ as me}from"./post-skeleton-6893dc8f.js";import{B as he,_ as S,C as ve,D as fe,A as ge,E as we,F as ye}from"./index-effb87c4.js";import{Q as T,R as A,S as D,b as N,e as q,i as V,u as ke,T as be,F as xe,G as $e,o as Ue,M as Fe,j as ze,O as Ie,k as Se,f as qe,g as Me,I as We,H as Ce}from"./naive-ui-2035804c.js";import{d as M,r as c,o,K as z,$ as t,a as _,L as n,e as f,M as $,D as Be,n as Pe,w as Re,j as Te,c as u,Y as v,O as F,F as P,a2 as R}from"./@vue-ca177dbe.js";import{_ as Ae}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{u as De}from"./vuex-d28e9067.js";import{b as Ne}from"./vue-router-88cc84d1.js";import{i as Ve}from"./@vicons-6d35273b.js";import"./content-6a6aebc0.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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 Le={class:"whisper-wrap"},Oe={class:"whisper-line"},je={class:"whisper-line send-wrap"},Ee=M({__name:"whisper",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(p,{emit:U}){const r=p,a=c(""),l=c(!1),e=()=>{U("success")},i=()=>{l.value=!0,he({user_id:r.user.id,content:a.value}).then(d=>{window.$message.success("发送成功"),l.value=!1,a.value="",e()}).catch(d=>{l.value=!1})};return(d,m)=>{const h=T,g=A,w=D,y=N,k=q,b=V;return o(),z(b,{show:p.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Le,[n(w,{"show-icon":!1},{default:t(()=>[f(" 即将发送私信给: "),n(g,{style:{"max-width":"100%"}},{default:t(()=>[n(h,{type:"success"},{default:t(()=>[f($(p.user.nickname)+"@"+$(p.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Oe,[n(y,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":m[0]||(m[0]=x=>a.value=x),maxlength:"200","show-count":""},null,8,["value"])]),_("div",je,[n(k,{strong:"",secondary:"",type:"primary",loading:l.value,onClick:i},{default:t(()=>[f(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const He=S(Ee,[["__scopeId","data-v-0cbfe47c"]]),Ge={class:"whisper-wrap"},Ke={class:"whisper-line"},Qe={class:"whisper-line send-wrap"},Ye=M({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(p,{emit:U}){const r=p,a=c(""),l=c(!1),e=()=>{U("success")},i=()=>{l.value=!0,ve({user_id:r.user.id,greetings:a.value}).then(d=>{window.$message.success("发送成功"),l.value=!1,a.value="",e()}).catch(d=>{l.value=!1})};return(d,m)=>{const h=T,g=A,w=D,y=N,k=q,b=V;return o(),z(b,{show:p.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ge,[n(w,{"show-icon":!1},{default:t(()=>[f(" 发送添加朋友申请给: "),n(g,{style:{"max-width":"100%"}},{default:t(()=>[n(h,{type:"success"},{default:t(()=>[f($(p.user.nickname)+"@"+$(p.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ke,[n(y,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":m[0]||(m[0]=x=>a.value=x),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Qe,[n(k,{strong:"",secondary:"",type:"primary",loading:l.value,onClick:i},{default:t(()=>[f(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Je=S(Ye,[["__scopeId","data-v-60be56a2"]]),Xe={key:0,class:"profile-baseinfo"},Ze={class:"avatar"},es={class:"base-info"},ss={class:"username"},ns={class:"uid"},ts={key:0,class:"user-opts"},os={key:0,class:"skeleton-wrap"},as={key:1},ls={key:0,class:"empty-wrap"},is={key:1},cs={key:2},_s={key:0,class:"pagination-wrap"},rs=M({__name:"User",setup(p){ke();const U=be(),r=De(),a=Ne(),l=c(!1),e=Be({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),i=c(!1),d=c(!1),m=c(!1),h=c([]),g=c(a.query.username||""),w=c(+a.query.p||1),y=c(20),k=c(0),b=()=>{l.value=!0,ge({username:g.value,page:w.value,page_size:y.value}).then(s=>{l.value=!1,h.value=s.list,k.value=Math.ceil(s.pager.total_rows/y.value),window.scrollTo(0,0)}).catch(s=>{l.value=!1})},x=()=>{i.value=!0,fe({username:g.value}).then(s=>{i.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,b()}).catch(s=>{i.value=!1,console.log(s)})},L=s=>{w.value=s,b()},O=()=>{d.value=!0},j=()=>{m.value=!0},E=()=>{d.value=!1},H=()=>{m.value=!1},G=Pe(()=>{let s=[{label:"私信",key:"whisper"}];return r.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}),K=s=>{switch(s){case"whisper":O();break;case"delete":Q();break;case"requesting":j();break;case"banned":case"deblocking":Y();break}},Q=()=>{U.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.value=!0,we({user_id:e.id}).then(s=>{i.value=!1,e.is_friend=!1,b()}).catch(s=>{i.value=!1,console.log(s)})}})},Y=()=>{U.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.value=!0,ye({id:e.id,status:e.status===1?2:1}).then(s=>{i.value=!1,x()}).catch(s=>{i.value=!1,console.log(s)})}})};return Re(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(g.value=a.query.username||"",x())}),Te(()=>{x()}),(s,W)=>{const J=Ae,X=Ue,C=Fe,Z=ze,ee=q,se=Ie,ne=He,te=Se,oe=qe,ae=Me,le=me,ie=We,ce=pe,B=Ce,_e=de,re=xe,ue=$e;return o(),u("div",null,[n(J,{title:"用户详情"}),n(re,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(te,{show:i.value},{default:t(()=>[e.id>0?(o(),u("div",Xe,[_("div",Ze,[n(X,{size:"large",src:e.avatar},null,8,["src"])]),_("div",es,[_("div",ss,[_("strong",null,$(e.nickname),1),_("span",null," @"+$(e.username),1),v(r).state.userInfo.id>0&&v(r).state.userInfo.username!=e.username&&e.is_friend?(o(),z(C,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[f(" 好友 ")]),_:1})):F("",!0),e.is_admin?(o(),z(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[f(" 管理员 ")]),_:1})):F("",!0)]),_("div",ns,"UID. "+$(e.id),1)]),v(r).state.userInfo.id>0&&v(r).state.userInfo.username!=e.username?(o(),u("div",ts,[n(se,{placement:"bottom-end",trigger:"click",size:"small",options:v(G),onSelect:K},{default:t(()=>[n(ee,{quaternary:"",circle:""},{icon:t(()=>[n(Z,null,{default:t(()=>[n(v(Ve))]),_:1})]),_:1})]),_:1},8,["options"])])):F("",!0)])):F("",!0),n(ne,{show:d.value,user:e,onSuccess:E},null,8,["show","user"]),n(Je,{show:m.value,user:e,onSuccess:H},null,8,["show","user"])]),_:1},8,["show"]),n(ae,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(oe,{name:"post",tab:"泡泡"})]),_:1}),l.value?(o(),u("div",os,[n(le,{num:y.value},null,8,["num"])])):(o(),u("div",as,[h.value.length===0?(o(),u("div",ls,[n(ie,{size:"large",description:"暂无数据"})])):F("",!0),v(r).state.desktopModelShow?(o(),u("div",is,[(o(!0),u(P,null,R(h.value,I=>(o(),z(B,{key:I.id},{default:t(()=>[n(ce,{post:I},null,8,["post"])]),_:2},1024))),128))])):(o(),u("div",cs,[(o(!0),u(P,null,R(h.value,I=>(o(),z(B,{key:I.id},{default:t(()=>[n(_e,{post:I},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),k.value>0?(o(),u("div",_s,[n(ue,{page:w.value,"onUpdate:page":L,"page-slot":v(r).state.collapsedRight?5:8,"page-count":k.value},null,8,["page","page-slot","page-count"])])):F("",!0)])}}});const Vs=S(rs,[["__scopeId","data-v-31cfec9c"]]);export{Vs as default}; diff --git a/web/dist/assets/Wallet-c5338260.js b/web/dist/assets/Wallet-a142acc0.js similarity index 96% rename from web/dist/assets/Wallet-c5338260.js rename to web/dist/assets/Wallet-a142acc0.js index d4562767..696829cf 100644 --- a/web/dist/assets/Wallet-c5338260.js +++ b/web/dist/assets/Wallet-a142acc0.js @@ -1 +1 @@ -import{_ as H}from"./post-skeleton-78c5cb50.js";import{_ as Z}from"./main-nav.vue_vue_type_style_index_0_lang-423db962.js";import{d as J,r as c,j as X,c as _,L as e,$ as o,o as n,Y as y,O as w,a,e as k,F as $,a2 as N,z as ee,v as te,M as r,K as q,a4 as oe,a0 as ae,U as ne,V as se}from"./@vue-ca177dbe.js";import{u as le}from"./vuex-d28e9067.js";import{b as ce}from"./vue-router-88cc84d1.js";import{b as ie}from"./qrcode-bd5089a5.js";import{O as _e,P as re,Q as ue,R as pe,_ as me}from"./index-f400f811.js";import{a as de}from"./formatTime-000dbebb.js";import{w as ge}from"./@vicons-6d35273b.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-2035804c.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 O=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},$e={class:"balance-opts"},Ne={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Oe={key:1},Pe={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},Ue=O(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},We={class:"pay-sub-tips"},Ee=O(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Me=J({__name:"Wallet",setup(d){const i=le(),P=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+P.query.p||1),C=c(20),I=c(0),B=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})},F=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"))},L=()=>{g.value=!0},T=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})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Z,m=fe,V=ye,f=we,z=ke,W=be,E=H,M=xe,D=Re,j=ve,K=Ce,Q=Ie,Y=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",Ne,[e(W,{page:x.value,"onUpdate:page":F,"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(V,{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",$e,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:L},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",Oe,[b.value.length===0?(n(),_("div",Pe,[e(M,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_($,null,N(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Be,[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(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Fe,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_($,null,N(B.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",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:T},{icon:o(()=>[e(K,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Te,[Ue,a("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",We,[e(Q,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=me(Me,[["__scopeId","data-v-870bd246"]]);export{yt as default}; +import{_ as H}from"./post-skeleton-6893dc8f.js";import{_ as Z}from"./main-nav.vue_vue_type_style_index_0_lang-1679b128.js";import{d as J,r as c,j as X,c as _,L as e,$ as o,o as n,Y as y,O as w,a,e as k,F as $,a2 as N,z as ee,v as te,M as r,K as q,a4 as oe,a0 as ae,U as ne,V as se}from"./@vue-ca177dbe.js";import{u as le}from"./vuex-d28e9067.js";import{b as ce}from"./vue-router-88cc84d1.js";import{b as ie}from"./qrcode-bd5089a5.js";import{O as _e,P as re,Q as ue,R as pe,_ as me}from"./index-effb87c4.js";import{a as de}from"./formatTime-000dbebb.js";import{w as ge}from"./@vicons-6d35273b.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-2035804c.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 O=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},$e={class:"balance-opts"},Ne={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Oe={key:1},Pe={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},Ue=O(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},We={class:"pay-sub-tips"},Ee=O(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Me=J({__name:"Wallet",setup(d){const i=le(),P=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+P.query.p||1),C=c(20),I=c(0),B=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})},F=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"))},L=()=>{g.value=!0},T=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})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Z,m=fe,V=ye,f=we,z=ke,W=be,E=H,M=xe,D=Re,j=ve,K=Ce,Q=Ie,Y=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",Ne,[e(W,{page:x.value,"onUpdate:page":F,"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(V,{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",$e,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:L},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",Oe,[b.value.length===0?(n(),_("div",Pe,[e(M,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_($,null,N(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Be,[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(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Fe,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_($,null,N(B.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",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:T},{icon:o(()=>[e(K,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Te,[Ue,a("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",We,[e(Q,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=me(Me,[["__scopeId","data-v-870bd246"]]);export{yt as default}; diff --git a/web/dist/assets/content-b7753a95.js b/web/dist/assets/content-6a6aebc0.js similarity index 99% rename from web/dist/assets/content-b7753a95.js rename to web/dist/assets/content-6a6aebc0.js index 12f92fe9..ef8083b6 100644 --- a/web/dist/assets/content-b7753a95.js +++ b/web/dist/assets/content-6a6aebc0.js @@ -1 +1 @@ -import{d as h,o as e,c as r,F as a,a2 as m,L as s,$ as o,Y as c,a as C,a0 as k,M as $,K as _,O as g,r as j,e as B,s as b}from"./@vue-ca177dbe.js";import{u as D,v as L}from"./@vicons-6d35273b.js";import{j as I,V as N,W as V,m as M,X as z,e as F,i as O}from"./naive-ui-2035804c.js";import{_ as A,L as T,M as U}from"./index-f400f811.js";import{N as P}from"./nonesir-video-db921567.js";const R={class:"link-wrap"},K={class:"link-txt-wrap"},S=["href"],W={class:"link-txt"},X=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;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}),C("div",K,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",W,$(n.content),1)],8,S)])]))),128))])}}});const ot=A(X,[["__scopeId","data-v-36eef76b"]]),Y={key:0},st=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",Y,[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)}}}),Z={class:"images-wrap"},rt=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=M,d=N,f=V,w=z;return e(),r("div",Z,[[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 q={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(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)+"元")]),T({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{U({id:x.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,f)=>{const w=I,t=F,i=O;return e(),r("div",q,[(e(!0),r(a,null,m(y.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(H=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(L))]),_:1})]),default:o(()=>[B(" "+$(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 lt=A(G,[["__scopeId","data-v-22563084"]]),ct=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{rt as _,lt as a,st as b,ot as c,ct as p}; +import{d as h,o as e,c as r,F as a,a2 as m,L as s,$ as o,Y as c,a as C,a0 as k,M as $,K as _,O as g,r as j,e as B,s as b}from"./@vue-ca177dbe.js";import{u as D,v as L}from"./@vicons-6d35273b.js";import{j as I,V as N,W as V,m as M,X as z,e as F,i as O}from"./naive-ui-2035804c.js";import{_ as A,L as T,M as U}from"./index-effb87c4.js";import{N as P}from"./nonesir-video-db921567.js";const R={class:"link-wrap"},K={class:"link-txt-wrap"},S=["href"],W={class:"link-txt"},X=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;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}),C("div",K,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",W,$(n.content),1)],8,S)])]))),128))])}}});const ot=A(X,[["__scopeId","data-v-36eef76b"]]),Y={key:0},st=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",Y,[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)}}}),Z={class:"images-wrap"},rt=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=M,d=N,f=V,w=z;return e(),r("div",Z,[[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 q={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(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)+"元")]),T({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{U({id:x.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,f)=>{const w=I,t=F,i=O;return e(),r("div",q,[(e(!0),r(a,null,m(y.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(H=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(L))]),_:1})]),default:o(()=>[B(" "+$(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 lt=A(G,[["__scopeId","data-v-22563084"]]),ct=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{rt as _,lt as a,st as b,ot as c,ct as p}; diff --git a/web/dist/assets/index-f400f811.js b/web/dist/assets/index-effb87c4.js similarity index 90% rename from web/dist/assets/index-f400f811.js rename to web/dist/assets/index-effb87c4.js index cd75ac5b..34b342a9 100644 --- a/web/dist/assets/index-f400f811.js +++ b/web/dist/assets/index-effb87c4.js @@ -1 +1 @@ -import{d as z,r as R,D as Y,j,o as v,K as N,$ as a,a as k,L as o,c as T,e as S,P as q,a0 as D,O as M,Y as m,n as Q,w as H,a1 as ae,F as J,a2 as X,M as I,s as P,a3 as he,Q as Z,a4 as ge,a5 as fe}from"./@vue-ca177dbe.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-88cc84d1.js";import{c as ke,u as B}from"./vuex-d28e9067.js";import{a as be}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ue,b as ce,c as Oe,d as Ae,e as ie,f as Te,g as Re,h as de,i as Ce,j as F,k as Ee,u as $e,l as Ie,m as Se,n as Me,o as Ue,p as Ke,q as qe,r as De,s as Ne,t as xe}from"./naive-ui-2035804c.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-6d35273b.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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 _ of n.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&i(_)}).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 Ge="modulepreload",Ye=function(e){return"/"+e},se={},A=function(t,l,i){if(!l||l.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Ye(n),n in se)return;se[n]=!0;const _=n.endsWith(".css"),d=_?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const h=c[b];if(h.href===n&&(!_||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=_?"stylesheet":Ge,_||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),_)return new Promise((b,h)=>{g.addEventListener("load",b),g.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Je=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-14a552e0.js"),["assets/Home-14a552e0.js","assets/post-item.vue_vue_type_style_index_0_lang-a8faecc0.js","assets/content-b7753a95.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-db921567.js","assets/content-5ea7b681.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-78c5cb50.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Home-c075a37e.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"话题详情"},component:()=>A(()=>import("./Post-7dfd8928.js"),["assets/Post-7dfd8928.js","assets/@vue-ca177dbe.js","assets/vuex-d28e9067.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/IEnum-a180d93e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/content-b7753a95.js","assets/nonesir-video-db921567.js","assets/content-5ea7b681.css","assets/vue-router-88cc84d1.js","assets/post-skeleton-78c5cb50.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js","assets/main-nav-3ef9bae6.css","assets/v3-infinite-loading-fcb59c38.js","assets/v3-infinite-loading-7d241236.css","assets/axios-4a70c6fc.js","assets/Post-12ff28aa.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-8b510446.js"),["assets/Topic-8b510446.js","assets/@vicons-6d35273b.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-423db962.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Topic-8dbcebb5.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>A(()=>import("./Anouncement-9495a781.js"),["assets/Anouncement-9495a781.js","assets/post-skeleton-78c5cb50.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-423db962.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>A(()=>import("./Profile-6fe7cd67.js"),["assets/Profile-6fe7cd67.js","assets/post-item.vue_vue_type_style_index_0_lang-a8faecc0.js","assets/content-b7753a95.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-db921567.js","assets/content-5ea7b681.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-78c5cb50.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Profile-87e8712d.css","assets/vfonts-7afd136d.css"])},{path:"/user",name:"user",meta:{title:"用户详情"},component:()=>A(()=>import("./User-546de07a.js"),["assets/User-546de07a.js","assets/post-item.vue_vue_type_style_index_0_lang-a8faecc0.js","assets/content-b7753a95.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-db921567.js","assets/content-5ea7b681.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-78c5cb50.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/User-dfc90f68.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>A(()=>import("./Messages-f314d9ce.js"),["assets/Messages-f314d9ce.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-423db962.js","assets/vuex-d28e9067.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Messages-7ed31ecd.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>A(()=>import("./Collection-40445a32.js"),["assets/Collection-40445a32.js","assets/post-item.vue_vue_type_style_index_0_lang-a8faecc0.js","assets/content-b7753a95.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-db921567.js","assets/content-5ea7b681.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-78c5cb50.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Collection-b97b3cf7.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>A(()=>import("./Contacts-0884bcb5.js"),["assets/Contacts-0884bcb5.js","assets/vue-router-88cc84d1.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-78c5cb50.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js","assets/vuex-d28e9067.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Contacts-b60e5e0d.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>A(()=>import("./Wallet-c5338260.js"),["assets/Wallet-c5338260.js","assets/post-skeleton-78c5cb50.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-423db962.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/qrcode-bd5089a5.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>A(()=>import("./Setting-415c10dd.js"),["assets/Setting-415c10dd.js","assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.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-4a70c6fc.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>A(()=>import("./404-35be31b4.js"),["assets/404-35be31b4.js","assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.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-4a70c6fc.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],pe=ve({history:we(),routes:Je});pe.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Xe=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}),Ze=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(),i=R(!1),c=R(),n=Y({username:"",password:""}),_=R(),d=Y({username:"",password:"",repassword:""}),U={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(h,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=c.value)==null||u.validate(L=>{L||(i.value=!0,ne({username:n.username,password:n.password}).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("登录成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),l.commit("refresh"),n.username="",n.password=""}).catch(p=>{i.value=!1}))})},b=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=_.value)==null||u.validate(L=>{L||(i.value=!0,Ze({username:d.username,password:d.password}).then(p=>ne({username:d.username,password:d.password})).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("注册成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{i.value=!1}))})};return j(()=>{const h=localStorage.getItem("PAOPAO_TOKEN")||"";h?W(h).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(h,u)=>{const L=Pe,p=Le,O=ue,r=ce,w=Oe,y=Ae,E=ie,x=Te,$=Re,K=de,V=Ce;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(K,{bordered:!1},{default:a(()=>[t.value?M("",!0):(v(),T("div",tt,[o(O,{justify:"center"},{default:a(()=>[o(p,null,{default:a(()=>[o(L,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),o(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(w,{label:"账户",path:"username"},{default:a(()=>[o(r,{value:n.username,"onUpdate:value":u[0]||(u[0]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),N($,{key:1,"default-value":m(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[o(x,{name:"signin",tab:"登录"},{default:a(()=>[o(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(w,{label:"账户",path:"username"},{default:a(()=>[o(r,{value:n.username,"onUpdate:value":u[2]||(u[2]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),o(x,{name:"signup",tab:"注册"},{default:a(()=>[o(y,{ref_key:"registerRef",ref:_,model:d,rules:U},{default:a(()=>[o(w,{label:"用户名",path:"username"},{default:a(()=>[o(r,{value:d.username,"onUpdate:value":u[4]||(u[4]=f=>d.username=f),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=f=>d.password=f),onKeyup:q(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"重复密码",path:"repassword"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=f=>d.repassword=f),onKeyup:q(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.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[i,c]of t)l[i]=c;return l},st=me(ot,[["__scopeId","data-v-053dfa44"]]),Jt=e=>s({method:"get",url:"/v1/posts",params:e}),nt=e=>s({method:"get",url:"/v1/tags",params:e}),Xt=e=>s({method:"get",url:"/v1/post",params:e}),Zt=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}),co=e=>s({method:"post",url:"/v1/post/visibility",data:e}),io=e=>s({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),po=e=>s({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),mo=e=>s({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),_o=e=>s({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),ho=e=>s({method:"post",url:"/v1/post/comment",data:e}),go=e=>s({method:"delete",url:"/v1/post/comment",data:e}),fo=e=>s({method:"post",url:"/v1/post/comment/reply",data:e}),vo=e=>s({method:"delete",url:"/v1/post/comment/reply",data:e}),wo=e=>s({method:"post",url:"/v1/topic/stick",data:e}),yo=e=>s({method:"post",url:"/v1/topic/follow",data:e}),ko=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"},ct={class:"copyright"},it=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=R([]),l=R([]),i=R(!1),c=R(""),n=B(),_=le(),d="2023 paopao.info",U="Roc's Me",g="",b="泡泡(PaoPao)开源社区",h="https://www.paopao.info",u=+"6",L=+"12",p=()=>{i.value=!0,nt({type:"hot_extral",num:L,extral_num:u}).then(y=>{t.value=y.topics,l.value=y.extral_topics??[],w.value=!0,i.value=!1}).catch(y=>{i.value=!1})},O=y=>y>=1e3?(y/1e3).toFixed(1)+"k":y,r=()=>{_.push({name:"home",query:{q:c.value}})},w=Q({get:()=>n.state.userLogined&&l.value.length!==0,set:y=>{}});return H(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(y,E)=>{(y.refreshTopicFollow!==E.refreshTopicFollow||y.userLogined)&&p()}),j(()=>{p()}),(y,E)=>{const x=F,$=ce,K=ae("router-link"),V=Ee,f=de,_e=ue;return m(n).state.collapsedRight?M("",!0):(v(),T("div",rt,[k("div",at,[o($,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":E[0]||(E[0]=C=>c.value=C),onKeyup:q(D(r,["prevent"]),["enter"])},{prefix:a(()=>[o(x,{component:m(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),m(w)?(v(),N(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(l.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(K,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",lt,I(O(C.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:i.value},{default:a(()=>[(v(!0),T(J,null,X(t.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(K,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",ut,I(O(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),o(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",ct,"© "+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,it),k("a",{href:m(h),target:"_blank",class:"hash-link"},I(m(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=me(pt,[["__scopeId","data-v-f4a84024"]]),bo=(e={})=>s({method:"get",url:"/v1/captcha",params:e}),Po=e=>s({method:"post",url:"/v1/captcha",data:e}),Lo=e=>s({method:"post",url:"/v1/user/whisper",data:e}),Oo=e=>s({method:"post",url:"/v1/friend/requesting",data:e}),Ao=e=>s({method:"post",url:"/v1/friend/add",data:e}),To=e=>s({method:"post",url:"/v1/friend/reject",data:e}),Ro=e=>s({method:"post",url:"/v1/friend/delete",data:e}),Co=e=>s({method:"post",url:"/v1/user/phone",data:e}),Eo=e=>s({method:"post",url:"/v1/user/activate",data:e}),$o=e=>s({method:"post",url:"/v1/user/password",data:e}),Io=e=>s({method:"post",url:"/v1/user/nickname",data:e}),So=e=>s({method:"post",url:"/v1/user/avatar",data:e}),re=(e={})=>s({method:"get",url:"/v1/user/msgcount/unread",params:e}),Mo=e=>s({method:"get",url:"/v1/user/messages",params:e}),Uo=e=>s({method:"post",url:"/v1/user/message/read",data:e}),Ko=e=>s({method:"get",url:"/v1/user/collections",params:e}),qo=e=>s({method:"get",url:"/v1/user/profile",params:e}),Do=e=>s({method:"get",url:"/v1/user/posts",params:e}),No=e=>s({method:"get",url:"/v1/user/wallet/bills",params:e}),xo=e=>s({method:"post",url:"/v1/user/recharge",data:e}),Fo=e=>s({method:"get",url:"/v1/user/recharge",params:e}),Vo=e=>s({method:"get",url:"/v1/suggest/users",params:e}),zo=e=>s({method:"get",url:"/v1/suggest/tags",params:e}),Bo=e=>s({method:"get",url:"/v1/attachment/precheck",params:e}),Wo=e=>s({method:"get",url:"/v1/attachment",params:e}),Ho=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"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},At=z({__name:"sidebar",setup(e){const t=B(),l=ye(),i=le(),c=R(!1),n=R(l.name||""),_=R(),d=R("true".toLowerCase()==="true"),U=+"5000";H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?_.value||(re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)}),_.value=setInterval(()=>{re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)})},U)):_.value&&clearInterval(_.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const g=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"}]}),b=r=>"href"in r?P("div",{},r.label):r.label,h=r=>r.key==="messages"?P(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>P(F,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(F,null,{default:r.icon}),u=(r,w={})=>{n.value=r,i.push({name:r})},L=()=>{l.path==="/"&&t.commit("refresh"),u("home")},p=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},O=()=>{t.commit("userLogout"),t.commit("refresh"),L()};return window.$store=t,window.$message=$e(),(r,w)=>{const y=Se,E=Me,x=Ue,$=ie;return v(),T("div",ht,[k("div",gt,[o(y,{class:"logo-img",width:"36",src:m(_t),"preview-disabled":!0,onClick:L},null,8,["src"])]),o(E,{accordion:!0,"icon-size":24,options:m(g),"render-label":b,"render-icon":h,value:n.value,"onUpdate:value":u},null,8,["options","value"]),m(t).state.userInfo.id>0?(v(),T("div",ft,[o(x,{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($,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:O},{icon:a(()=>[o(m(F),null,{default:a(()=>[o(m(oe))]),_:1})]),_:1})]),k("div",kt,"@"+I(m(t).state.userInfo.username),1)]),k("div",bt,[o($,{class:"logout",quaternary:"",circle:"",onClick:O},{icon:a(()=>[o(m(F),{size:24},{default:a(()=>[o(m(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?M("",!0):(v(),T("div",Lt,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Ot,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),o($,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=K=>p("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):M("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Rt={key:0},Ct={class:"content-wrap"},Et=z({__name:"App",setup(e){const t=B(),l=Q(()=>t.state.theme==="dark"?qe:null);return(i,c)=>{const n=At,_=ae("router-view"),d=mt,U=st,g=De,b=Ne,h=xe,u=Ke;return v(),N(u,{theme:m(l)},{default:a(()=>[o(b,null,{default:a(()=>[o(g,null,{default:a(()=>{var L;return[k("div",{class:ge(["app-container",{dark:((L=m(l))==null?void 0:L.name)==="dark",mobile:!m(t).state.desktopModelShow}])},[k("div",Tt,[m(t).state.desktopModelShow?(v(),T("div",Rt,[o(n)])):M("",!0),k("div",Ct,[o(_,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),N(he,null,[i.$route.meta.keepAlive?(v(),N(Z(p),{key:0})):M("",!0)],1024)),i.$route.meta.keepAlive?M("",!0):(v(),N(Z(p),{key:0}))]),_:1})]),o(d)]),o(U)],2)]}),_:1})]),_:1}),o(h)]),_:1},8,["theme"])}}});fe(Et).use(pe).use(Xe).mount("#app");export{Do as A,Lo as B,Oo as C,qo as D,Ro as E,Ho as F,Ao as G,To as H,Uo as I,Mo as J,Ko as K,Bo as L,Wo as M,no as N,W as O,No as P,xo as Q,Fo as R,bo as S,So as T,$o as U,Co as V,Eo as W,Io as X,Po as Y,At as Z,me as _,zo as a,Jt as b,ro as c,_o as d,vo as e,io as f,Vo as g,po as h,fo as i,go as j,ho as k,Zt as l,to as m,ao as n,lo as o,eo as p,oo as q,Xt as r,uo as s,mo as t,so as u,co as v,wo as w,ko as x,yo as y,nt as z}; +import{d as z,r as R,D as Y,j,o as v,K as N,$ as a,a as k,L as o,c as T,e as S,P as q,a0 as D,O as M,Y as m,n as Q,w as H,a1 as ae,F as J,a2 as X,M as I,s as P,a3 as he,Q as Z,a4 as ge,a5 as fe}from"./@vue-ca177dbe.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-88cc84d1.js";import{c as ke,u as B}from"./vuex-d28e9067.js";import{a as be}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ue,b as ce,c as Oe,d as Ae,e as ie,f as Te,g as Re,h as de,i as Ce,j as F,k as Ee,u as $e,l as Ie,m as Se,n as Me,o as Ue,p as Ke,q as qe,r as De,s as Ne,t as xe}from"./naive-ui-2035804c.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-6d35273b.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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 _ of n.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&i(_)}).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 Ge="modulepreload",Ye=function(e){return"/"+e},se={},A=function(t,l,i){if(!l||l.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Ye(n),n in se)return;se[n]=!0;const _=n.endsWith(".css"),d=_?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const h=c[b];if(h.href===n&&(!_||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=_?"stylesheet":Ge,_||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),_)return new Promise((b,h)=>{g.addEventListener("load",b),g.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Je=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-7bf0efc5.js"),["assets/Home-7bf0efc5.js","assets/post-item.vue_vue_type_style_index_0_lang-9289ab28.js","assets/content-6a6aebc0.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-db921567.js","assets/content-5ea7b681.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-6893dc8f.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Home-c075a37e.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"话题详情"},component:()=>A(()=>import("./Post-ace100c6.js"),["assets/Post-ace100c6.js","assets/@vue-ca177dbe.js","assets/vuex-d28e9067.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/IEnum-a180d93e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/content-6a6aebc0.js","assets/nonesir-video-db921567.js","assets/content-5ea7b681.css","assets/vue-router-88cc84d1.js","assets/post-skeleton-6893dc8f.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js","assets/main-nav-3ef9bae6.css","assets/v3-infinite-loading-fcb59c38.js","assets/v3-infinite-loading-7d241236.css","assets/axios-4a70c6fc.js","assets/Post-521adc02.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-264d6837.js"),["assets/Topic-264d6837.js","assets/@vicons-6d35273b.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-1679b128.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Topic-8dbcebb5.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>A(()=>import("./Anouncement-97cee4d9.js"),["assets/Anouncement-97cee4d9.js","assets/post-skeleton-6893dc8f.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-1679b128.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>A(()=>import("./Profile-8cc07523.js"),["assets/Profile-8cc07523.js","assets/post-item.vue_vue_type_style_index_0_lang-9289ab28.js","assets/content-6a6aebc0.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-db921567.js","assets/content-5ea7b681.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-6893dc8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Profile-87e8712d.css","assets/vfonts-7afd136d.css"])},{path:"/user",name:"user",meta:{title:"用户详情"},component:()=>A(()=>import("./User-35076387.js"),["assets/User-35076387.js","assets/post-item.vue_vue_type_style_index_0_lang-9289ab28.js","assets/content-6a6aebc0.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-db921567.js","assets/content-5ea7b681.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-6893dc8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/User-dfc90f68.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>A(()=>import("./Messages-52f808f4.js"),["assets/Messages-52f808f4.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-1679b128.js","assets/vuex-d28e9067.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Messages-7ed31ecd.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>A(()=>import("./Collection-f016c683.js"),["assets/Collection-f016c683.js","assets/post-item.vue_vue_type_style_index_0_lang-9289ab28.js","assets/content-6a6aebc0.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-db921567.js","assets/content-5ea7b681.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-6893dc8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Collection-b97b3cf7.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>A(()=>import("./Contacts-1a24d8d9.js"),["assets/Contacts-1a24d8d9.js","assets/vue-router-88cc84d1.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-6893dc8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js","assets/vuex-d28e9067.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Contacts-b60e5e0d.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>A(()=>import("./Wallet-a142acc0.js"),["assets/Wallet-a142acc0.js","assets/post-skeleton-6893dc8f.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-1679b128.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/qrcode-bd5089a5.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>A(()=>import("./Setting-35b8a21e.js"),["assets/Setting-35b8a21e.js","assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.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-4a70c6fc.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>A(()=>import("./404-3e96b6c8.js"),["assets/404-3e96b6c8.js","assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.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-4a70c6fc.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],pe=ve({history:we(),routes:Je});pe.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Xe=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}),Ze=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(),i=R(!1),c=R(),n=Y({username:"",password:""}),_=R(),d=Y({username:"",password:"",repassword:""}),U={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(h,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=c.value)==null||u.validate(L=>{L||(i.value=!0,ne({username:n.username,password:n.password}).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("登录成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),l.commit("refresh"),n.username="",n.password=""}).catch(p=>{i.value=!1}))})},b=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=_.value)==null||u.validate(L=>{L||(i.value=!0,Ze({username:d.username,password:d.password}).then(p=>ne({username:d.username,password:d.password})).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("注册成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{i.value=!1}))})};return j(()=>{const h=localStorage.getItem("PAOPAO_TOKEN")||"";h?W(h).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(h,u)=>{const L=Pe,p=Le,O=ue,r=ce,w=Oe,y=Ae,E=ie,x=Te,$=Re,K=de,V=Ce;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(K,{bordered:!1},{default:a(()=>[t.value?M("",!0):(v(),T("div",tt,[o(O,{justify:"center"},{default:a(()=>[o(p,null,{default:a(()=>[o(L,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),o(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(w,{label:"账户",path:"username"},{default:a(()=>[o(r,{value:n.username,"onUpdate:value":u[0]||(u[0]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),N($,{key:1,"default-value":m(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[o(x,{name:"signin",tab:"登录"},{default:a(()=>[o(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(w,{label:"账户",path:"username"},{default:a(()=>[o(r,{value:n.username,"onUpdate:value":u[2]||(u[2]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),o(x,{name:"signup",tab:"注册"},{default:a(()=>[o(y,{ref_key:"registerRef",ref:_,model:d,rules:U},{default:a(()=>[o(w,{label:"用户名",path:"username"},{default:a(()=>[o(r,{value:d.username,"onUpdate:value":u[4]||(u[4]=f=>d.username=f),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=f=>d.password=f),onKeyup:q(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"重复密码",path:"repassword"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=f=>d.repassword=f),onKeyup:q(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.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[i,c]of t)l[i]=c;return l},st=me(ot,[["__scopeId","data-v-053dfa44"]]),Jt=e=>s({method:"get",url:"/v1/posts",params:e}),nt=e=>s({method:"get",url:"/v1/tags",params:e}),Xt=e=>s({method:"get",url:"/v1/post",params:e}),Zt=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}),co=e=>s({method:"post",url:"/v1/post/visibility",data:e}),io=e=>s({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),po=e=>s({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),mo=e=>s({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),_o=e=>s({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),ho=e=>s({method:"post",url:"/v1/post/comment",data:e}),go=e=>s({method:"delete",url:"/v1/post/comment",data:e}),fo=e=>s({method:"post",url:"/v1/post/comment/reply",data:e}),vo=e=>s({method:"delete",url:"/v1/post/comment/reply",data:e}),wo=e=>s({method:"post",url:"/v1/topic/stick",data:e}),yo=e=>s({method:"post",url:"/v1/topic/follow",data:e}),ko=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"},ct={class:"copyright"},it=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=R([]),l=R([]),i=R(!1),c=R(""),n=B(),_=le(),d="2023 paopao.info",U="Roc's Me",g="",b="泡泡(PaoPao)开源社区",h="https://www.paopao.info",u=+"6",L=+"12",p=()=>{i.value=!0,nt({type:"hot_extral",num:L,extral_num:u}).then(y=>{t.value=y.topics,l.value=y.extral_topics??[],w.value=!0,i.value=!1}).catch(y=>{i.value=!1})},O=y=>y>=1e3?(y/1e3).toFixed(1)+"k":y,r=()=>{_.push({name:"home",query:{q:c.value}})},w=Q({get:()=>n.state.userLogined&&l.value.length!==0,set:y=>{}});return H(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(y,E)=>{(y.refreshTopicFollow!==E.refreshTopicFollow||y.userLogined)&&p()}),j(()=>{p()}),(y,E)=>{const x=F,$=ce,K=ae("router-link"),V=Ee,f=de,_e=ue;return m(n).state.collapsedRight?M("",!0):(v(),T("div",rt,[k("div",at,[o($,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":E[0]||(E[0]=C=>c.value=C),onKeyup:q(D(r,["prevent"]),["enter"])},{prefix:a(()=>[o(x,{component:m(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),m(w)?(v(),N(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(l.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(K,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",lt,I(O(C.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:i.value},{default:a(()=>[(v(!0),T(J,null,X(t.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(K,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",ut,I(O(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),o(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",ct,"© "+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,it),k("a",{href:m(h),target:"_blank",class:"hash-link"},I(m(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=me(pt,[["__scopeId","data-v-f4a84024"]]),bo=(e={})=>s({method:"get",url:"/v1/captcha",params:e}),Po=e=>s({method:"post",url:"/v1/captcha",data:e}),Lo=e=>s({method:"post",url:"/v1/user/whisper",data:e}),Oo=e=>s({method:"post",url:"/v1/friend/requesting",data:e}),Ao=e=>s({method:"post",url:"/v1/friend/add",data:e}),To=e=>s({method:"post",url:"/v1/friend/reject",data:e}),Ro=e=>s({method:"post",url:"/v1/friend/delete",data:e}),Co=e=>s({method:"post",url:"/v1/user/phone",data:e}),Eo=e=>s({method:"post",url:"/v1/user/activate",data:e}),$o=e=>s({method:"post",url:"/v1/user/password",data:e}),Io=e=>s({method:"post",url:"/v1/user/nickname",data:e}),So=e=>s({method:"post",url:"/v1/user/avatar",data:e}),re=(e={})=>s({method:"get",url:"/v1/user/msgcount/unread",params:e}),Mo=e=>s({method:"get",url:"/v1/user/messages",params:e}),Uo=e=>s({method:"post",url:"/v1/user/message/read",data:e}),Ko=e=>s({method:"get",url:"/v1/user/collections",params:e}),qo=e=>s({method:"get",url:"/v1/user/profile",params:e}),Do=e=>s({method:"get",url:"/v1/user/posts",params:e}),No=e=>s({method:"get",url:"/v1/user/wallet/bills",params:e}),xo=e=>s({method:"post",url:"/v1/user/recharge",data:e}),Fo=e=>s({method:"get",url:"/v1/user/recharge",params:e}),Vo=e=>s({method:"get",url:"/v1/suggest/users",params:e}),zo=e=>s({method:"get",url:"/v1/suggest/tags",params:e}),Bo=e=>s({method:"get",url:"/v1/attachment/precheck",params:e}),Wo=e=>s({method:"get",url:"/v1/attachment",params:e}),Ho=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"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},At=z({__name:"sidebar",setup(e){const t=B(),l=ye(),i=le(),c=R(!1),n=R(l.name||""),_=R(),d=R("true".toLowerCase()==="true"),U=+"5000";H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?_.value||(re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)}),_.value=setInterval(()=>{re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)})},U)):_.value&&clearInterval(_.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const g=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"}]}),b=r=>"href"in r?P("div",{},r.label):r.label,h=r=>r.key==="messages"?P(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>P(F,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(F,null,{default:r.icon}),u=(r,w={})=>{n.value=r,i.push({name:r})},L=()=>{l.path==="/"&&t.commit("refresh"),u("home")},p=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},O=()=>{t.commit("userLogout"),t.commit("refresh"),L()};return window.$store=t,window.$message=$e(),(r,w)=>{const y=Se,E=Me,x=Ue,$=ie;return v(),T("div",ht,[k("div",gt,[o(y,{class:"logo-img",width:"36",src:m(_t),"preview-disabled":!0,onClick:L},null,8,["src"])]),o(E,{accordion:!0,"icon-size":24,options:m(g),"render-label":b,"render-icon":h,value:n.value,"onUpdate:value":u},null,8,["options","value"]),m(t).state.userInfo.id>0?(v(),T("div",ft,[o(x,{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($,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:O},{icon:a(()=>[o(m(F),null,{default:a(()=>[o(m(oe))]),_:1})]),_:1})]),k("div",kt,"@"+I(m(t).state.userInfo.username),1)]),k("div",bt,[o($,{class:"logout",quaternary:"",circle:"",onClick:O},{icon:a(()=>[o(m(F),{size:24},{default:a(()=>[o(m(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?M("",!0):(v(),T("div",Lt,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Ot,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),o($,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=K=>p("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):M("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Rt={key:0},Ct={class:"content-wrap"},Et=z({__name:"App",setup(e){const t=B(),l=Q(()=>t.state.theme==="dark"?qe:null);return(i,c)=>{const n=At,_=ae("router-view"),d=mt,U=st,g=De,b=Ne,h=xe,u=Ke;return v(),N(u,{theme:m(l)},{default:a(()=>[o(b,null,{default:a(()=>[o(g,null,{default:a(()=>{var L;return[k("div",{class:ge(["app-container",{dark:((L=m(l))==null?void 0:L.name)==="dark",mobile:!m(t).state.desktopModelShow}])},[k("div",Tt,[m(t).state.desktopModelShow?(v(),T("div",Rt,[o(n)])):M("",!0),k("div",Ct,[o(_,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),N(he,null,[i.$route.meta.keepAlive?(v(),N(Z(p),{key:0})):M("",!0)],1024)),i.$route.meta.keepAlive?M("",!0):(v(),N(Z(p),{key:0}))]),_:1})]),o(d)]),o(U)],2)]}),_:1})]),_:1}),o(h)]),_:1},8,["theme"])}}});fe(Et).use(pe).use(Xe).mount("#app");export{Do as A,Lo as B,Oo as C,qo as D,Ro as E,Ho as F,Ao as G,To as H,Uo as I,Mo as J,Ko as K,Bo as L,Wo as M,no as N,W as O,No as P,xo as Q,Fo as R,bo as S,So as T,$o as U,Co as V,Eo as W,Io as X,Po as Y,At as Z,me as _,zo as a,Jt as b,ro as c,_o as d,vo as e,io as f,Vo as g,po as h,fo as i,go as j,ho as k,Zt as l,to as m,ao as n,lo as o,eo as p,oo as q,Xt as r,uo as s,mo as t,so as u,co as v,wo as w,ko as x,yo as y,nt as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js index 1530a59c..b3c6f490 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-423db962.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-1679b128.js @@ -1 +1 @@ -import{Z as B}from"./index-f400f811.js";import{u as E}from"./vuex-d28e9067.js";import{u as S}from"./vue-router-88cc84d1.js";import{j as A}from"./vooks-2c48c2b5.js";import{D as C,y as D,z as N,F as P}from"./@vicons-6d35273b.js";import{a3 as x,a4 as R,j as I,e as V,a5 as j,h as F}from"./naive-ui-2035804c.js";import{d as H,r as f,j as L,o as a,c as g,Y as o,L as e,$ as t,O as c,a as $,K as _,e as q,M as U,F as K}from"./@vue-ca177dbe.js";const Y={key:0},Z={class:"navbar"},oe=H({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(r){const i=r,n=E(),m=S(),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 L(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(d,p)=>{const y=B,b=x,O=R,s=I,h=V,M=j,T=F;return a(),g(K,null,[o(n).state.drawerModelShow?(a(),g("div",Y,[e(O,{show:l.value,"onUpdate:show":p[0]||(p[0]=z=>l.value=z),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(()=>[$("div",Z,[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),q(" "+U(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{Z as B}from"./index-effb87c4.js";import{u as E}from"./vuex-d28e9067.js";import{u as S}from"./vue-router-88cc84d1.js";import{j as A}from"./vooks-2c48c2b5.js";import{D as C,y as D,z as N,F as P}from"./@vicons-6d35273b.js";import{a3 as x,a4 as R,j as I,e as V,a5 as j,h as F}from"./naive-ui-2035804c.js";import{d as H,r as f,j as L,o as a,c as g,Y as o,L as e,$ as t,O as c,a as $,K as _,e as q,M as U,F as K}from"./@vue-ca177dbe.js";const Y={key:0},Z={class:"navbar"},oe=H({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(r){const i=r,n=E(),m=S(),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 L(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(d,p)=>{const y=B,b=x,O=R,s=I,h=V,M=j,T=F;return a(),g(K,null,[o(n).state.drawerModelShow?(a(),g("div",Y,[e(O,{show:l.value,"onUpdate:show":p[0]||(p[0]=z=>l.value=z),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(()=>[$("div",Z,[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),q(" "+U(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-a8faecc0.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-9289ab28.js similarity index 98% rename from web/dist/assets/post-item.vue_vue_type_style_index_0_lang-a8faecc0.js rename to web/dist/assets/post-item.vue_vue_type_style_index_0_lang-9289ab28.js index 385651d8..87de9e1a 100644 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-a8faecc0.js +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-9289ab28.js @@ -1 +1 @@ -import{p as B,a as N,_ as P,b as D,c as S}from"./content-b7753a95.js";import{d as V,n as H,a1 as F,o as r,c as f,L as l,a6 as I,Y as t,$ as n,a as p,F as A,a2 as E,a0 as v,e as u,M as d,K as _,O as m}from"./@vue-ca177dbe.js";import{u as K}from"./vuex-d28e9067.js";import{u as R}from"./vue-router-88cc84d1.js";import{b as Y}from"./formatTime-000dbebb.js";import{a as ot}from"./copy-to-clipboard-1dd3075d.js";import{i as at,j as G,l as J,m as Q}from"./@vicons-6d35273b.js";import{o as U,M as W,j as X,e as it,O as lt,a as Z,L as tt}from"./naive-ui-2035804c.js";const rt={class:"post-item"},ct={class:"nickname-wrap"},pt={class:"username-wrap"},_t={class:"timestamp-mobile"},mt={class:"item-header-extra"},ut=["innerHTML"],dt={class:"opt-item"},ht={class:"opt-item"},Ot=V({__name:"mobile-post-item",props:{post:null},setup(q){const T=q,g=R(),L=K(),e=H(()=>[{label:"复制链接",key:"copyTweetLink"}]),x=async i=>{switch(i){case"copyTweetLink":ot(`${window.location.origin}/#/post?id=${s.value.id}`),window.$message.success("链接已复制到剪贴板");break}},s=H(()=>{let i=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return i.contents.map(a=>{(+a.type==1||+a.type==2)&&i.texts.push(a),+a.type==3&&i.imgs.push(a),+a.type==4&&i.videos.push(a),+a.type==6&&i.links.push(a),+a.type==7&&i.attachments.push(a),+a.type==8&&i.charge_attachments.push(a)}),i}),c=i=>{g.push({name:"post",query:{id:i}})},o=(i,a)=>{if(i.target.dataset.detail){const h=i.target.dataset.detail.split(":");if(h.length===2){L.commit("refresh"),h[0]==="tag"?g.push({name:"home",query:{q:h[1],t:"tag"}}):g.push({name:"user",query:{username:h[1]}});return}}c(a)};return(i,a)=>{const h=U,b=F("router-link"),w=W,y=X,M=it,$=lt,z=N,O=P,k=D,j=S,et=Z,st=tt;return r(),f("div",rt,[l(st,{"content-indented":""},I({avatar:n(()=>[l(h,{round:"",size:30,src:t(s).user.avatar},null,8,["src"])]),header:n(()=>[p("span",ct,[l(b,{onClick:a[0]||(a[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(s).user.username}}},{default:n(()=>[u(d(t(s).user.nickname),1)]),_:1},8,["to"])]),p("span",pt," @"+d(t(s).user.username),1),t(s).is_top?(r(),_(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[u(" 置顶 ")]),_:1})):m("",!0),t(s).visibility==1?(r(),_(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[u(" 私密 ")]),_:1})):m("",!0),t(s).visibility==2?(r(),_(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[u(" 好友可见 ")]),_:1})):m("",!0),p("div",null,[p("span",_t,d(t(Y)(t(s).created_on))+" "+d(t(s).ip_loc),1)])]),"header-extra":n(()=>[p("div",mt,[l($,{placement:"bottom-end",trigger:"click",size:"small",options:t(e),onSelect:x},{default:n(()=>[l(M,{quaternary:"",circle:""},{icon:n(()=>[l(y,null,{default:n(()=>[l(t(at))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[t(s).attachments.length>0?(r(),_(z,{key:0,attachments:t(s).attachments},null,8,["attachments"])):m("",!0),t(s).charge_attachments.length>0?(r(),_(z,{key:1,attachments:t(s).charge_attachments,price:t(s).attachment_price},null,8,["attachments","price"])):m("",!0),t(s).imgs.length>0?(r(),_(O,{key:2,imgs:t(s).imgs},null,8,["imgs"])):m("",!0),t(s).videos.length>0?(r(),_(k,{key:3,videos:t(s).videos},null,8,["videos"])):m("",!0),t(s).links.length>0?(r(),_(j,{key:4,links:t(s).links},null,8,["links"])):m("",!0)]),action:n(()=>[l(et,{justify:"space-between"},{default:n(()=>[p("div",dt,[l(y,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(G))]),_:1}),u(" "+d(t(s).upvote_count),1)]),p("div",{class:"opt-item",onClick:a[3]||(a[3]=v(C=>c(t(s).id),["stop"]))},[l(y,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(J))]),_:1}),u(" "+d(t(s).comment_count),1)]),p("div",ht,[l(y,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(Q))]),_:1}),u(" "+d(t(s).collection_count),1)])]),_:1})]),_:2},[t(s).texts.length>0?{name:"description",fn:n(()=>[p("div",{onClick:a[2]||(a[2]=C=>c(t(s).id))},[(r(!0),f(A,null,E(t(s).texts,C=>(r(),f("span",{key:C.id,class:"post-text",onClick:a[1]||(a[1]=v(nt=>o(nt,t(s).id),["stop"])),innerHTML:t(B)(C.content).content},null,8,ut))),128))])]),key:"0"}:void 0]),1024)])}}});const gt={class:"nickname-wrap"},yt={class:"username-wrap"},kt={class:"item-header-extra"},ft={class:"timestamp"},vt=["innerHTML"],xt={class:"opt-item"},wt={class:"opt-item"},jt=V({__name:"post-item",props:{post:null},setup(q){const T=q,g=R(),L=K(),e=H(()=>{let c=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return c.contents.map(o=>{(+o.type==1||+o.type==2)&&c.texts.push(o),+o.type==3&&c.imgs.push(o),+o.type==4&&c.videos.push(o),+o.type==6&&c.links.push(o),+o.type==7&&c.attachments.push(o),+o.type==8&&c.charge_attachments.push(o)}),c}),x=c=>{g.push({name:"post",query:{id:c}})},s=(c,o)=>{if(c.target.dataset.detail){const i=c.target.dataset.detail.split(":");if(i.length===2){L.commit("refresh"),i[0]==="tag"?g.push({name:"home",query:{q:i[1],t:"tag"}}):g.push({name:"user",query:{username:i[1]}});return}}x(o)};return(c,o)=>{const i=U,a=F("router-link"),h=W,b=N,w=P,y=D,M=S,$=X,z=Z,O=tt;return r(),f("div",{class:"post-item",onClick:o[3]||(o[3]=k=>x(t(e).id))},[l(O,{"content-indented":""},I({avatar:n(()=>[l(i,{round:"",size:30,src:t(e).user.avatar},null,8,["src"])]),header:n(()=>[p("span",gt,[l(a,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(e).user.username}}},{default:n(()=>[u(d(t(e).user.nickname),1)]),_:1},8,["to"])]),p("span",yt," @"+d(t(e).user.username),1),t(e).is_top?(r(),_(h,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[u(" 置顶 ")]),_:1})):m("",!0),t(e).visibility==1?(r(),_(h,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[u(" 私密 ")]),_:1})):m("",!0),t(e).visibility==2?(r(),_(h,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[u(" 好友可见 ")]),_:1})):m("",!0)]),"header-extra":n(()=>[p("div",kt,[p("span",ft,d(t(e).ip_loc?t(e).ip_loc+" · ":t(e).ip_loc)+" "+d(t(Y)(t(e).created_on)),1)])]),footer:n(()=>[t(e).attachments.length>0?(r(),_(b,{key:0,attachments:t(e).attachments},null,8,["attachments"])):m("",!0),t(e).charge_attachments.length>0?(r(),_(b,{key:1,attachments:t(e).charge_attachments,price:t(e).attachment_price},null,8,["attachments","price"])):m("",!0),t(e).imgs.length>0?(r(),_(w,{key:2,imgs:t(e).imgs},null,8,["imgs"])):m("",!0),t(e).videos.length>0?(r(),_(y,{key:3,videos:t(e).videos},null,8,["videos"])):m("",!0),t(e).links.length>0?(r(),_(M,{key:4,links:t(e).links},null,8,["links"])):m("",!0)]),action:n(()=>[l(z,{justify:"space-between"},{default:n(()=>[p("div",xt,[l($,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(G))]),_:1}),u(" "+d(t(e).upvote_count),1)]),p("div",{class:"opt-item",onClick:o[2]||(o[2]=v(k=>x(t(e).id),["stop"]))},[l($,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(J))]),_:1}),u(" "+d(t(e).comment_count),1)]),p("div",wt,[l($,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(Q))]),_:1}),u(" "+d(t(e).collection_count),1)])]),_:1})]),_:2},[t(e).texts.length>0?{name:"description",fn:n(()=>[(r(!0),f(A,null,E(t(e).texts,k=>(r(),f("span",{key:k.id,class:"post-text",onClick:o[1]||(o[1]=v(j=>s(j,t(e).id),["stop"])),innerHTML:t(B)(k.content).content},null,8,vt))),128))]),key:"0"}:void 0]),1024)])}}});export{jt as _,Ot as a}; +import{p as B,a as N,_ as P,b as D,c as S}from"./content-6a6aebc0.js";import{d as V,n as H,a1 as F,o as r,c as f,L as l,a6 as I,Y as t,$ as n,a as p,F as A,a2 as E,a0 as v,e as u,M as d,K as _,O as m}from"./@vue-ca177dbe.js";import{u as K}from"./vuex-d28e9067.js";import{u as R}from"./vue-router-88cc84d1.js";import{b as Y}from"./formatTime-000dbebb.js";import{a as ot}from"./copy-to-clipboard-1dd3075d.js";import{i as at,j as G,l as J,m as Q}from"./@vicons-6d35273b.js";import{o as U,M as W,j as X,e as it,O as lt,a as Z,L as tt}from"./naive-ui-2035804c.js";const rt={class:"post-item"},ct={class:"nickname-wrap"},pt={class:"username-wrap"},_t={class:"timestamp-mobile"},mt={class:"item-header-extra"},ut=["innerHTML"],dt={class:"opt-item"},ht={class:"opt-item"},Ot=V({__name:"mobile-post-item",props:{post:null},setup(q){const T=q,g=R(),L=K(),e=H(()=>[{label:"复制链接",key:"copyTweetLink"}]),x=async i=>{switch(i){case"copyTweetLink":ot(`${window.location.origin}/#/post?id=${s.value.id}`),window.$message.success("链接已复制到剪贴板");break}},s=H(()=>{let i=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return i.contents.map(a=>{(+a.type==1||+a.type==2)&&i.texts.push(a),+a.type==3&&i.imgs.push(a),+a.type==4&&i.videos.push(a),+a.type==6&&i.links.push(a),+a.type==7&&i.attachments.push(a),+a.type==8&&i.charge_attachments.push(a)}),i}),c=i=>{g.push({name:"post",query:{id:i}})},o=(i,a)=>{if(i.target.dataset.detail){const h=i.target.dataset.detail.split(":");if(h.length===2){L.commit("refresh"),h[0]==="tag"?g.push({name:"home",query:{q:h[1],t:"tag"}}):g.push({name:"user",query:{username:h[1]}});return}}c(a)};return(i,a)=>{const h=U,b=F("router-link"),w=W,y=X,M=it,$=lt,z=N,O=P,k=D,j=S,et=Z,st=tt;return r(),f("div",rt,[l(st,{"content-indented":""},I({avatar:n(()=>[l(h,{round:"",size:30,src:t(s).user.avatar},null,8,["src"])]),header:n(()=>[p("span",ct,[l(b,{onClick:a[0]||(a[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(s).user.username}}},{default:n(()=>[u(d(t(s).user.nickname),1)]),_:1},8,["to"])]),p("span",pt," @"+d(t(s).user.username),1),t(s).is_top?(r(),_(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[u(" 置顶 ")]),_:1})):m("",!0),t(s).visibility==1?(r(),_(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[u(" 私密 ")]),_:1})):m("",!0),t(s).visibility==2?(r(),_(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[u(" 好友可见 ")]),_:1})):m("",!0),p("div",null,[p("span",_t,d(t(Y)(t(s).created_on))+" "+d(t(s).ip_loc),1)])]),"header-extra":n(()=>[p("div",mt,[l($,{placement:"bottom-end",trigger:"click",size:"small",options:t(e),onSelect:x},{default:n(()=>[l(M,{quaternary:"",circle:""},{icon:n(()=>[l(y,null,{default:n(()=>[l(t(at))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[t(s).attachments.length>0?(r(),_(z,{key:0,attachments:t(s).attachments},null,8,["attachments"])):m("",!0),t(s).charge_attachments.length>0?(r(),_(z,{key:1,attachments:t(s).charge_attachments,price:t(s).attachment_price},null,8,["attachments","price"])):m("",!0),t(s).imgs.length>0?(r(),_(O,{key:2,imgs:t(s).imgs},null,8,["imgs"])):m("",!0),t(s).videos.length>0?(r(),_(k,{key:3,videos:t(s).videos},null,8,["videos"])):m("",!0),t(s).links.length>0?(r(),_(j,{key:4,links:t(s).links},null,8,["links"])):m("",!0)]),action:n(()=>[l(et,{justify:"space-between"},{default:n(()=>[p("div",dt,[l(y,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(G))]),_:1}),u(" "+d(t(s).upvote_count),1)]),p("div",{class:"opt-item",onClick:a[3]||(a[3]=v(C=>c(t(s).id),["stop"]))},[l(y,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(J))]),_:1}),u(" "+d(t(s).comment_count),1)]),p("div",ht,[l(y,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(Q))]),_:1}),u(" "+d(t(s).collection_count),1)])]),_:1})]),_:2},[t(s).texts.length>0?{name:"description",fn:n(()=>[p("div",{onClick:a[2]||(a[2]=C=>c(t(s).id))},[(r(!0),f(A,null,E(t(s).texts,C=>(r(),f("span",{key:C.id,class:"post-text",onClick:a[1]||(a[1]=v(nt=>o(nt,t(s).id),["stop"])),innerHTML:t(B)(C.content).content},null,8,ut))),128))])]),key:"0"}:void 0]),1024)])}}});const gt={class:"nickname-wrap"},yt={class:"username-wrap"},kt={class:"item-header-extra"},ft={class:"timestamp"},vt=["innerHTML"],xt={class:"opt-item"},wt={class:"opt-item"},jt=V({__name:"post-item",props:{post:null},setup(q){const T=q,g=R(),L=K(),e=H(()=>{let c=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return c.contents.map(o=>{(+o.type==1||+o.type==2)&&c.texts.push(o),+o.type==3&&c.imgs.push(o),+o.type==4&&c.videos.push(o),+o.type==6&&c.links.push(o),+o.type==7&&c.attachments.push(o),+o.type==8&&c.charge_attachments.push(o)}),c}),x=c=>{g.push({name:"post",query:{id:c}})},s=(c,o)=>{if(c.target.dataset.detail){const i=c.target.dataset.detail.split(":");if(i.length===2){L.commit("refresh"),i[0]==="tag"?g.push({name:"home",query:{q:i[1],t:"tag"}}):g.push({name:"user",query:{username:i[1]}});return}}x(o)};return(c,o)=>{const i=U,a=F("router-link"),h=W,b=N,w=P,y=D,M=S,$=X,z=Z,O=tt;return r(),f("div",{class:"post-item",onClick:o[3]||(o[3]=k=>x(t(e).id))},[l(O,{"content-indented":""},I({avatar:n(()=>[l(i,{round:"",size:30,src:t(e).user.avatar},null,8,["src"])]),header:n(()=>[p("span",gt,[l(a,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(e).user.username}}},{default:n(()=>[u(d(t(e).user.nickname),1)]),_:1},8,["to"])]),p("span",yt," @"+d(t(e).user.username),1),t(e).is_top?(r(),_(h,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[u(" 置顶 ")]),_:1})):m("",!0),t(e).visibility==1?(r(),_(h,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[u(" 私密 ")]),_:1})):m("",!0),t(e).visibility==2?(r(),_(h,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[u(" 好友可见 ")]),_:1})):m("",!0)]),"header-extra":n(()=>[p("div",kt,[p("span",ft,d(t(e).ip_loc?t(e).ip_loc+" · ":t(e).ip_loc)+" "+d(t(Y)(t(e).created_on)),1)])]),footer:n(()=>[t(e).attachments.length>0?(r(),_(b,{key:0,attachments:t(e).attachments},null,8,["attachments"])):m("",!0),t(e).charge_attachments.length>0?(r(),_(b,{key:1,attachments:t(e).charge_attachments,price:t(e).attachment_price},null,8,["attachments","price"])):m("",!0),t(e).imgs.length>0?(r(),_(w,{key:2,imgs:t(e).imgs},null,8,["imgs"])):m("",!0),t(e).videos.length>0?(r(),_(y,{key:3,videos:t(e).videos},null,8,["videos"])):m("",!0),t(e).links.length>0?(r(),_(M,{key:4,links:t(e).links},null,8,["links"])):m("",!0)]),action:n(()=>[l(z,{justify:"space-between"},{default:n(()=>[p("div",xt,[l($,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(G))]),_:1}),u(" "+d(t(e).upvote_count),1)]),p("div",{class:"opt-item",onClick:o[2]||(o[2]=v(k=>x(t(e).id),["stop"]))},[l($,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(J))]),_:1}),u(" "+d(t(e).comment_count),1)]),p("div",wt,[l($,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(Q))]),_:1}),u(" "+d(t(e).collection_count),1)])]),_:1})]),_:2},[t(e).texts.length>0?{name:"description",fn:n(()=>[(r(!0),f(A,null,E(t(e).texts,k=>(r(),f("span",{key:k.id,class:"post-text",onClick:o[1]||(o[1]=v(j=>s(j,t(e).id),["stop"])),innerHTML:t(B)(k.content).content},null,8,vt))),128))]),key:"0"}:void 0]),1024)])}}});export{jt as _,Ot as a}; diff --git a/web/dist/assets/post-skeleton-78c5cb50.js b/web/dist/assets/post-skeleton-6893dc8f.js similarity index 88% rename from web/dist/assets/post-skeleton-78c5cb50.js rename to web/dist/assets/post-skeleton-6893dc8f.js index 3fa797f2..2dc21230 100644 --- a/web/dist/assets/post-skeleton-78c5cb50.js +++ b/web/dist/assets/post-skeleton-6893dc8f.js @@ -1 +1 @@ -import{U as c}from"./naive-ui-2035804c.js";import{d as r,o as s,c as n,a2 as l,a as o,L as t,F as p}from"./@vue-ca177dbe.js";import{_ as i}from"./index-f400f811.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-2035804c.js";import{d as r,o as s,c as n,a2 as l,a as o,L as t,F as p}from"./@vue-ca177dbe.js";import{_ as i}from"./index-effb87c4.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 fd390702..beab7ef6 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/components/compose-reply.vue b/web/src/components/compose-reply.vue index 35904e2b..732acccc 100644 --- a/web/src/components/compose-reply.vue +++ b/web/src/components/compose-reply.vue @@ -16,7 +16,7 @@ - {{ thumbsUpCount }} + {{ thumbsUpCount>0 ? thumbsUpCount : "赞" }}
diff --git a/web/src/components/reply-item.vue b/web/src/components/reply-item.vue index 0aaca8d3..de40b6e3 100644 --- a/web/src/components/reply-item.vue +++ b/web/src/components/reply-item.vue @@ -58,7 +58,7 @@ - {{ thumbsUpCount }} + {{ thumbsUpCount>0 ? thumbsUpCount : "赞" }}
@@ -204,7 +204,7 @@ const execDelAction = () => { display: block; .content { - width: calc(100% - 40px); + width: calc(100%); margin-top: 4px; font-size: 12px; text-align: justify;