From f254edaa87b182b9780eafa8b1ba458a37b54ea8 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Wed, 6 Sep 2023 20:43:49 +0800 Subject: [PATCH] frontend: optimize post page --- web/dist/assets/{404-b2b07932.js => 404-71d65ace.js} | 2 +- .../{Anouncement-2e8c2b37.js => Anouncement-52f985c0.js} | 2 +- .../{Collection-137c1486.js => Collection-619e8473.js} | 2 +- .../{Contacts-38a5cec7.js => Contacts-da926c71.js} | 2 +- .../{Following-0841e0ed.js => Following-8e085d0b.js} | 2 +- web/dist/assets/{Home-9d65330f.js => Home-62c9b54d.js} | 2 +- .../{Messages-a82c4399.js => Messages-e4d02674.js} | 2 +- web/dist/assets/{Post-b0a250af.js => Post-ed61910e.js} | 2 +- .../assets/{Profile-25637d74.js => Profile-6d9e62f3.js} | 2 +- .../assets/{Setting-ff8723d9.js => Setting-42f80d67.js} | 2 +- web/dist/assets/{Topic-36f0525d.js => Topic-0e4d12d8.js} | 2 +- web/dist/assets/{User-3da55cb6.js => User-0e1e60bd.js} | 2 +- .../assets/{Wallet-ef7a3d97.js => Wallet-f3715a73.js} | 2 +- .../assets/{content-64ba0596.js => content-e3389a3a.js} | 2 +- web/dist/assets/{index-cb280048.js => index-8d220080.js} | 2 +- ...main-nav.vue_vue_type_style_index_0_lang-a402eae2.js} | 2 +- ...ost-item.vue_vue_type_style_index_0_lang-899852f8.js} | 2 +- ...st-skeleton-26b3006b.js => post-skeleton-54a835d7.js} | 2 +- .../assets/{whisper-31e5b9ad.js => whisper-f9793dd1.js} | 2 +- web/dist/index.html | 2 +- web/src/components/post-detail.vue | 9 ++++----- 21 files changed, 24 insertions(+), 25 deletions(-) rename web/dist/assets/{404-b2b07932.js => 404-71d65ace.js} (84%) rename web/dist/assets/{Anouncement-2e8c2b37.js => Anouncement-52f985c0.js} (91%) rename web/dist/assets/{Collection-137c1486.js => Collection-619e8473.js} (84%) rename web/dist/assets/{Contacts-38a5cec7.js => Contacts-da926c71.js} (93%) rename web/dist/assets/{Following-0841e0ed.js => Following-8e085d0b.js} (94%) rename web/dist/assets/{Home-9d65330f.js => Home-62c9b54d.js} (98%) rename web/dist/assets/{Messages-a82c4399.js => Messages-e4d02674.js} (96%) rename web/dist/assets/{Post-b0a250af.js => Post-ed61910e.js} (58%) rename web/dist/assets/{Profile-25637d74.js => Profile-6d9e62f3.js} (95%) rename web/dist/assets/{Setting-ff8723d9.js => Setting-42f80d67.js} (97%) rename web/dist/assets/{Topic-36f0525d.js => Topic-0e4d12d8.js} (97%) rename web/dist/assets/{User-3da55cb6.js => User-0e1e60bd.js} (97%) rename web/dist/assets/{Wallet-ef7a3d97.js => Wallet-f3715a73.js} (96%) rename web/dist/assets/{content-64ba0596.js => content-e3389a3a.js} (99%) rename web/dist/assets/{index-cb280048.js => index-8d220080.js} (89%) rename web/dist/assets/{main-nav.vue_vue_type_style_index_0_lang-b165919a.js => main-nav.vue_vue_type_style_index_0_lang-a402eae2.js} (96%) rename web/dist/assets/{post-item.vue_vue_type_style_index_0_lang-00295cef.js => post-item.vue_vue_type_style_index_0_lang-899852f8.js} (98%) rename web/dist/assets/{post-skeleton-26b3006b.js => post-skeleton-54a835d7.js} (88%) rename web/dist/assets/{whisper-31e5b9ad.js => whisper-f9793dd1.js} (95%) diff --git a/web/dist/assets/404-b2b07932.js b/web/dist/assets/404-71d65ace.js similarity index 84% rename from web/dist/assets/404-b2b07932.js rename to web/dist/assets/404-71d65ace.js index 9dddfe4b..32985d27 100644 --- a/web/dist/assets/404-b2b07932.js +++ b/web/dist/assets/404-71d65ace.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{u as a}from"./vue-router-e5a2430e.js";import{F as i,e as c,a2 as u}from"./naive-ui-d8de3dda.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-cb280048.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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-a402eae2.js";import{u as a}from"./vue-router-e5a2430e.js";import{F as i,e as c,a2 as u}from"./naive-ui-d8de3dda.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-8d220080.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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-2e8c2b37.js b/web/dist/assets/Anouncement-52f985c0.js similarity index 91% rename from web/dist/assets/Anouncement-2e8c2b37.js rename to web/dist/assets/Anouncement-52f985c0.js index 4181c039..44eed8a8 100644 --- a/web/dist/assets/Anouncement-2e8c2b37.js +++ b/web/dist/assets/Anouncement-52f985c0.js @@ -1 +1 @@ -import{_ as F}from"./post-skeleton-26b3006b.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{a as R}from"./formatTime-4210fcd1.js";import{F as S,Q as V,I as q,G as I}from"./naive-ui-d8de3dda.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as H}from"./@vue-a481fc63.js";import{_ as L}from"./index-cb280048.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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 M={key:0,class:"pagination-wrap"},O={key:0,class:"skeleton-wrap"},Q={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),m=n(0),h=c=>{i.value=c};return j(()=>{}),(c,J)=>{const k=N,y=V,x=F,w=q,B=I,C=S;return e(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[m.value>1?(e(),o("div",M,[a(y,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",O,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",Q,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(D,null,E(r.value,t=>(e(),G(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:H({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 yt=L(Y,[["__scopeId","data-v-d4d04859"]]);export{yt as default}; +import{_ as F}from"./post-skeleton-54a835d7.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{a as R}from"./formatTime-4210fcd1.js";import{F as S,Q as V,I as q,G as I}from"./naive-ui-d8de3dda.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as H}from"./@vue-a481fc63.js";import{_ as L}from"./index-8d220080.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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 M={key:0,class:"pagination-wrap"},O={key:0,class:"skeleton-wrap"},Q={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),m=n(0),h=c=>{i.value=c};return j(()=>{}),(c,J)=>{const k=N,y=V,x=F,w=q,B=I,C=S;return e(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[m.value>1?(e(),o("div",M,[a(y,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",O,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",Q,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(D,null,E(r.value,t=>(e(),G(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:H({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 yt=L(Y,[["__scopeId","data-v-d4d04859"]]);export{yt as default}; diff --git a/web/dist/assets/Collection-137c1486.js b/web/dist/assets/Collection-619e8473.js similarity index 84% rename from web/dist/assets/Collection-137c1486.js rename to web/dist/assets/Collection-619e8473.js index 9c6429bb..1f58030a 100644 --- a/web/dist/assets/Collection-137c1486.js +++ b/web/dist/assets/Collection-619e8473.js @@ -1 +1 @@ -import{_ as q}from"./whisper-31e5b9ad.js";import{_ as I,a as V}from"./post-item.vue_vue_type_style_index_0_lang-00295cef.js";import{_ as W}from"./post-skeleton-26b3006b.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{u as G}from"./vuex-44de225f.js";import{b as H}from"./vue-router-e5a2430e.js";import{N as L,_ as Q}from"./index-cb280048.js";import{d as T,H as s,b as U,f as o,k as n,w as u,bf as h,Y as w,e,F as k,u as y,q as C}from"./@vue-a481fc63.js";import{F as Y,Q as j,I as A,G as D}from"./naive-ui-d8de3dda.js";import"./content-64ba0596.js";import"./@vicons-7a4ef312.js";import"./paopao-video-player-2fe58954.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const J={key:0,class:"skeleton-wrap"},K={key:1},O={key:0,class:"empty-wrap"},X={key:1},Z={key:2},ee={key:0,class:"pagination-wrap"},oe=T({__name:"Collection",setup(te){const m=G(),S=H(),_=s(!1),i=s([]),l=s(+S.query.p||1),p=s(20),r=s(0),c=s(!1),d=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),f=t=>{d.value=t,c.value=!0},b=()=>{c.value=!1},v=()=>{_.value=!0,L({page:l.value,page_size:p.value}).then(t=>{_.value=!1,i.value=t.list,r.value=Math.ceil(t.pager.total_rows/p.value),window.scrollTo(0,0)}).catch(t=>{_.value=!1})},x=t=>{l.value=t,v()};return U(()=>{v()}),(t,ne)=>{const $=E,z=W,B=A,F=I,g=D,M=V,N=q,P=Y,R=j;return e(),o("div",null,[n($,{title:"收藏"}),n(P,{class:"main-content-wrap",bordered:""},{default:u(()=>[_.value?(e(),o("div",J,[n(z,{num:p.value},null,8,["num"])])):(e(),o("div",K,[i.value.length===0?(e(),o("div",O,[n(B,{size:"large",description:"暂无数据"})])):w("",!0),h(m).state.desktopModelShow?(e(),o("div",X,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(F,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))])):(e(),o("div",Z,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(M,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))]))])),n(N,{show:c.value,user:d.value,onSuccess:b},null,8,["show","user"])]),_:1}),r.value>0?(e(),o("div",ee,[n(R,{page:l.value,"onUpdate:page":x,"page-slot":h(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):w("",!0)])}}});const Ve=Q(oe,[["__scopeId","data-v-760779af"]]);export{Ve as default}; +import{_ as q}from"./whisper-f9793dd1.js";import{_ as I,a as V}from"./post-item.vue_vue_type_style_index_0_lang-899852f8.js";import{_ as W}from"./post-skeleton-54a835d7.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{u as G}from"./vuex-44de225f.js";import{b as H}from"./vue-router-e5a2430e.js";import{N as L,_ as Q}from"./index-8d220080.js";import{d as T,H as s,b as U,f as o,k as n,w as u,bf as h,Y as w,e,F as k,u as y,q as C}from"./@vue-a481fc63.js";import{F as Y,Q as j,I as A,G as D}from"./naive-ui-d8de3dda.js";import"./content-e3389a3a.js";import"./@vicons-7a4ef312.js";import"./paopao-video-player-2fe58954.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const J={key:0,class:"skeleton-wrap"},K={key:1},O={key:0,class:"empty-wrap"},X={key:1},Z={key:2},ee={key:0,class:"pagination-wrap"},oe=T({__name:"Collection",setup(te){const m=G(),S=H(),_=s(!1),i=s([]),l=s(+S.query.p||1),p=s(20),r=s(0),c=s(!1),d=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),f=t=>{d.value=t,c.value=!0},b=()=>{c.value=!1},v=()=>{_.value=!0,L({page:l.value,page_size:p.value}).then(t=>{_.value=!1,i.value=t.list,r.value=Math.ceil(t.pager.total_rows/p.value),window.scrollTo(0,0)}).catch(t=>{_.value=!1})},x=t=>{l.value=t,v()};return U(()=>{v()}),(t,ne)=>{const $=E,z=W,B=A,F=I,g=D,M=V,N=q,P=Y,R=j;return e(),o("div",null,[n($,{title:"收藏"}),n(P,{class:"main-content-wrap",bordered:""},{default:u(()=>[_.value?(e(),o("div",J,[n(z,{num:p.value},null,8,["num"])])):(e(),o("div",K,[i.value.length===0?(e(),o("div",O,[n(B,{size:"large",description:"暂无数据"})])):w("",!0),h(m).state.desktopModelShow?(e(),o("div",X,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(F,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))])):(e(),o("div",Z,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(M,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))]))])),n(N,{show:c.value,user:d.value,onSuccess:b},null,8,["show","user"])]),_:1}),r.value>0?(e(),o("div",ee,[n(R,{page:l.value,"onUpdate:page":x,"page-slot":h(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):w("",!0)])}}});const Ve=Q(oe,[["__scopeId","data-v-760779af"]]);export{Ve as default}; diff --git a/web/dist/assets/Contacts-38a5cec7.js b/web/dist/assets/Contacts-da926c71.js similarity index 93% rename from web/dist/assets/Contacts-38a5cec7.js rename to web/dist/assets/Contacts-da926c71.js index fcd2894b..a77d6a1f 100644 --- a/web/dist/assets/Contacts-38a5cec7.js +++ b/web/dist/assets/Contacts-da926c71.js @@ -1 +1 @@ -import{_ as T}from"./whisper-31e5b9ad.js";import{d as N,c as j,r as A,e as s,f as c,k as t,w as n,j as i,y as H,A as L,x as v,bf as g,h as I,H as a,b as U,Y as S,F as z,u as W,q as E}from"./@vue-a481fc63.js";import{b as G}from"./formatTime-4210fcd1.js";import{i as Q,p as Y}from"./@vicons-7a4ef312.js";import{j as x,o as J,e as K,O as X,L as Z,F as ee,Q as te,I as ne,G as oe}from"./naive-ui-d8de3dda.js";import{_ as q,b as se}from"./index-cb280048.js";import{_ as ae}from"./post-skeleton-26b3006b.js";import{_ as ce}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{u as ie}from"./vuex-44de225f.js";import{b as _e}from"./vue-router-e5a2430e.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 re={class:"contact-item"},le={class:"nickname-wrap"},pe={class:"username-wrap"},ue={class:"user-info"},me={class:"info-item"},de={class:"info-item"},fe={class:"item-header-extra"},ve=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:h}){const _=b,r=e=>()=>I(x,null,{default:()=>I(e)}),l=j(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),u=e=>{switch(e){case"whisper":const o={id:_.contact.user_id,avatar:_.contact.avatar,username:_.contact.username,nickname:_.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};h("send-whisper",o);break}};return(e,o)=>{const m=J,d=A("router-link"),w=K,k=X,y=Z;return s(),c("div",re,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[i("span",le,[t(d,{onClick:o[0]||(o[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[L(v(e.contact.nickname),1)]),_:1},8,["to"])]),i("span",pe," @"+v(e.contact.username),1),i("div",ue,[i("span",me," UID. "+v(e.contact.user_id),1),i("span",de,v(g(G)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[i("div",fe,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:l.value,onSelect:u},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(g(x),null,{default:n(()=>[t(g(Q))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const ge=q(ve,[["__scopeId","data-v-d62f19da"]]),he={key:0,class:"skeleton-wrap"},we={key:1},ke={key:0,class:"empty-wrap"},ye={key:0,class:"pagination-wrap"},be=N({__name:"Contacts",setup(b){const h=ie(),_=_e(),r=a(!1),l=a([]),u=a(+_.query.p||1),e=a(20),o=a(0),m=a(!1),d=a({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=p=>{d.value=p,m.value=!0},k=()=>{m.value=!1},y=p=>{u.value=p,C()};U(()=>{C()});const C=(p=!1)=>{l.value.length===0&&(r.value=!0),se({page:u.value,page_size:e.value}).then(f=>{r.value=!1,l.value=f.list,o.value=Math.ceil(f.pager.total_rows/e.value),p&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(f=>{r.value=!1})};return(p,f)=>{const B=ce,F=ae,M=ne,P=ge,V=oe,D=T,O=ee,R=te;return s(),c(z,null,[i("div",null,[t(B,{title:"好友"}),t(O,{class:"main-content-wrap",bordered:""},{default:n(()=>[r.value?(s(),c("div",he,[t(F,{num:e.value},null,8,["num"])])):(s(),c("div",we,[l.value.length===0?(s(),c("div",ke,[t(M,{size:"large",description:"暂无数据"})])):S("",!0),(s(!0),c(z,null,W(l.value,$=>(s(),E(V,{class:"list-item",key:$.user_id},{default:n(()=>[t(P,{contact:$,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(D,{show:m.value,user:d.value,onSuccess:k},null,8,["show","user"])]),_:1})]),o.value>0?(s(),c("div",ye,[t(R,{page:u.value,"onUpdate:page":y,"page-slot":g(h).state.collapsedRight?5:8,"page-count":o.value},null,8,["page","page-slot","page-count"])])):S("",!0)],64)}}});const Ye=q(be,[["__scopeId","data-v-e20fef94"]]);export{Ye as default}; +import{_ as T}from"./whisper-f9793dd1.js";import{d as N,c as j,r as A,e as s,f as c,k as t,w as n,j as i,y as H,A as L,x as v,bf as g,h as I,H as a,b as U,Y as S,F as z,u as W,q as E}from"./@vue-a481fc63.js";import{b as G}from"./formatTime-4210fcd1.js";import{i as Q,p as Y}from"./@vicons-7a4ef312.js";import{j as x,o as J,e as K,O as X,L as Z,F as ee,Q as te,I as ne,G as oe}from"./naive-ui-d8de3dda.js";import{_ as q,b as se}from"./index-8d220080.js";import{_ as ae}from"./post-skeleton-54a835d7.js";import{_ as ce}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{u as ie}from"./vuex-44de225f.js";import{b as _e}from"./vue-router-e5a2430e.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 re={class:"contact-item"},le={class:"nickname-wrap"},pe={class:"username-wrap"},ue={class:"user-info"},me={class:"info-item"},de={class:"info-item"},fe={class:"item-header-extra"},ve=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:h}){const _=b,r=e=>()=>I(x,null,{default:()=>I(e)}),l=j(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),u=e=>{switch(e){case"whisper":const o={id:_.contact.user_id,avatar:_.contact.avatar,username:_.contact.username,nickname:_.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};h("send-whisper",o);break}};return(e,o)=>{const m=J,d=A("router-link"),w=K,k=X,y=Z;return s(),c("div",re,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[i("span",le,[t(d,{onClick:o[0]||(o[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[L(v(e.contact.nickname),1)]),_:1},8,["to"])]),i("span",pe," @"+v(e.contact.username),1),i("div",ue,[i("span",me," UID. "+v(e.contact.user_id),1),i("span",de,v(g(G)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[i("div",fe,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:l.value,onSelect:u},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(g(x),null,{default:n(()=>[t(g(Q))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const ge=q(ve,[["__scopeId","data-v-d62f19da"]]),he={key:0,class:"skeleton-wrap"},we={key:1},ke={key:0,class:"empty-wrap"},ye={key:0,class:"pagination-wrap"},be=N({__name:"Contacts",setup(b){const h=ie(),_=_e(),r=a(!1),l=a([]),u=a(+_.query.p||1),e=a(20),o=a(0),m=a(!1),d=a({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=p=>{d.value=p,m.value=!0},k=()=>{m.value=!1},y=p=>{u.value=p,C()};U(()=>{C()});const C=(p=!1)=>{l.value.length===0&&(r.value=!0),se({page:u.value,page_size:e.value}).then(f=>{r.value=!1,l.value=f.list,o.value=Math.ceil(f.pager.total_rows/e.value),p&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(f=>{r.value=!1})};return(p,f)=>{const B=ce,F=ae,M=ne,P=ge,V=oe,D=T,O=ee,R=te;return s(),c(z,null,[i("div",null,[t(B,{title:"好友"}),t(O,{class:"main-content-wrap",bordered:""},{default:n(()=>[r.value?(s(),c("div",he,[t(F,{num:e.value},null,8,["num"])])):(s(),c("div",we,[l.value.length===0?(s(),c("div",ke,[t(M,{size:"large",description:"暂无数据"})])):S("",!0),(s(!0),c(z,null,W(l.value,$=>(s(),E(V,{class:"list-item",key:$.user_id},{default:n(()=>[t(P,{contact:$,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(D,{show:m.value,user:d.value,onSuccess:k},null,8,["show","user"])]),_:1})]),o.value>0?(s(),c("div",ye,[t(R,{page:u.value,"onUpdate:page":y,"page-slot":g(h).state.collapsedRight?5:8,"page-count":o.value},null,8,["page","page-slot","page-count"])])):S("",!0)],64)}}});const Ye=q(be,[["__scopeId","data-v-e20fef94"]]);export{Ye as default}; diff --git a/web/dist/assets/Following-0841e0ed.js b/web/dist/assets/Following-8e085d0b.js similarity index 94% rename from web/dist/assets/Following-0841e0ed.js rename to web/dist/assets/Following-8e085d0b.js index 22644c91..f2035174 100644 --- a/web/dist/assets/Following-0841e0ed.js +++ b/web/dist/assets/Following-8e085d0b.js @@ -1 +1 @@ -import{_ as Y}from"./whisper-31e5b9ad.js";import{d as B,c as J,r as K,e as _,f as u,k as o,w as t,j as p,y as X,A as x,x as k,q as N,Y as U,bf as g,h as C,H as r,b as Z,F as M,u as ee}from"./@vue-a481fc63.js";import{u as oe,b as ne}from"./vue-router-e5a2430e.js";import{G as te,H as se,_ as O,Q as ae,R as le}from"./index-cb280048.js";import{b as ce}from"./formatTime-4210fcd1.js";import{i as ie,p as _e,z as re,v as ue}from"./@vicons-7a4ef312.js";import{T as pe,j as P,o as me,M as de,e as fe,O as ge,L as ve,F as we,Q as he,f as ke,g as ye,I as be,G as $e}from"./naive-ui-d8de3dda.js";import{_ as Fe}from"./post-skeleton-26b3006b.js";import{_ as ze}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{u as Te}from"./vuex-44de225f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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-2ab8298d.js";const Ue={class:"follow-item"},qe={class:"nickname-wrap"},Ie={class:"username-wrap"},Se={class:"user-info"},xe={class:"info-item"},Ce={class:"info-item"},Me={class:"item-header-extra"},Pe=B({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(q,{emit:y}){const n=q,c=pe();oe();const s=e=>()=>C(P,null,{default:()=>C(e)}),b=()=>{c.success({title:"提示",content:"确定"+(n.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.contact.is_following?te({user_id:n.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),n.contact.is_following=!1}).catch(e=>{console.log(e)}):se({user_id:n.contact.user_id}).then(e=>{window.$message.success("关注成功"),n.contact.is_following=!0}).catch(e=>{console.log(e)})}})},v=J(()=>{let e=[{label:"私信",key:"whisper",icon:s(_e)}];return n.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:s(re)}):e.push({label:"关注",key:"follow",icon:s(ue)}),e}),m=e=>{switch(e){case"follow":case"unfollow":b();break;case"whisper":const a={id:n.contact.user_id,avatar:n.contact.avatar,username:n.contact.username,nickname:n.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};y("send-whisper",a);break}};return(e,a)=>{const d=me,f=K("router-link"),w=de,$=fe,F=ge,z=ve;return _(),u("div",Ue,[o(z,{"content-indented":""},{avatar:t(()=>[o(d,{size:54,src:e.contact.avatar},null,8,["src"])]),header:t(()=>[p("span",qe,[o(f,{onClick:a[0]||(a[0]=X(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:t(()=>[x(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",Ie," @"+k(e.contact.username),1),e.contact.is_following?(_(),N(w,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[x(" 已关注 ")]),_:1})):U("",!0),p("div",Se,[p("span",xe," UID. "+k(e.contact.user_id),1),p("span",Ce,k(g(ce)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Me,[o(F,{placement:"bottom-end",trigger:"click",size:"small",options:v.value,onSelect:m},{default:t(()=>[o($,{quaternary:"",circle:""},{icon:t(()=>[o(g(P),null,{default:t(()=>[o(g(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Be=O(Pe,[["__scopeId","data-v-1fb7364a"]]),Ne={key:0,class:"skeleton-wrap"},Oe={key:1},Re={key:0,class:"empty-wrap"},De={key:0,class:"pagination-wrap"},Ve=B({__name:"Following",setup(q){const y=Te(),n=ne(),c=r(!1),s=r([]),b=n.query.n||"粉丝详情",v=n.query.s||"",m=r(n.query.t||"follows"),e=r(+n.query.p||1),a=r(20),d=r(0),f=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),$=l=>{w.value=l,f.value=!0},F=()=>{f.value=!1},z=l=>{e.value=l,T()},R=l=>{m.value=l,T()},T=()=>{m.value==="follows"?D(v):m.value==="followings"&&V(v)},D=(l,h=!1)=>{s.value.length===0&&(c.value=!0),ae({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})},V=(l,h=!1)=>{s.value.length===0&&(c.value=!0),le({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})};return Z(()=>{T()}),(l,h)=>{const i=ze,I=ke,H=ye,W=Fe,j=be,A=Be,G=$e,L=Y,Q=we,E=he;return _(),u(M,null,[p("div",null,[o(i,{title:g(b),back:!0},null,8,["title"]),o(Q,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(H,{type:"line",animated:"","default-value":m.value,"onUpdate:value":R},{default:t(()=>[o(I,{name:"follows",tab:"正在关注"}),o(I,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),c.value?(_(),u("div",Ne,[o(W,{num:a.value},null,8,["num"])])):(_(),u("div",Oe,[s.value.length===0?(_(),u("div",Re,[o(j,{size:"large",description:"暂无数据"})])):U("",!0),(_(!0),u(M,null,ee(s.value,S=>(_(),N(G,{key:S.user_id},{default:t(()=>[o(A,{contact:S,onSendWhisper:$},null,8,["contact"])]),_:2},1024))),128))])),o(L,{show:f.value,user:w.value,onSuccess:F},null,8,["show","user"])]),_:1})]),d.value>0?(_(),u("div",De,[o(E,{page:e.value,"onUpdate:page":z,"page-slot":g(y).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):U("",!0)],64)}}});const mo=O(Ve,[["__scopeId","data-v-0a10234f"]]);export{mo as default}; +import{_ as Y}from"./whisper-f9793dd1.js";import{d as B,c as J,r as K,e as _,f as u,k as o,w as t,j as p,y as X,A as x,x as k,q as N,Y as U,bf as g,h as C,H as r,b as Z,F as M,u as ee}from"./@vue-a481fc63.js";import{u as oe,b as ne}from"./vue-router-e5a2430e.js";import{G as te,H as se,_ as O,Q as ae,R as le}from"./index-8d220080.js";import{b as ce}from"./formatTime-4210fcd1.js";import{i as ie,p as _e,z as re,v as ue}from"./@vicons-7a4ef312.js";import{T as pe,j as P,o as me,M as de,e as fe,O as ge,L as ve,F as we,Q as he,f as ke,g as ye,I as be,G as $e}from"./naive-ui-d8de3dda.js";import{_ as Fe}from"./post-skeleton-54a835d7.js";import{_ as ze}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{u as Te}from"./vuex-44de225f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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-2ab8298d.js";const Ue={class:"follow-item"},qe={class:"nickname-wrap"},Ie={class:"username-wrap"},Se={class:"user-info"},xe={class:"info-item"},Ce={class:"info-item"},Me={class:"item-header-extra"},Pe=B({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(q,{emit:y}){const n=q,c=pe();oe();const s=e=>()=>C(P,null,{default:()=>C(e)}),b=()=>{c.success({title:"提示",content:"确定"+(n.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.contact.is_following?te({user_id:n.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),n.contact.is_following=!1}).catch(e=>{console.log(e)}):se({user_id:n.contact.user_id}).then(e=>{window.$message.success("关注成功"),n.contact.is_following=!0}).catch(e=>{console.log(e)})}})},v=J(()=>{let e=[{label:"私信",key:"whisper",icon:s(_e)}];return n.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:s(re)}):e.push({label:"关注",key:"follow",icon:s(ue)}),e}),m=e=>{switch(e){case"follow":case"unfollow":b();break;case"whisper":const a={id:n.contact.user_id,avatar:n.contact.avatar,username:n.contact.username,nickname:n.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};y("send-whisper",a);break}};return(e,a)=>{const d=me,f=K("router-link"),w=de,$=fe,F=ge,z=ve;return _(),u("div",Ue,[o(z,{"content-indented":""},{avatar:t(()=>[o(d,{size:54,src:e.contact.avatar},null,8,["src"])]),header:t(()=>[p("span",qe,[o(f,{onClick:a[0]||(a[0]=X(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:t(()=>[x(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",Ie," @"+k(e.contact.username),1),e.contact.is_following?(_(),N(w,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[x(" 已关注 ")]),_:1})):U("",!0),p("div",Se,[p("span",xe," UID. "+k(e.contact.user_id),1),p("span",Ce,k(g(ce)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Me,[o(F,{placement:"bottom-end",trigger:"click",size:"small",options:v.value,onSelect:m},{default:t(()=>[o($,{quaternary:"",circle:""},{icon:t(()=>[o(g(P),null,{default:t(()=>[o(g(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Be=O(Pe,[["__scopeId","data-v-1fb7364a"]]),Ne={key:0,class:"skeleton-wrap"},Oe={key:1},Re={key:0,class:"empty-wrap"},De={key:0,class:"pagination-wrap"},Ve=B({__name:"Following",setup(q){const y=Te(),n=ne(),c=r(!1),s=r([]),b=n.query.n||"粉丝详情",v=n.query.s||"",m=r(n.query.t||"follows"),e=r(+n.query.p||1),a=r(20),d=r(0),f=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),$=l=>{w.value=l,f.value=!0},F=()=>{f.value=!1},z=l=>{e.value=l,T()},R=l=>{m.value=l,T()},T=()=>{m.value==="follows"?D(v):m.value==="followings"&&V(v)},D=(l,h=!1)=>{s.value.length===0&&(c.value=!0),ae({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})},V=(l,h=!1)=>{s.value.length===0&&(c.value=!0),le({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})};return Z(()=>{T()}),(l,h)=>{const i=ze,I=ke,H=ye,W=Fe,j=be,A=Be,G=$e,L=Y,Q=we,E=he;return _(),u(M,null,[p("div",null,[o(i,{title:g(b),back:!0},null,8,["title"]),o(Q,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(H,{type:"line",animated:"","default-value":m.value,"onUpdate:value":R},{default:t(()=>[o(I,{name:"follows",tab:"正在关注"}),o(I,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),c.value?(_(),u("div",Ne,[o(W,{num:a.value},null,8,["num"])])):(_(),u("div",Oe,[s.value.length===0?(_(),u("div",Re,[o(j,{size:"large",description:"暂无数据"})])):U("",!0),(_(!0),u(M,null,ee(s.value,S=>(_(),N(G,{key:S.user_id},{default:t(()=>[o(A,{contact:S,onSendWhisper:$},null,8,["contact"])]),_:2},1024))),128))])),o(L,{show:f.value,user:w.value,onSuccess:F},null,8,["show","user"])]),_:1})]),d.value>0?(_(),u("div",De,[o(E,{page:e.value,"onUpdate:page":z,"page-slot":g(y).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):U("",!0)],64)}}});const mo=O(Ve,[["__scopeId","data-v-0a10234f"]]);export{mo as default}; diff --git a/web/dist/assets/Home-9d65330f.js b/web/dist/assets/Home-62c9b54d.js similarity index 98% rename from web/dist/assets/Home-9d65330f.js rename to web/dist/assets/Home-62c9b54d.js index 3dbb323f..7cb38f1e 100644 --- a/web/dist/assets/Home-9d65330f.js +++ b/web/dist/assets/Home-62c9b54d.js @@ -1 +1 @@ -import{_ as Ue}from"./whisper-31e5b9ad.js";import{_ as Te,a as Ve}from"./post-item.vue_vue_type_style_index_0_lang-00295cef.js";import{_ as Ee}from"./post-skeleton-26b3006b.js";import{d as _e,H as l,c as ce,b as ge,e as c,f as y,bf as U,j as A,k as a,w as i,q as O,Y as k,y as ve,A as Y,x as ee,F as pe,u as de,E as Ne}from"./@vue-a481fc63.js";import{u as fe}from"./vuex-44de225f.js";import{l as me}from"./lodash-e0b37ac3.js";import{g as xe,a as Re,c as qe,b as Ge,d as Oe,e as Pe,_ as Fe}from"./index-cb280048.js";import{p as Le}from"./content-64ba0596.js";import{V as B,P as H}from"./IEnum-5453a777.js";import{I as Ye,V as Se,A as Me,d as Ke,E as We}from"./@vicons-7a4ef312.js";import{o as he,v as je,j as Qe,e as He,w as Ze,x as Je,y as Xe,z as $e,A as et,B as tt,C as at,a as we,D as st,E as ot,F as nt,G as lt,l as it,H as rt,I as ut,k as ct}from"./naive-ui-d8de3dda.js";import{_ as pt}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{b as dt,u as vt}from"./vue-router-e5a2430e.js";import{W as mt}from"./v3-infinite-loading-2c58ec2f.js";import{S as _t}from"./@opentiny-d73a2d67.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const gt=Z=>{const F=new FileReader,b=r=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(r),T=()=>{const r=new Uint8Array(F.result).subarray(0,4);let V="";for(let g=0;g{F.onloadend=()=>{const g=Z.type;r(g===""||g==="application/octet-stream"?T():b(g))},F.readAsArrayBuffer(Z.slice(0,4))})},ft={key:0,class:"compose-wrap"},ht={class:"compose-line"},wt={class:"compose-user"},yt={class:"compose-line compose-options"},kt={class:"attachment"},At={class:"submit-wrap"},bt={class:"attachment-list-wrap"},Ct={key:0,class:"attachment-price-wrap"},zt=A("span",null," 附件价格¥",-1),It={key:0,class:"eye-wrap"},Dt={key:1,class:"link-wrap"},Bt={key:1,class:"compose-wrap"},Ut=A("div",{class:"login-wrap"},[A("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Tt={key:0,class:"login-only-wrap"},Vt={key:1,class:"login-wrap"},Et=_e({__name:"compose",emits:["post-success"],setup(Z,{emit:F}){const b=fe(),T=l([]),r=l(!1),V=l(!1),g=l(!1),P=l(!1),f=l(""),R=l([]),E=l(),N=l(0),m=l("public/image"),I=l([]),p=l([]),h=l([]),C=l([]),D=l(B.PUBLIC),q=l(B.PUBLIC),K="true".toLowerCase()==="true",L=+"400",J=l("true".toLowerCase()==="true"),X=l("true".toLowerCase()==="true"),te=l("true".toLowerCase()==="true"),S=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),W="/v1/attachment",G=ce(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),$=ce(()=>{let e=[{value:B.PUBLIC,label:"公开"},{value:B.PRIVATE,label:"私密"},{value:B.Following,label:"关注可见"}];return K&&e.push({value:B.FRIEND,label:"好友可见"}),e}),se=()=>{g.value=!g.value,g.value&&P.value&&(P.value=!1)},j=()=>{P.value=!P.value,P.value&&g.value&&(g.value=!1)},oe=me.debounce(e=>{xe({k:e}).then(t=>{let n=[];t.suggest.map(o=>{n.push({label:o,value:o})}),T.value=n,r.value=!1}).catch(t=>{r.value=!1})},200),u=me.debounce(e=>{Re({k:e}).then(t=>{let n=[];t.suggest.map(o=>{n.push({label:o,value:o})}),T.value=n,r.value=!1}).catch(t=>{r.value=!1})},200),v=(e,t)=>{r.value||(r.value=!0,t==="@"?oe(e):u(e))},x=e=>{e.length>L?f.value=e.substring(0,L):f.value=e},w=e=>{m.value=e},z=e=>{for(let d=0;d30&&(e[d].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+o)}I.value=e},ne=async e=>{var t,n,o,d,s;return m.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((t=e.file.file)==null?void 0:t.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):m.value==="image"&&((n=e.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):m.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=e.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):m.value==="public/video"&&((d=e.file.file)==null?void 0:d.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):m.value==="attachment"&&!await gt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):m.value==="attachment"&&((s=e.file.file)==null?void 0:s.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},le=({file:e,event:t})=>{var n;try{let o=JSON.parse((n=t.target)==null?void 0:n.response);o.code===0&&(m.value==="public/image"&&p.value.push({id:e.id,content:o.data.content}),m.value==="public/video"&&h.value.push({id:e.id,content:o.data.content}),m.value==="attachment"&&C.value.push({id:e.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},ie=({file:e,event:t})=>{var n;try{let o=JSON.parse((n=t.target)==null?void 0:n.response);if(o.code!==0){let d=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(s=>{d+=":"+s}),window.$message.error(d)}}catch{window.$message.error("上传失败")}},re=({file:e})=>{let t=p.value.findIndex(n=>n.id===e.id);t>-1&&p.value.splice(t,1),t=h.value.findIndex(n=>n.id===e.id),t>-1&&h.value.splice(t,1),t=C.value.findIndex(n=>n.id===e.id),t>-1&&C.value.splice(t,1)},ue=()=>{if(f.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Le(f.value);const n=[];let o=100;n.push({content:f.value,type:H.TEXT,sort:o}),p.value.map(s=>{o++,n.push({content:s.content,type:H.IMAGEURL,sort:o})}),h.value.map(s=>{o++,n.push({content:s.content,type:H.VIDEOURL,sort:o})}),C.value.map(s=>{o++,n.push({content:s.content,type:H.ATTACHMENT,sort:o})}),R.value.length>0&&R.value.map(s=>{o++,n.push({content:s,type:H.LINKURL,sort:o})}),V.value=!0;let d=D.value;d==B.Following&&(d=B.PUBLIC),qe({contents:n,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+N.value*100,visibility:d}).then(s=>{var M;window.$message.success("发布成功"),V.value=!1,F("post-success",s),g.value=!1,P.value=!1,(M=E.value)==null||M.clear(),I.value=[],f.value="",R.value=[],p.value=[],h.value=[],C.value=[],D.value=q.value}).catch(s=>{V.value=!1})},Q=e=>{b.commit("triggerAuth",!0),b.commit("triggerAuthKey",e)};return ge(()=>{const e="friend".toLowerCase();K&&e==="friend"?q.value=B.FRIEND:e==="following"?q.value=B.Following:e==="public"?q.value=B.PUBLIC:q.value=B.PRIVATE,D.value=q.value}),(e,t)=>{const n=he,o=je,d=Qe,s=He,M=Ze,ye=Je,ke=Xe,Ae=$e,be=et,Ce=tt,ze=at,Ie=we,De=st,Be=ot;return c(),y("div",null,[U(b).state.userInfo.id>0?(c(),y("div",ft,[A("div",ht,[A("div",wt,[a(n,{round:"",size:30,src:U(b).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:r.value,value:f.value,prefix:["@","#"],options:T.value,onSearch:v,"onUpdate:value":x,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(Ce,{ref_key:"uploadRef",ref:E,abstract:"","list-type":"image",multiple:!0,max:9,action:W,headers:{Authorization:G.value},data:{type:m.value},"file-list":I.value,onBeforeUpload:ne,onFinish:le,onError:ie,onRemove:re,"onUpdate:fileList":z},{default:i(()=>[A("div",yt,[A("div",kt,[a(M,{abstract:""},{default:i(({handleClick:_})=>[a(s,{disabled:I.value.length>0&&m.value==="public/video"||I.value.length===9,onClick:()=>{w("public/image"),_()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Ye))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),X.value?(c(),O(M,{key:0,abstract:""},{default:i(({handleClick:_})=>[a(s,{disabled:I.value.length>0&&m.value!=="public/video"||I.value.length===9,onClick:()=>{w("public/video"),_()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),te.value?(c(),O(M,{key:1,abstract:""},{default:i(({handleClick:_})=>[a(s,{disabled:I.value.length>0&&m.value==="public/video"||I.value.length===9,onClick:()=>{w("attachment"),_()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Me))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),a(s,{quaternary:"",circle:"",type:"primary",onClick:ve(se,["stop"])},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Ke))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),O(s,{key:2,quaternary:"",circle:"",type:"primary",onClick:ve(j,["stop"])},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(We))]),_:1})]),_:1},8,["onClick"])):k("",!0)]),A("div",At,[a(ke,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[a(ye,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:f.value.length/U(L)*100},null,8,["percentage"])]),default:i(()=>[Y(" "+ee(f.value.length)+" / "+ee(U(L)),1)]),_:1}),a(s,{loading:V.value,onClick:ue,type:"primary",secondary:"",round:""},{default:i(()=>[Y(" 发布 ")]),_:1},8,["loading"])])]),A("div",bt,[a(Ae),C.value.length>0?(c(),y("div",Ct,[S.value?(c(),O(be,{key:0,value:N.value,"onUpdate:value":t[0]||(t[0]=_=>N.value=_),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[zt]),_:1},8,["value"])):k("",!0)])):k("",!0)])]),_:1},8,["headers","data","file-list"]),P.value?(c(),y("div",It,[a(De,{value:D.value,"onUpdate:value":t[1]||(t[1]=_=>D.value=_),name:"radiogroup"},{default:i(()=>[a(Ie,null,{default:i(()=>[(c(!0),y(pe,null,de($.value,_=>(c(),O(ze,{key:_.value,value:_.value,label:_.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):k("",!0),g.value?(c(),y("div",Dt,[a(Be,{value:R.value,"onUpdate:value":t[2]||(t[2]=_=>R.value=_),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[Y(" 创建链接 ")]),_:1},8,["value"])])):k("",!0)])):(c(),y("div",Bt,[Ut,J.value?k("",!0):(c(),y("div",Tt,[a(s,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=_=>Q("signin"))},{default:i(()=>[Y(" 登录 ")]),_:1})])),J.value?(c(),y("div",Vt,[a(s,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=_=>Q("signin"))},{default:i(()=>[Y(" 登录 ")]),_:1}),a(s,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=_=>Q("signup"))},{default:i(()=>[Y(" 注册 ")]),_:1})])):k("",!0)]))])}}});const Nt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lVcLoICKagF0AfqQvwRhugBldeF1RrbaPFt1g3QcDo5G1S+2WsNx28YmhLjN4wvYVutvM+SASjgqor6dxjcbicXcabwK1DCOJDvG/KOAdTVVLn6Oxgq/FxoIORGo1ueJ3kZwEg8qJ/PYAoMkRPsolYzTW7MN1nLywVRhoup+DMwRN5geaGIpzzb53V9XYDazvUoL3wEQ1gGg/I8VFI357wm14t1x2Rp6TD5GTarGhjCOow1pzpYzeQR7HS2S3J2JUtLxZMkQoEP0LGft7s9BbV4OxjVobVTwOmUhIjCYPGYINxWGQLfIeVYJSxW4b3l2S7J2gLqzyTnKgq3VXotBCr4v/w7ARuOJOBYl8h63cMXl8DskQHwI6rgl40tZXtNX8v6JkV5RlJ64SH/PKPDy/Wd0NIp8rrWrwZIcn0N/plp9pppV6nhTGopFv7V4CGbjiXh0X2xvArf7zAckm2Kp24xe83UAFzlT4KHvI8uh2p+sv+XfQ9S8hfNcoOMJ4za72Gvh4Lsbw7Hs75+kcahssS2ASnXwDKdeMcj+tL05zMtovCfgUfEsFfzEtZ83ST0lKkM7p9UAq9eXgpXlPdbHfDh9Cd6GaDhVOJb6Ps9m0LyTnMXnExklj7V+JdmRGDeqAAovpnNah0jFnTJXnJOLwOwoHIXeERbQsD7/0lkPD8qxOHpqWEYGex/bscMkdIfOvdxz6+irBeTruXgEZuOJ02D7v2TtAFT+Aac3V4nZbDnYfedyHBY6OUgy87/Zk7fn1mhwrThA2zcR0KgNK4v63749a9LiQVeTVanoFsf0zOenzvKnsTqBGbQFFsS4mx8qQgy7E0pnsUTqcNN+Gc13TcMsKtVhoGJO8AjjsZ1U/czrayw2t+tG207kYTdbSlDM0ongG1/UkQxWtm8UUHDKK6hsO/TghRatWP8whHDU9fYOEnOMm0mPZ/yAIOygPVC2YqxhHpTR+O5szgy+AGUL+j2TksXzL8gCD8cG4KI6oIh0A01xFPX4b2Pz5Y653PAZ1h1D1TLnz7QAasOdvZZ+OmQMd49moD79kRhT7s7S8m44HONv8YjJqeDhwR5ZmmbuY1cUM3f1VZc4VGceAqNSFKI00hG6+DQAFvQF+Gjm8BDRpj4X6qVdgpx5PPpc8r6cDEUP37dEDfEQCfBpGz2OikVtbo9XgmhIHjJSEy2yOe3J3vX+h0nk7C0iIEW0o1uviAAM88L9NKPTuPn7D2dgs1YyDuztJpXGzqN91wyTAGHYNNPxas417RrwQfMMNF3PsIC6u46WoHixxIcJXsF5YvFY0IZ4h0F91kjAvDEpWF4FrNsyrbToRb4chZdyi6CocBsrovUJPABZoMpFEzf/qoLrECu5tFLwnBnlWYaW9KhRO+FmrCpwkou8L2jzsUDKdhEzhkfDj6AFE5yGen8CQtg+8n8/fHdWPAzz7OWP5ALfHpK2DQ+UO/IqVaA9aOcYzSoAB9AbuP2cZn+nn78yn91wobWvlvCtDIFFl5UWDwjI9xVnTnpj8ahdzvUNdVBjuWYkfnCBRHkhr5tUnvJCK83dcGD/4gZmlG2GnlrkTMjrjs/YNoKax0yANa58/HXstHgEOQ69p/WLb0nkiMDq4/q8MyX5ls80NsoF6BbMZgZl6bBOAFKEZXq/3cdsZ3fo8t4q8laAC0GKrjNx53pu7c6NzFgNHdKgl7f4nw26RZWs/K8kaA6psDFnOxAu0zEQd2a08oOcIAyN1RFl1hS6ZBSwCClnt1pCsaBzVSGeUYApoyTuorFshV1/kIa2Dzs5ZwrN+fzL6bg96Ws2SGOYBBmzQyk7QagwY50A1BLvm9SSVEjUSQXbzIJtgsvDGIypxhjAfUx86B5Cn35/ZNLwDdIdgSDsDgODjDdRNshaaHYbuK6FvOeFfUmSHRbNb0UlmNCZWZkkqtplMwvYMU/hN+bNYMDkLRgJnK93hiHE4nCunWky9TlkVcsGh2Ehy42b2mkLfmof9DGhRSnwAHox1NBpENdul/s67BshM/bkrCmKZ739eS3bzGRJagV7m73xwaKKPS2c4Wr9eAQ5JezqYw/39sBe0/1XRAkR7+JBf/8l9Yn65K2ZCYt+MUNMY4uCCC+DRyCWgHN5wyYZBskcj2GLYHGcUmyOJU8uxqh+0ZGIgHux3tisL61MEWS5GgakEmn1ictAEcdPlHHaVpTo4Nz8GlE6d4JGg5umLsPCozdY7mUO5CxyE3ZNTWdAvPraZJIGxqb5gqNDHk6405Wa1oLR0EIo5r8KzgIzbshI/TV/aSCp4FxO9cFkAs0a4Fmk4BdRcoPaV6Q8dUEyE/BYW7GeLDiUppkW1yGfHYilbXEyCwrL2So01YYq6U/hgGYgM3gApQbvDKjFBZh78TqfFsKpg9iEkXjuFa1GV/KUpwbZW5kS00RdUtVp0i5MTmXpIDl4zVj0Jzk489xgOVQTAezXinV3CuwxtNADeUVhWTQNAMifbYFUeHtjGsZDIHR+TEKfA76osMd+ga8eyu4BBXAkjEh40Y1lOaHdk9RpN4LzeGxI0juP5OZuFFMMOueuoaEtWPY2c3De2o8Y/wDKYVrBjgXqtmVJQrewHY+Mln0MTni3cxoAyZ7NnbqqQZRDdY6JU17BSV6ZhOvrqzwcM0Bg2QsqrzX/bDHADWMJRiDtTBAIKnDLPcg90PdYs8QsPrcHXh7OUKeSv0KBgBU+KQ3mW1tQNPQXV0LkIYI8DXnPu5lgKphoX2oju6CfgoFc5pU+8Ae8xX2FNhpDYBXoNiya2LaGQVq5kViJTqq30I/4wvUd+79Ipp1bUC3LhXxcKhUKvBC+nMZfbHqEoX2hWuAfgbV+FwLM36EuccMDxd4Swl1E0NqxnkEGQZAfUJIKX8CAwQKulTz51/o7RR8qcoVZs+bZiMTIuq7/TkWdENC3HNTI5a1I7vBSr3drPYTWdukiCfvYZpaCz7EWDRxNPvrNBS6GEfjSAD0x9YG7Imsr0AOGmL6a349BYMG5zfgQA1NACPNaAzW9smliiH4FaobOQFN7p4QVh7O9nrOr2kcRVIi9rEBeCCDO7C9sSi7OtfRJ33Wk8ZOORc1Is/3juuPcMav7+vIkz4lQdr3Eg3wBAxhCcng8XzOm8lLkx0fVp/Df7kDhsgPKXe8pfHn87k071BFG1LLkNzDQFbBENmRsL89wWddnuf5MkPb19tLPKWnvjl5WGh/vm+wNCxk/GPG5w+0cQObSNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",xt="/assets/discover-tweets-ba464531.jpeg",Rt="/assets/following-tweets-fab6741a.jpeg",qt={class:"slide-bar-item"},Gt={class:"slide-bar-item-title slide-bar-user-link"},Ot={key:1,class:"skeleton-wrap"},Pt={key:0,class:"empty-wrap"},Ft={key:1},Lt={key:2},Yt={class:"load-more-wrap"},St={class:"load-more-spinner"},Mt=_e({__name:"Home",setup(Z){const F="true".toLowerCase()==="true",b="true".toLowerCase()==="true",T=fe(),r=dt(),V=vt(),g=l(9),P=l(8),f=l([{title:"最新动态",style:1,username:"",avatar:Nt,show:!0},{title:"热门推荐",style:2,username:"",avatar:xt,show:!1},{title:"正在关注",style:3,username:"",avatar:Rt,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),R=l("泡泡广场"),E=l(!1),N=l(!1),m=l(1),I=l(""),p=l([]),h=l(1),C=l(20),D=l(0),q=l(!1),K=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),L=u=>{K.value=u,q.value=!0},J=()=>{q.value=!1},X=()=>{R.value="泡泡广场",r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?R.value="#"+decodeURIComponent(r.query.q):R.value="搜索: "+decodeURIComponent(r.query.q))},te=ce(()=>F&&b&&T.state.desktopModelShow&&T.state.userInfo.id>0),S=()=>{E.value=!1,N.value=!1,p.value=[],h.value=1,D.value=0},ae=(u,v)=>{switch(S(),m.value=u.style,r.query.q&&(r.query.q=null,X()),u.style){case 1:G();break;case 2:G();break;case 3:r.query.q=null,G();break;case 21:I.value=u.username,$();break}f.value[v].show=!1},W=()=>{f.value=f.value.slice(0,3),!(!F||!b||T.state.userInfo.id===0)&&Ge({page:1,page_size:50}).then(u=>{var v=0;const x=u.list||[];let w=[];for(;v0&&(f.value=f.value.concat(w))}).catch(u=>{console.log(u)})},G=()=>{E.value=!0,Oe({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:h.value,page_size:C.value}).then(u=>{E.value=!1,u.list.length===0&&(N.value=!0),h.value>1?p.value=p.value.concat(u.list):(p.value=u.list,window.scrollTo(0,0)),D.value=Math.ceil(u.pager.total_rows/C.value)}).catch(u=>{E.value=!1,h.value>1&&h.value--})},$=()=>{E.value=!0,Pe({username:I.value,style:"post",page:h.value,page_size:C.value}).then(u=>{E.value=!1,u.list.length===0&&(N.value=!0),h.value>1?p.value=p.value.concat(u.list):(p.value=u.list||[],window.scrollTo(0,0)),D.value=Math.ceil(u.pager.total_rows/C.value)}).catch(u=>{p.value=[],h.value>1&&h.value--,E.value=!1})},se=u=>{if(m.value!=1){V.push({name:"post",query:{id:u.id}});return}let v=[],x=p.value.length;x==C.value&&x--;for(var w=0;w{switch(m.value){case 1:G();break;case 2:G();break;case 3:G();break;case 21:r.query.q?G():$();break}},oe=()=>{h.value{S(),W(),G()}),Ne(()=>({path:r.path,query:r.query,refresh:T.state.refresh}),(u,v)=>{if(X(),u.refresh!==v.refresh){S(),setTimeout(()=>{W(),j()},0);return}v.path!=="/post"&&u.path==="/"&&(S(),setTimeout(()=>{W(),j()},0))}),(u,v)=>{const x=pt,w=Et,z=lt,ne=he,le=it,ie=rt,re=Ee,ue=ut,Q=Te,e=Ve,t=Ue,n=nt,o=ct,d=we;return c(),y("div",null,[a(x,{title:R.value},null,8,["title"]),a(n,{class:"main-content-wrap",bordered:""},{default:i(()=>[a(z,null,{default:i(()=>[a(w,{onPostSuccess:se})]),_:1}),te.value?(c(),O(z,{key:0},{default:i(()=>[a(U(_t),{modelValue:f.value,"onUpdate:modelValue":v[0]||(v[0]=s=>f.value=s),"wheel-blocks":P.value,"init-blocks":g.value,onClick:ae,tag:"div","sub-tag":"div"},{default:i(s=>[A("div",qt,[a(le,{value:"1",offset:[-4,48],dot:"",show:s.slotData.show},{default:i(()=>[a(ne,{round:"",size:48,src:s.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),A("div",Gt,[a(ie,{"line-clamp":2},{default:i(()=>[Y(ee(s.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):k("",!0),E.value&&p.value.length===0?(c(),y("div",Ot,[a(re,{num:C.value},null,8,["num"])])):k("",!0),A("div",null,[p.value.length===0?(c(),y("div",Pt,[a(ue,{size:"large",description:"暂无数据"})])):k("",!0),U(T).state.desktopModelShow?(c(),y("div",Ft,[(c(!0),y(pe,null,de(p.value,s=>(c(),O(z,{key:s.id},{default:i(()=>[a(Q,{post:s,onSendWhisper:L},null,8,["post"])]),_:2},1024))),128))])):(c(),y("div",Lt,[(c(!0),y(pe,null,de(p.value,s=>(c(),O(z,{key:s.id},{default:i(()=>[a(e,{post:s,onSendWhisper:L},null,8,["post"])]),_:2},1024))),128))]))]),a(t,{show:q.value,user:K.value,onSuccess:J},null,8,["show","user"])]),_:1}),D.value>0?(c(),O(d,{key:0,justify:"center"},{default:i(()=>[a(U(mt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:v[1]||(v[1]=s=>oe())},{spinner:i(()=>[A("div",Yt,[N.value?k("",!0):(c(),O(o,{key:0,size:14})),A("span",St,ee(N.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Ta=Fe(Mt,[["__scopeId","data-v-899c075b"]]);export{Ta as default}; +import{_ as Ue}from"./whisper-f9793dd1.js";import{_ as Te,a as Ve}from"./post-item.vue_vue_type_style_index_0_lang-899852f8.js";import{_ as Ee}from"./post-skeleton-54a835d7.js";import{d as _e,H as l,c as ce,b as ge,e as c,f as y,bf as U,j as A,k as a,w as i,q as O,Y as k,y as ve,A as Y,x as ee,F as pe,u as de,E as Ne}from"./@vue-a481fc63.js";import{u as fe}from"./vuex-44de225f.js";import{l as me}from"./lodash-e0b37ac3.js";import{g as xe,a as Re,c as qe,b as Ge,d as Oe,e as Pe,_ as Fe}from"./index-8d220080.js";import{p as Le}from"./content-e3389a3a.js";import{V as B,P as H}from"./IEnum-5453a777.js";import{I as Ye,V as Se,A as Me,d as Ke,E as We}from"./@vicons-7a4ef312.js";import{o as he,v as je,j as Qe,e as He,w as Ze,x as Je,y as Xe,z as $e,A as et,B as tt,C as at,a as we,D as st,E as ot,F as nt,G as lt,l as it,H as rt,I as ut,k as ct}from"./naive-ui-d8de3dda.js";import{_ as pt}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{b as dt,u as vt}from"./vue-router-e5a2430e.js";import{W as mt}from"./v3-infinite-loading-2c58ec2f.js";import{S as _t}from"./@opentiny-d73a2d67.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const gt=Z=>{const F=new FileReader,b=r=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(r),T=()=>{const r=new Uint8Array(F.result).subarray(0,4);let V="";for(let g=0;g{F.onloadend=()=>{const g=Z.type;r(g===""||g==="application/octet-stream"?T():b(g))},F.readAsArrayBuffer(Z.slice(0,4))})},ft={key:0,class:"compose-wrap"},ht={class:"compose-line"},wt={class:"compose-user"},yt={class:"compose-line compose-options"},kt={class:"attachment"},At={class:"submit-wrap"},bt={class:"attachment-list-wrap"},Ct={key:0,class:"attachment-price-wrap"},zt=A("span",null," 附件价格¥",-1),It={key:0,class:"eye-wrap"},Dt={key:1,class:"link-wrap"},Bt={key:1,class:"compose-wrap"},Ut=A("div",{class:"login-wrap"},[A("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Tt={key:0,class:"login-only-wrap"},Vt={key:1,class:"login-wrap"},Et=_e({__name:"compose",emits:["post-success"],setup(Z,{emit:F}){const b=fe(),T=l([]),r=l(!1),V=l(!1),g=l(!1),P=l(!1),f=l(""),R=l([]),E=l(),N=l(0),m=l("public/image"),I=l([]),p=l([]),h=l([]),C=l([]),D=l(B.PUBLIC),q=l(B.PUBLIC),K="true".toLowerCase()==="true",L=+"400",J=l("true".toLowerCase()==="true"),X=l("true".toLowerCase()==="true"),te=l("true".toLowerCase()==="true"),S=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),W="/v1/attachment",G=ce(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),$=ce(()=>{let e=[{value:B.PUBLIC,label:"公开"},{value:B.PRIVATE,label:"私密"},{value:B.Following,label:"关注可见"}];return K&&e.push({value:B.FRIEND,label:"好友可见"}),e}),se=()=>{g.value=!g.value,g.value&&P.value&&(P.value=!1)},j=()=>{P.value=!P.value,P.value&&g.value&&(g.value=!1)},oe=me.debounce(e=>{xe({k:e}).then(t=>{let n=[];t.suggest.map(o=>{n.push({label:o,value:o})}),T.value=n,r.value=!1}).catch(t=>{r.value=!1})},200),u=me.debounce(e=>{Re({k:e}).then(t=>{let n=[];t.suggest.map(o=>{n.push({label:o,value:o})}),T.value=n,r.value=!1}).catch(t=>{r.value=!1})},200),v=(e,t)=>{r.value||(r.value=!0,t==="@"?oe(e):u(e))},x=e=>{e.length>L?f.value=e.substring(0,L):f.value=e},w=e=>{m.value=e},z=e=>{for(let d=0;d30&&(e[d].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+o)}I.value=e},ne=async e=>{var t,n,o,d,s;return m.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((t=e.file.file)==null?void 0:t.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):m.value==="image"&&((n=e.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):m.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=e.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):m.value==="public/video"&&((d=e.file.file)==null?void 0:d.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):m.value==="attachment"&&!await gt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):m.value==="attachment"&&((s=e.file.file)==null?void 0:s.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},le=({file:e,event:t})=>{var n;try{let o=JSON.parse((n=t.target)==null?void 0:n.response);o.code===0&&(m.value==="public/image"&&p.value.push({id:e.id,content:o.data.content}),m.value==="public/video"&&h.value.push({id:e.id,content:o.data.content}),m.value==="attachment"&&C.value.push({id:e.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},ie=({file:e,event:t})=>{var n;try{let o=JSON.parse((n=t.target)==null?void 0:n.response);if(o.code!==0){let d=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(s=>{d+=":"+s}),window.$message.error(d)}}catch{window.$message.error("上传失败")}},re=({file:e})=>{let t=p.value.findIndex(n=>n.id===e.id);t>-1&&p.value.splice(t,1),t=h.value.findIndex(n=>n.id===e.id),t>-1&&h.value.splice(t,1),t=C.value.findIndex(n=>n.id===e.id),t>-1&&C.value.splice(t,1)},ue=()=>{if(f.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Le(f.value);const n=[];let o=100;n.push({content:f.value,type:H.TEXT,sort:o}),p.value.map(s=>{o++,n.push({content:s.content,type:H.IMAGEURL,sort:o})}),h.value.map(s=>{o++,n.push({content:s.content,type:H.VIDEOURL,sort:o})}),C.value.map(s=>{o++,n.push({content:s.content,type:H.ATTACHMENT,sort:o})}),R.value.length>0&&R.value.map(s=>{o++,n.push({content:s,type:H.LINKURL,sort:o})}),V.value=!0;let d=D.value;d==B.Following&&(d=B.PUBLIC),qe({contents:n,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+N.value*100,visibility:d}).then(s=>{var M;window.$message.success("发布成功"),V.value=!1,F("post-success",s),g.value=!1,P.value=!1,(M=E.value)==null||M.clear(),I.value=[],f.value="",R.value=[],p.value=[],h.value=[],C.value=[],D.value=q.value}).catch(s=>{V.value=!1})},Q=e=>{b.commit("triggerAuth",!0),b.commit("triggerAuthKey",e)};return ge(()=>{const e="friend".toLowerCase();K&&e==="friend"?q.value=B.FRIEND:e==="following"?q.value=B.Following:e==="public"?q.value=B.PUBLIC:q.value=B.PRIVATE,D.value=q.value}),(e,t)=>{const n=he,o=je,d=Qe,s=He,M=Ze,ye=Je,ke=Xe,Ae=$e,be=et,Ce=tt,ze=at,Ie=we,De=st,Be=ot;return c(),y("div",null,[U(b).state.userInfo.id>0?(c(),y("div",ft,[A("div",ht,[A("div",wt,[a(n,{round:"",size:30,src:U(b).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:r.value,value:f.value,prefix:["@","#"],options:T.value,onSearch:v,"onUpdate:value":x,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(Ce,{ref_key:"uploadRef",ref:E,abstract:"","list-type":"image",multiple:!0,max:9,action:W,headers:{Authorization:G.value},data:{type:m.value},"file-list":I.value,onBeforeUpload:ne,onFinish:le,onError:ie,onRemove:re,"onUpdate:fileList":z},{default:i(()=>[A("div",yt,[A("div",kt,[a(M,{abstract:""},{default:i(({handleClick:_})=>[a(s,{disabled:I.value.length>0&&m.value==="public/video"||I.value.length===9,onClick:()=>{w("public/image"),_()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Ye))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),X.value?(c(),O(M,{key:0,abstract:""},{default:i(({handleClick:_})=>[a(s,{disabled:I.value.length>0&&m.value!=="public/video"||I.value.length===9,onClick:()=>{w("public/video"),_()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),te.value?(c(),O(M,{key:1,abstract:""},{default:i(({handleClick:_})=>[a(s,{disabled:I.value.length>0&&m.value==="public/video"||I.value.length===9,onClick:()=>{w("attachment"),_()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Me))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),a(s,{quaternary:"",circle:"",type:"primary",onClick:ve(se,["stop"])},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Ke))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),O(s,{key:2,quaternary:"",circle:"",type:"primary",onClick:ve(j,["stop"])},{icon:i(()=>[a(d,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(We))]),_:1})]),_:1},8,["onClick"])):k("",!0)]),A("div",At,[a(ke,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[a(ye,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:f.value.length/U(L)*100},null,8,["percentage"])]),default:i(()=>[Y(" "+ee(f.value.length)+" / "+ee(U(L)),1)]),_:1}),a(s,{loading:V.value,onClick:ue,type:"primary",secondary:"",round:""},{default:i(()=>[Y(" 发布 ")]),_:1},8,["loading"])])]),A("div",bt,[a(Ae),C.value.length>0?(c(),y("div",Ct,[S.value?(c(),O(be,{key:0,value:N.value,"onUpdate:value":t[0]||(t[0]=_=>N.value=_),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[zt]),_:1},8,["value"])):k("",!0)])):k("",!0)])]),_:1},8,["headers","data","file-list"]),P.value?(c(),y("div",It,[a(De,{value:D.value,"onUpdate:value":t[1]||(t[1]=_=>D.value=_),name:"radiogroup"},{default:i(()=>[a(Ie,null,{default:i(()=>[(c(!0),y(pe,null,de($.value,_=>(c(),O(ze,{key:_.value,value:_.value,label:_.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):k("",!0),g.value?(c(),y("div",Dt,[a(Be,{value:R.value,"onUpdate:value":t[2]||(t[2]=_=>R.value=_),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[Y(" 创建链接 ")]),_:1},8,["value"])])):k("",!0)])):(c(),y("div",Bt,[Ut,J.value?k("",!0):(c(),y("div",Tt,[a(s,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=_=>Q("signin"))},{default:i(()=>[Y(" 登录 ")]),_:1})])),J.value?(c(),y("div",Vt,[a(s,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=_=>Q("signin"))},{default:i(()=>[Y(" 登录 ")]),_:1}),a(s,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=_=>Q("signup"))},{default:i(()=>[Y(" 注册 ")]),_:1})])):k("",!0)]))])}}});const Nt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lVcLoICKagF0AfqQvwRhugBldeF1RrbaPFt1g3QcDo5G1S+2WsNx28YmhLjN4wvYVutvM+SASjgqor6dxjcbicXcabwK1DCOJDvG/KOAdTVVLn6Oxgq/FxoIORGo1ueJ3kZwEg8qJ/PYAoMkRPsolYzTW7MN1nLywVRhoup+DMwRN5geaGIpzzb53V9XYDazvUoL3wEQ1gGg/I8VFI357wm14t1x2Rp6TD5GTarGhjCOow1pzpYzeQR7HS2S3J2JUtLxZMkQoEP0LGft7s9BbV4OxjVobVTwOmUhIjCYPGYINxWGQLfIeVYJSxW4b3l2S7J2gLqzyTnKgq3VXotBCr4v/w7ARuOJOBYl8h63cMXl8DskQHwI6rgl40tZXtNX8v6JkV5RlJ64SH/PKPDy/Wd0NIp8rrWrwZIcn0N/plp9pppV6nhTGopFv7V4CGbjiXh0X2xvArf7zAckm2Kp24xe83UAFzlT4KHvI8uh2p+sv+XfQ9S8hfNcoOMJ4za72Gvh4Lsbw7Hs75+kcahssS2ASnXwDKdeMcj+tL05zMtovCfgUfEsFfzEtZ83ST0lKkM7p9UAq9eXgpXlPdbHfDh9Cd6GaDhVOJb6Ps9m0LyTnMXnExklj7V+JdmRGDeqAAovpnNah0jFnTJXnJOLwOwoHIXeERbQsD7/0lkPD8qxOHpqWEYGex/bscMkdIfOvdxz6+irBeTruXgEZuOJ02D7v2TtAFT+Aac3V4nZbDnYfedyHBY6OUgy87/Zk7fn1mhwrThA2zcR0KgNK4v63749a9LiQVeTVanoFsf0zOenzvKnsTqBGbQFFsS4mx8qQgy7E0pnsUTqcNN+Gc13TcMsKtVhoGJO8AjjsZ1U/czrayw2t+tG207kYTdbSlDM0ongG1/UkQxWtm8UUHDKK6hsO/TghRatWP8whHDU9fYOEnOMm0mPZ/yAIOygPVC2YqxhHpTR+O5szgy+AGUL+j2TksXzL8gCD8cG4KI6oIh0A01xFPX4b2Pz5Y653PAZ1h1D1TLnz7QAasOdvZZ+OmQMd49moD79kRhT7s7S8m44HONv8YjJqeDhwR5ZmmbuY1cUM3f1VZc4VGceAqNSFKI00hG6+DQAFvQF+Gjm8BDRpj4X6qVdgpx5PPpc8r6cDEUP37dEDfEQCfBpGz2OikVtbo9XgmhIHjJSEy2yOe3J3vX+h0nk7C0iIEW0o1uviAAM88L9NKPTuPn7D2dgs1YyDuztJpXGzqN91wyTAGHYNNPxas417RrwQfMMNF3PsIC6u46WoHixxIcJXsF5YvFY0IZ4h0F91kjAvDEpWF4FrNsyrbToRb4chZdyi6CocBsrovUJPABZoMpFEzf/qoLrECu5tFLwnBnlWYaW9KhRO+FmrCpwkou8L2jzsUDKdhEzhkfDj6AFE5yGen8CQtg+8n8/fHdWPAzz7OWP5ALfHpK2DQ+UO/IqVaA9aOcYzSoAB9AbuP2cZn+nn78yn91wobWvlvCtDIFFl5UWDwjI9xVnTnpj8ahdzvUNdVBjuWYkfnCBRHkhr5tUnvJCK83dcGD/4gZmlG2GnlrkTMjrjs/YNoKax0yANa58/HXstHgEOQ69p/WLb0nkiMDq4/q8MyX5ls80NsoF6BbMZgZl6bBOAFKEZXq/3cdsZ3fo8t4q8laAC0GKrjNx53pu7c6NzFgNHdKgl7f4nw26RZWs/K8kaA6psDFnOxAu0zEQd2a08oOcIAyN1RFl1hS6ZBSwCClnt1pCsaBzVSGeUYApoyTuorFshV1/kIa2Dzs5ZwrN+fzL6bg96Ws2SGOYBBmzQyk7QagwY50A1BLvm9SSVEjUSQXbzIJtgsvDGIypxhjAfUx86B5Cn35/ZNLwDdIdgSDsDgODjDdRNshaaHYbuK6FvOeFfUmSHRbNb0UlmNCZWZkkqtplMwvYMU/hN+bNYMDkLRgJnK93hiHE4nCunWky9TlkVcsGh2Ehy42b2mkLfmof9DGhRSnwAHox1NBpENdul/s67BshM/bkrCmKZ739eS3bzGRJagV7m73xwaKKPS2c4Wr9eAQ5JezqYw/39sBe0/1XRAkR7+JBf/8l9Yn65K2ZCYt+MUNMY4uCCC+DRyCWgHN5wyYZBskcj2GLYHGcUmyOJU8uxqh+0ZGIgHux3tisL61MEWS5GgakEmn1ictAEcdPlHHaVpTo4Nz8GlE6d4JGg5umLsPCozdY7mUO5CxyE3ZNTWdAvPraZJIGxqb5gqNDHk6405Wa1oLR0EIo5r8KzgIzbshI/TV/aSCp4FxO9cFkAs0a4Fmk4BdRcoPaV6Q8dUEyE/BYW7GeLDiUppkW1yGfHYilbXEyCwrL2So01YYq6U/hgGYgM3gApQbvDKjFBZh78TqfFsKpg9iEkXjuFa1GV/KUpwbZW5kS00RdUtVp0i5MTmXpIDl4zVj0Jzk489xgOVQTAezXinV3CuwxtNADeUVhWTQNAMifbYFUeHtjGsZDIHR+TEKfA76osMd+ga8eyu4BBXAkjEh40Y1lOaHdk9RpN4LzeGxI0juP5OZuFFMMOueuoaEtWPY2c3De2o8Y/wDKYVrBjgXqtmVJQrewHY+Mln0MTni3cxoAyZ7NnbqqQZRDdY6JU17BSV6ZhOvrqzwcM0Bg2QsqrzX/bDHADWMJRiDtTBAIKnDLPcg90PdYs8QsPrcHXh7OUKeSv0KBgBU+KQ3mW1tQNPQXV0LkIYI8DXnPu5lgKphoX2oju6CfgoFc5pU+8Ae8xX2FNhpDYBXoNiya2LaGQVq5kViJTqq30I/4wvUd+79Ipp1bUC3LhXxcKhUKvBC+nMZfbHqEoX2hWuAfgbV+FwLM36EuccMDxd4Swl1E0NqxnkEGQZAfUJIKX8CAwQKulTz51/o7RR8qcoVZs+bZiMTIuq7/TkWdENC3HNTI5a1I7vBSr3drPYTWdukiCfvYZpaCz7EWDRxNPvrNBS6GEfjSAD0x9YG7Imsr0AOGmL6a349BYMG5zfgQA1NACPNaAzW9smliiH4FaobOQFN7p4QVh7O9nrOr2kcRVIi9rEBeCCDO7C9sSi7OtfRJ33Wk8ZOORc1Is/3juuPcMav7+vIkz4lQdr3Eg3wBAxhCcng8XzOm8lLkx0fVp/Df7kDhsgPKXe8pfHn87k071BFG1LLkNzDQFbBENmRsL89wWddnuf5MkPb19tLPKWnvjl5WGh/vm+wNCxk/GPG5w+0cQObSNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",xt="/assets/discover-tweets-ba464531.jpeg",Rt="/assets/following-tweets-fab6741a.jpeg",qt={class:"slide-bar-item"},Gt={class:"slide-bar-item-title slide-bar-user-link"},Ot={key:1,class:"skeleton-wrap"},Pt={key:0,class:"empty-wrap"},Ft={key:1},Lt={key:2},Yt={class:"load-more-wrap"},St={class:"load-more-spinner"},Mt=_e({__name:"Home",setup(Z){const F="true".toLowerCase()==="true",b="true".toLowerCase()==="true",T=fe(),r=dt(),V=vt(),g=l(9),P=l(8),f=l([{title:"最新动态",style:1,username:"",avatar:Nt,show:!0},{title:"热门推荐",style:2,username:"",avatar:xt,show:!1},{title:"正在关注",style:3,username:"",avatar:Rt,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),R=l("泡泡广场"),E=l(!1),N=l(!1),m=l(1),I=l(""),p=l([]),h=l(1),C=l(20),D=l(0),q=l(!1),K=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),L=u=>{K.value=u,q.value=!0},J=()=>{q.value=!1},X=()=>{R.value="泡泡广场",r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?R.value="#"+decodeURIComponent(r.query.q):R.value="搜索: "+decodeURIComponent(r.query.q))},te=ce(()=>F&&b&&T.state.desktopModelShow&&T.state.userInfo.id>0),S=()=>{E.value=!1,N.value=!1,p.value=[],h.value=1,D.value=0},ae=(u,v)=>{switch(S(),m.value=u.style,r.query.q&&(r.query.q=null,X()),u.style){case 1:G();break;case 2:G();break;case 3:r.query.q=null,G();break;case 21:I.value=u.username,$();break}f.value[v].show=!1},W=()=>{f.value=f.value.slice(0,3),!(!F||!b||T.state.userInfo.id===0)&&Ge({page:1,page_size:50}).then(u=>{var v=0;const x=u.list||[];let w=[];for(;v0&&(f.value=f.value.concat(w))}).catch(u=>{console.log(u)})},G=()=>{E.value=!0,Oe({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:h.value,page_size:C.value}).then(u=>{E.value=!1,u.list.length===0&&(N.value=!0),h.value>1?p.value=p.value.concat(u.list):(p.value=u.list,window.scrollTo(0,0)),D.value=Math.ceil(u.pager.total_rows/C.value)}).catch(u=>{E.value=!1,h.value>1&&h.value--})},$=()=>{E.value=!0,Pe({username:I.value,style:"post",page:h.value,page_size:C.value}).then(u=>{E.value=!1,u.list.length===0&&(N.value=!0),h.value>1?p.value=p.value.concat(u.list):(p.value=u.list||[],window.scrollTo(0,0)),D.value=Math.ceil(u.pager.total_rows/C.value)}).catch(u=>{p.value=[],h.value>1&&h.value--,E.value=!1})},se=u=>{if(m.value!=1){V.push({name:"post",query:{id:u.id}});return}let v=[],x=p.value.length;x==C.value&&x--;for(var w=0;w{switch(m.value){case 1:G();break;case 2:G();break;case 3:G();break;case 21:r.query.q?G():$();break}},oe=()=>{h.value{S(),W(),G()}),Ne(()=>({path:r.path,query:r.query,refresh:T.state.refresh}),(u,v)=>{if(X(),u.refresh!==v.refresh){S(),setTimeout(()=>{W(),j()},0);return}v.path!=="/post"&&u.path==="/"&&(S(),setTimeout(()=>{W(),j()},0))}),(u,v)=>{const x=pt,w=Et,z=lt,ne=he,le=it,ie=rt,re=Ee,ue=ut,Q=Te,e=Ve,t=Ue,n=nt,o=ct,d=we;return c(),y("div",null,[a(x,{title:R.value},null,8,["title"]),a(n,{class:"main-content-wrap",bordered:""},{default:i(()=>[a(z,null,{default:i(()=>[a(w,{onPostSuccess:se})]),_:1}),te.value?(c(),O(z,{key:0},{default:i(()=>[a(U(_t),{modelValue:f.value,"onUpdate:modelValue":v[0]||(v[0]=s=>f.value=s),"wheel-blocks":P.value,"init-blocks":g.value,onClick:ae,tag:"div","sub-tag":"div"},{default:i(s=>[A("div",qt,[a(le,{value:"1",offset:[-4,48],dot:"",show:s.slotData.show},{default:i(()=>[a(ne,{round:"",size:48,src:s.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),A("div",Gt,[a(ie,{"line-clamp":2},{default:i(()=>[Y(ee(s.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):k("",!0),E.value&&p.value.length===0?(c(),y("div",Ot,[a(re,{num:C.value},null,8,["num"])])):k("",!0),A("div",null,[p.value.length===0?(c(),y("div",Pt,[a(ue,{size:"large",description:"暂无数据"})])):k("",!0),U(T).state.desktopModelShow?(c(),y("div",Ft,[(c(!0),y(pe,null,de(p.value,s=>(c(),O(z,{key:s.id},{default:i(()=>[a(Q,{post:s,onSendWhisper:L},null,8,["post"])]),_:2},1024))),128))])):(c(),y("div",Lt,[(c(!0),y(pe,null,de(p.value,s=>(c(),O(z,{key:s.id},{default:i(()=>[a(e,{post:s,onSendWhisper:L},null,8,["post"])]),_:2},1024))),128))]))]),a(t,{show:q.value,user:K.value,onSuccess:J},null,8,["show","user"])]),_:1}),D.value>0?(c(),O(d,{key:0,justify:"center"},{default:i(()=>[a(U(mt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:v[1]||(v[1]=s=>oe())},{spinner:i(()=>[A("div",Yt,[N.value?k("",!0):(c(),O(o,{key:0,size:14})),A("span",St,ee(N.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Ta=Fe(Mt,[["__scopeId","data-v-899c075b"]]);export{Ta as default}; diff --git a/web/dist/assets/Messages-a82c4399.js b/web/dist/assets/Messages-e4d02674.js similarity index 96% rename from web/dist/assets/Messages-a82c4399.js rename to web/dist/assets/Messages-e4d02674.js index 02fcbdcc..774a5d14 100644 --- a/web/dist/assets/Messages-a82c4399.js +++ b/web/dist/assets/Messages-e4d02674.js @@ -1 +1 @@ -import{d as D,c as q,r as E,e as t,f as r,k as s,w as a,bf as o,j as f,y as C,A as _,x as m,q as I,Y as i,l as G,h as H,u as Q,F as T,H as v,b as Y}from"./@vue-a481fc63.js";import{u as U}from"./vuex-44de225f.js";import{u as X,b as Z}from"./vue-router-e5a2430e.js";import{J as x,K as ee,L as se,_ as L,M as ne}from"./index-cb280048.js";import{a as te}from"./formatTime-4210fcd1.js";import{J,i as ae,K as oe,N as re,O as K,Q as ie,p as le}from"./@vicons-7a4ef312.js";import{j as d,o as ue,M as _e,l as pe,e as ce,O as de,S as me,L as ge,U as ve,F as fe,Q as ye,I as ke,G as he}from"./naive-ui-d8de3dda.js";import{_ as we}from"./whisper-31e5b9ad.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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-2ab8298d.js";const be={class:"sender-wrap"},Ce={key:0,class:"nickname"},Ie={class:"username"},Me={key:1,class:"nickname"},Se={class:"username"},ze={key:2,class:"nickname"},Fe={class:"timestamp"},Oe={class:"timestamp-txt"},qe={key:0,class:"brief-content"},Ne={key:1,class:"whisper-content-wrap"},Re={key:2,class:"requesting-friend-wrap"},Ae={key:2,class:"status-info"},We={key:3,class:"status-info"},je="https://assets.paopao.info/public/avatar/default/admin.png",Be=D({__name:"message-item",props:{message:{}},emits:["send-whisper"],setup(N,{emit:y}){const p=N,c=X(),l=U(),k=e=>()=>H(d,null,{default:()=>H(e)}),h=q(()=>[{label:"私信",key:"whisper",icon:k(le)}]),w=e=>{switch(e){case"whisper":const n=p.message;if(n.type!=99){let $=n.type==4&&n.sender_user_id==l.state.userInfo.id?n.receiver_user:n.sender_user;y("send-whisper",$)}break}},g=q(()=>p.message.type!==4||p.message.sender_user_id!==l.state.userInfo.id),M=q(()=>p.message.type==4&&p.message.receiver_user_id==l.state.userInfo.id),S=q(()=>p.message.type==4&&p.message.sender_user_id==l.state.userInfo.id),R=e=>{u(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?c.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},z=e=>{u(e),x({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},A=e=>{u(e),ee({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},u=e=>{p.message.receiver_user_id==l.state.userInfo.id&&e.is_read===0&&se({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const $=ue,F=E("router-link"),b=_e,W=pe,j=ce,B=de,P=me,O=ge;return t(),r("div",{class:G(["message-item",{unread:g.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=V=>u(e.message))},[s(O,{"content-indented":""},{avatar:a(()=>[s($,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(l).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:je},null,8,["src"])]),header:a(()=>[f("div",be,[e.message.type!=4&&e.message.sender_user.id>0||M.value?(t(),r("span",Ce,[s(F,{onClick:n[0]||(n[0]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:a(()=>[_(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),f("span",Ie," @"+m(e.message.sender_user.username),1)])):S.value?(t(),r("span",Me,[s(F,{onClick:n[1]||(n[1]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:a(()=>[_(m(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),f("span",Se," @"+m(e.message.receiver_user.username),1)])):(t(),r("span",ze," 系统 ")),e.message.type==4?(t(),I(b,{key:3,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[_(" 私信 ")]),_:1})):i("",!0),S.value?(t(),I(b,{key:4,class:"top-tag",type:"info",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(J)},null,8,["component"])]),default:a(()=>[_(" 已发送 ")]),_:1})):i("",!0),e.message.type==4&&e.message.receiver_user_id==o(l).state.userInfo.id?(t(),I(b,{key:5,class:"top-tag",type:"warning",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(J)},null,8,["component"])]),default:a(()=>[_(" 已接收 ")]),_:1})):i("",!0)])]),"header-extra":a(()=>[f("span",Fe,[g.value&&e.message.is_read===0?(t(),I(W,{key:0,dot:"",processing:""})):i("",!0),f("span",Oe,m(o(te)(e.message.created_on)),1),s(B,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:w},{default:a(()=>[s(j,{quaternary:"",circle:""},{icon:a(()=>[s(o(d),null,{default:a(()=>[s(o(ae))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:a(()=>[s(P,{"show-icon":!1,class:"brief-wrap",type:!g.value||e.message.is_read>0?"default":"success"},{default:a(()=>[e.message.type!=4?(t(),r("div",qe,[_(m(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(t(),r("span",{key:0,onClick:n[2]||(n[2]=C(V=>R(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(oe))]),_:1}),_(" 查看详情 ")])):i("",!0)])):i("",!0),e.message.type===4?(t(),r("div",Ne,m(e.message.content),1)):i("",!0),e.message.type===5?(t(),r("div",Re,[_(m(e.message.content)+" ",1),e.message.reply_id===1?(t(),r("span",{key:0,onClick:n[3]||(n[3]=C(V=>z(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(re))]),_:1}),_(" 同意 ")])):i("",!0),e.message.reply_id===1?(t(),r("span",{key:1,onClick:n[4]||(n[4]=C(V=>A(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(K))]),_:1}),_(" 拒绝 ")])):i("",!0),e.message.reply_id===2?(t(),r("span",Ae,[s(o(d),null,{default:a(()=>[s(o(ie))]),_:1}),_(" 已同意 ")])):i("",!0),e.message.reply_id===3?(t(),r("span",We,[s(o(d),null,{default:a(()=>[s(o(K))]),_:1}),_(" 已拒绝 ")])):i("",!0)])):i("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const Pe=L(Be,[["__scopeId","data-v-2e510758"]]),Ve={class:"content"},De=D({__name:"message-skeleton",props:{num:{default:1}},setup(N){return(y,p)=>{const c=ve;return t(!0),r(T,null,Q(new Array(y.num),l=>(t(),r("div",{class:"skeleton-item",key:l},[f("div",Ve,[s(c,{text:"",repeat:2}),s(c,{text:"",style:{width:"60%"}})])]))),128)}}});const Le=L(De,[["__scopeId","data-v-01d2e871"]]),He={key:0,class:"skeleton-wrap"},Je={key:1},Ke={key:0,class:"empty-wrap"},Qe={key:0,class:"pagination-wrap"},Te=D({__name:"Messages",setup(N){const y=Z(),p=U(),c=v(!1),l=v(+y.query.p||1),k=v(10),h=v(0),w=v([]),g=v(!1),M=v({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),S=u=>{M.value=u,g.value=!0},R=()=>{g.value=!1},z=()=>{c.value=!0,ne({page:l.value,page_size:k.value}).then(u=>{c.value=!1,w.value=u.list,h.value=Math.ceil(u.pager.total_rows/k.value)}).catch(u=>{c.value=!1})},A=u=>{l.value=u,z()};return Y(()=>{z()}),(u,e)=>{const n=$e,$=we,F=Le,b=ke,W=Pe,j=he,B=fe,P=ye;return t(),r("div",null,[s(n,{title:"消息"}),s(B,{class:"main-content-wrap messages-wrap",bordered:""},{default:a(()=>[s($,{show:g.value,user:M.value,onSuccess:R},null,8,["show","user"]),c.value?(t(),r("div",He,[s(F,{num:k.value},null,8,["num"])])):(t(),r("div",Je,[w.value.length===0?(t(),r("div",Ke,[s(b,{size:"large",description:"暂无数据"})])):i("",!0),(t(!0),r(T,null,Q(w.value,O=>(t(),I(j,{key:O.id},{default:a(()=>[s(W,{message:O,onSendWhisper:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),h.value>0?(t(),r("div",Qe,[s(P,{page:l.value,"onUpdate:page":A,"page-slot":o(p).state.collapsedRight?5:8,"page-count":h.value},null,8,["page","page-slot","page-count"])])):i("",!0)])}}});const ys=L(Te,[["__scopeId","data-v-b40dcbaf"]]);export{ys as default}; +import{d as D,c as q,r as E,e as t,f as r,k as s,w as a,bf as o,j as f,y as C,A as _,x as m,q as I,Y as i,l as G,h as H,u as Q,F as T,H as v,b as Y}from"./@vue-a481fc63.js";import{u as U}from"./vuex-44de225f.js";import{u as X,b as Z}from"./vue-router-e5a2430e.js";import{J as x,K as ee,L as se,_ as L,M as ne}from"./index-8d220080.js";import{a as te}from"./formatTime-4210fcd1.js";import{J,i as ae,K as oe,N as re,O as K,Q as ie,p as le}from"./@vicons-7a4ef312.js";import{j as d,o as ue,M as _e,l as pe,e as ce,O as de,S as me,L as ge,U as ve,F as fe,Q as ye,I as ke,G as he}from"./naive-ui-d8de3dda.js";import{_ as we}from"./whisper-f9793dd1.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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-2ab8298d.js";const be={class:"sender-wrap"},Ce={key:0,class:"nickname"},Ie={class:"username"},Me={key:1,class:"nickname"},Se={class:"username"},ze={key:2,class:"nickname"},Fe={class:"timestamp"},Oe={class:"timestamp-txt"},qe={key:0,class:"brief-content"},Ne={key:1,class:"whisper-content-wrap"},Re={key:2,class:"requesting-friend-wrap"},Ae={key:2,class:"status-info"},We={key:3,class:"status-info"},je="https://assets.paopao.info/public/avatar/default/admin.png",Be=D({__name:"message-item",props:{message:{}},emits:["send-whisper"],setup(N,{emit:y}){const p=N,c=X(),l=U(),k=e=>()=>H(d,null,{default:()=>H(e)}),h=q(()=>[{label:"私信",key:"whisper",icon:k(le)}]),w=e=>{switch(e){case"whisper":const n=p.message;if(n.type!=99){let $=n.type==4&&n.sender_user_id==l.state.userInfo.id?n.receiver_user:n.sender_user;y("send-whisper",$)}break}},g=q(()=>p.message.type!==4||p.message.sender_user_id!==l.state.userInfo.id),M=q(()=>p.message.type==4&&p.message.receiver_user_id==l.state.userInfo.id),S=q(()=>p.message.type==4&&p.message.sender_user_id==l.state.userInfo.id),R=e=>{u(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?c.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},z=e=>{u(e),x({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},A=e=>{u(e),ee({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},u=e=>{p.message.receiver_user_id==l.state.userInfo.id&&e.is_read===0&&se({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const $=ue,F=E("router-link"),b=_e,W=pe,j=ce,B=de,P=me,O=ge;return t(),r("div",{class:G(["message-item",{unread:g.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=V=>u(e.message))},[s(O,{"content-indented":""},{avatar:a(()=>[s($,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(l).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:je},null,8,["src"])]),header:a(()=>[f("div",be,[e.message.type!=4&&e.message.sender_user.id>0||M.value?(t(),r("span",Ce,[s(F,{onClick:n[0]||(n[0]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:a(()=>[_(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),f("span",Ie," @"+m(e.message.sender_user.username),1)])):S.value?(t(),r("span",Me,[s(F,{onClick:n[1]||(n[1]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:a(()=>[_(m(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),f("span",Se," @"+m(e.message.receiver_user.username),1)])):(t(),r("span",ze," 系统 ")),e.message.type==4?(t(),I(b,{key:3,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[_(" 私信 ")]),_:1})):i("",!0),S.value?(t(),I(b,{key:4,class:"top-tag",type:"info",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(J)},null,8,["component"])]),default:a(()=>[_(" 已发送 ")]),_:1})):i("",!0),e.message.type==4&&e.message.receiver_user_id==o(l).state.userInfo.id?(t(),I(b,{key:5,class:"top-tag",type:"warning",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(J)},null,8,["component"])]),default:a(()=>[_(" 已接收 ")]),_:1})):i("",!0)])]),"header-extra":a(()=>[f("span",Fe,[g.value&&e.message.is_read===0?(t(),I(W,{key:0,dot:"",processing:""})):i("",!0),f("span",Oe,m(o(te)(e.message.created_on)),1),s(B,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:w},{default:a(()=>[s(j,{quaternary:"",circle:""},{icon:a(()=>[s(o(d),null,{default:a(()=>[s(o(ae))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:a(()=>[s(P,{"show-icon":!1,class:"brief-wrap",type:!g.value||e.message.is_read>0?"default":"success"},{default:a(()=>[e.message.type!=4?(t(),r("div",qe,[_(m(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(t(),r("span",{key:0,onClick:n[2]||(n[2]=C(V=>R(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(oe))]),_:1}),_(" 查看详情 ")])):i("",!0)])):i("",!0),e.message.type===4?(t(),r("div",Ne,m(e.message.content),1)):i("",!0),e.message.type===5?(t(),r("div",Re,[_(m(e.message.content)+" ",1),e.message.reply_id===1?(t(),r("span",{key:0,onClick:n[3]||(n[3]=C(V=>z(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(re))]),_:1}),_(" 同意 ")])):i("",!0),e.message.reply_id===1?(t(),r("span",{key:1,onClick:n[4]||(n[4]=C(V=>A(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(K))]),_:1}),_(" 拒绝 ")])):i("",!0),e.message.reply_id===2?(t(),r("span",Ae,[s(o(d),null,{default:a(()=>[s(o(ie))]),_:1}),_(" 已同意 ")])):i("",!0),e.message.reply_id===3?(t(),r("span",We,[s(o(d),null,{default:a(()=>[s(o(K))]),_:1}),_(" 已拒绝 ")])):i("",!0)])):i("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const Pe=L(Be,[["__scopeId","data-v-2e510758"]]),Ve={class:"content"},De=D({__name:"message-skeleton",props:{num:{default:1}},setup(N){return(y,p)=>{const c=ve;return t(!0),r(T,null,Q(new Array(y.num),l=>(t(),r("div",{class:"skeleton-item",key:l},[f("div",Ve,[s(c,{text:"",repeat:2}),s(c,{text:"",style:{width:"60%"}})])]))),128)}}});const Le=L(De,[["__scopeId","data-v-01d2e871"]]),He={key:0,class:"skeleton-wrap"},Je={key:1},Ke={key:0,class:"empty-wrap"},Qe={key:0,class:"pagination-wrap"},Te=D({__name:"Messages",setup(N){const y=Z(),p=U(),c=v(!1),l=v(+y.query.p||1),k=v(10),h=v(0),w=v([]),g=v(!1),M=v({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),S=u=>{M.value=u,g.value=!0},R=()=>{g.value=!1},z=()=>{c.value=!0,ne({page:l.value,page_size:k.value}).then(u=>{c.value=!1,w.value=u.list,h.value=Math.ceil(u.pager.total_rows/k.value)}).catch(u=>{c.value=!1})},A=u=>{l.value=u,z()};return Y(()=>{z()}),(u,e)=>{const n=$e,$=we,F=Le,b=ke,W=Pe,j=he,B=fe,P=ye;return t(),r("div",null,[s(n,{title:"消息"}),s(B,{class:"main-content-wrap messages-wrap",bordered:""},{default:a(()=>[s($,{show:g.value,user:M.value,onSuccess:R},null,8,["show","user"]),c.value?(t(),r("div",He,[s(F,{num:k.value},null,8,["num"])])):(t(),r("div",Je,[w.value.length===0?(t(),r("div",Ke,[s(b,{size:"large",description:"暂无数据"})])):i("",!0),(t(!0),r(T,null,Q(w.value,O=>(t(),I(j,{key:O.id},{default:a(()=>[s(W,{message:O,onSendWhisper:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),h.value>0?(t(),r("div",Qe,[s(P,{page:l.value,"onUpdate:page":A,"page-slot":o(p).state.collapsedRight?5:8,"page-count":h.value},null,8,["page","page-slot","page-count"])])):i("",!0)])}}});const ys=L(Te,[["__scopeId","data-v-b40dcbaf"]]);export{ys as default}; diff --git a/web/dist/assets/Post-b0a250af.js b/web/dist/assets/Post-ed61910e.js similarity index 58% rename from web/dist/assets/Post-b0a250af.js rename to web/dist/assets/Post-ed61910e.js index af52b1dc..0694dc40 100644 --- a/web/dist/assets/Post-b0a250af.js +++ b/web/dist/assets/Post-ed61910e.js @@ -1 +1 @@ -import{d as ee,H as c,r as ge,e as o,f as _,j as d,k as t,w as n,A as I,x as P,q as R,Y as u,bf as a,y as B,c as oe,al as Ve,F as re,u as _e,$ as Te,a0 as ze,b as Re,h as $e,E as Ye}from"./@vue-a481fc63.js";import{u as ne}from"./vuex-44de225f.js";import{f as pe}from"./formatTime-4210fcd1.js";import{t as Je,f as Ke,h as We,_ as ae,i as Ge,j as Qe,k as Xe,l as Ze,g as et,m as tt,n as st,o as ot,p as nt,q as at,s as lt,r as it,v as ut,u as ct,w as rt,x as _t,y as Ce}from"./index-cb280048.js";import{Y as de,V as G}from"./IEnum-5453a777.js";import{T as Ue,e as me,f as Se,g as ve,h as Le,I as pt,i as dt,j as mt,k as vt,l as ht,m as ft,n as gt,o as yt,p as kt,q as wt,r as bt,s as $t,t as xe,F as Ie,E as ie,u as ue,v as ce,w as Pe}from"./@vicons-7a4ef312.js";import{j as H,e as le,J as Oe,H as Ct,b as xt,K as It,o as ye,L as De,v as Pt,w as Tt,x as zt,y as Rt,z as Ut,B as St,M as Lt,O as Ot,i as Dt,P as At,a as Ae,F as Mt,I as Et,k as qt,G as Nt,f as Bt,g as jt}from"./naive-ui-d8de3dda.js";import{p as ke,_ as Me,a as Ft,b as Ht,c as Vt}from"./content-64ba0596.js";import{u as Ee,b as Yt}from"./vue-router-e5a2430e.js";import{_ as Jt}from"./post-skeleton-26b3006b.js";import{l as Kt}from"./lodash-e0b37ac3.js";import{_ as Wt}from"./whisper-31e5b9ad.js";import{c as Gt}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as Qt}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{W as Xt}from"./v3-infinite-loading-2c58ec2f.js";import"./moment-2ab8298d.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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"./paopao-video-player-2fe58954.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";const Zt={class:"reply-item"},es={class:"header-wrap"},ts={class:"username"},ss={class:"reply-name"},os={class:"timestamp"},ns={class:"base-wrap"},as={class:"content"},ls={class:"reply-switch"},is={class:"time-item"},us={class:"actions"},cs={class:"upvote-count"},rs=["onClick"],_s={class:"upvote-count"},ps={key:2,class:"action-item"},ds=["onClick"],ms=ee({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const i=E,m=ne(),v=c(i.reply.is_thumbs_up==de.YES),k=c(i.reply.is_thumbs_down==de.YES),w=c(i.reply.thumbs_up_count),U=()=>{Je({tweet_id:i.tweetId,comment_id:i.reply.comment_id,reply_id:i.reply.id}).then(h=>{v.value=!v.value,v.value?(w.value++,k.value=!1):w.value--}).catch(h=>{console.log(h)})},r=()=>{Ke({tweet_id:i.tweetId,comment_id:i.reply.comment_id,reply_id:i.reply.id}).then(h=>{k.value=!k.value,k.value&&v.value&&(w.value--,v.value=!1)}).catch(h=>{console.log(h)})},S=()=>{q("focusReply",i.reply)},T=()=>{We({id:i.reply.id}).then(h=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(h=>{console.log(h)})};return(h,$)=>{const O=ge("router-link"),p=H,C=le,D=Oe,b=Ct;return o(),_("div",Zt,[d("div",es,[d("div",ts,[t(O,{class:"user-link",to:{name:"user",query:{s:i.reply.user.username}}},{default:n(()=>[I(P(i.reply.user.username),1)]),_:1},8,["to"]),d("span",ss,P(i.reply.at_user_id>0?"回复":":"),1),i.reply.at_user_id>0?(o(),R(O,{key:0,class:"user-link",to:{name:"user",query:{s:i.reply.at_user.username}}},{default:n(()=>[I(P(i.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",os,[I(P(i.reply.ip_loc)+" ",1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===i.reply.user.id?(o(),R(D,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:T},{trigger:n(()=>[t(C,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(p,null,{default:n(()=>[t(a(Ue))]),_:1})]),_:1})]),default:n(()=>[I(" 是否确认删除? ")]),_:1})):u("",!0)])]),d("div",ns,[d("div",as,[t(b,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[I(P(i.reply.content),1)]),_:1})]),d("div",ls,[d("span",is,P(a(pe)(i.reply.created_on)),1),d("div",us,[a(m).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:$[0]||($[0]=B(()=>{},["stop"]))},[t(p,{size:"medium"},{default:n(()=>[t(a(me))]),_:1}),d("span",cs,P(w.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:B(U,["stop"])},[t(p,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),R(a(me),{key:0})),v.value?(o(),R(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",_s,P(w.value>0?w.value:"赞"),1)],8,rs)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",ps,[t(p,{size:"medium"},{default:n(()=>[t(a(ve))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:B(r,["stop"])},[t(p,{size:"medium"},{default:n(()=>[k.value?u("",!0):(o(),R(a(ve),{key:0})),k.value?(o(),R(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,ds)):u("",!0),a(m).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:S}," 回复 ")):u("",!0)])])])])}}});const vs=ae(ms,[["__scopeId","data-v-187a4ed3"]]),hs={class:"reply-compose-wrap"},fs={class:"reply-switch"},gs={class:"time-item"},ys={class:"actions"},ks={key:0,class:"action-item"},ws={class:"upvote-count"},bs=["onClick"],$s={class:"upvote-count"},Cs={key:2,class:"action-item"},xs=["onClick"],Is={key:0,class:"reply-input-wrap"},Ps=ee({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:i}){const m=E,v=ne(),k=c(),w=c(!1),U=c(""),r=c(!1),S=+"300",T=c(m.comment.is_thumbs_up==de.YES),h=c(m.comment.is_thumbs_down==de.YES),$=c(m.comment.thumbs_up_count),O=()=>{Ge({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(b=>{T.value=!T.value,T.value?($.value++,h.value=!1):$.value--}).catch(b=>{console.log(b)})},p=()=>{Qe({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(b=>{h.value=!h.value,h.value&&T.value&&($.value--,T.value=!1)}).catch(b=>{console.log(b)})},C=b=>{w.value=b,b?setTimeout(()=>{var A;(A=k.value)==null||A.focus()},10):(r.value=!1,U.value="",i("reset"))},D=()=>{r.value=!0,Xe({comment_id:m.comment.id,at_user_id:m.atUserid,content:U.value}).then(b=>{C(!1),window.$message.success("评论成功"),i("reload")}).catch(b=>{r.value=!1})};return q({switchReply:C}),(b,A)=>{const s=H,g=xt,F=le,z=It;return o(),_("div",hs,[d("div",fs,[d("span",gs,P(a(pe)(b.comment.created_on)),1),d("div",ys,[a(v).state.userLogined?u("",!0):(o(),_("div",ks,[t(s,{size:"medium"},{default:n(()=>[t(a(me))]),_:1}),d("span",ws,P($.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:B(O,["stop"])},[t(s,{size:"medium"},{default:n(()=>[T.value?u("",!0):(o(),R(a(me),{key:0})),T.value?(o(),R(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",$s,P($.value>0?$.value:"赞"),1)],8,bs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",Cs,[t(s,{size:"medium"},{default:n(()=>[t(a(ve))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:B(p,["stop"])},[t(s,{size:"medium"},{default:n(()=>[h.value?u("",!0):(o(),R(a(ve),{key:0})),h.value?(o(),R(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,xs)):u("",!0),a(v).state.userLogined&&!w.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:A[0]||(A[0]=L=>C(!0))}," 回复 ")):u("",!0),a(v).state.userLogined&&w.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:A[1]||(A[1]=L=>C(!1))}," 取消 ")):u("",!0)])]),w.value?(o(),_("div",Is,[t(z,null,{default:n(()=>[t(g,{ref_key:"inputInstRef",ref:k,size:"small",placeholder:m.atUsername?"@"+m.atUsername:"请输入回复内容..",maxlength:a(S),value:U.value,"onUpdate:value":A[2]||(A[2]=L=>U.value=L),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(F,{type:"primary",size:"small",ghost:"",loading:r.value,onClick:D},{default:n(()=>[I(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ts=ae(Ps,[["__scopeId","data-v-f9af7a93"]]),zs={class:"comment-item"},Rs={class:"nickname-wrap"},Us={class:"username-wrap"},Ss={class:"opt-wrap"},Ls={class:"timestamp"},Os=["innerHTML"],Ds={class:"reply-wrap"},As=ee({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(E,{emit:q}){const i=E,m=ne(),v=Ee(),k=c(0),w=c(""),U=c(),r=oe(()=>{let p=Object.assign({texts:[],imgs:[]},i.comment);return p.contents.map(C=>{(+C.type==1||+C.type==2)&&p.texts.push(C),+C.type==3&&p.imgs.push(C)}),p}),S=(p,C)=>{let D=p.target;if(D.dataset.detail){const b=D.dataset.detail.split(":");b.length===2&&(m.commit("refresh"),b[0]==="tag"?window.$message.warning("评论内的无效话题"):v.push({name:"user",query:{s:b[1]}}))}},T=p=>{var C,D;k.value=p.user_id,w.value=((C=p.user)==null?void 0:C.username)||"",(D=U.value)==null||D.switchReply(!0)},h=()=>{q("reload")},$=()=>{k.value=0,w.value=""},O=()=>{Ze({id:r.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{h()},50)}).catch(p=>{})};return(p,C)=>{const D=ye,b=ge("router-link"),A=H,s=le,g=Oe,F=Me,z=Ts,L=vs,J=De;return o(),_("div",zs,[t(J,{"content-indented":""},Ve({avatar:n(()=>[t(D,{round:"",size:30,src:r.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Rs,[t(b,{onClick:C[0]||(C[0]=B(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:r.value.user.username}}},{default:n(()=>[I(P(r.value.user.nickname),1)]),_:1},8,["to"])]),d("span",Us," @"+P(r.value.user.username),1)]),"header-extra":n(()=>[d("div",Ss,[d("span",Ls,P(r.value.ip_loc),1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===r.value.user.id?(o(),R(g,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:O},{trigger:n(()=>[t(s,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(A,null,{default:n(()=>[t(a(Ue))]),_:1})]),_:1})]),default:n(()=>[I(" 是否确认删除? ")]),_:1})):u("",!0)])]),footer:n(()=>[r.value.imgs.length>0?(o(),R(F,{key:0,imgs:r.value.imgs},null,8,["imgs"])):u("",!0),t(z,{ref_key:"replyComposeRef",ref:U,comment:r.value,"at-userid":k.value,"at-username":w.value,onReload:h,onReset:$},null,8,["comment","at-userid","at-username"]),d("div",Ds,[(o(!0),_(re,null,_e(r.value.replies,j=>(o(),R(L,{key:j.id,reply:j,"tweet-id":r.value.post_id,onFocusReply:T,onReload:h},null,8,["reply","tweet-id"]))),128))])]),_:2},[r.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(re,null,_e(r.value.texts,j=>(o(),_("span",{key:j.id,class:"comment-text",onClick:C[1]||(C[1]=B(V=>S(V,r.value.id),["stop"])),innerHTML:a(ke)(j.content).content},null,8,Os))),128))]),key:"0"}:void 0]),1024)])}}});const Ms=ae(As,[["__scopeId","data-v-36dac8c8"]]),Es=E=>(Te("data-v-d9073453"),E=E(),ze(),E),qs={key:0,class:"compose-wrap"},Ns={class:"compose-line"},Bs={class:"compose-user"},js={class:"compose-line compose-options"},Fs={class:"attachment"},Hs={class:"submit-wrap"},Vs={class:"attachment-list-wrap"},Ys={key:1,class:"compose-wrap"},Js=Es(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Ks={key:0,class:"login-only-wrap"},Ws={key:1,class:"login-wrap"},Gs=ee({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const i=E,m=ne(),v=c([]),k=c(!1),w=c(!1),U=c(!1),r=c(""),S=c(),T=c("public/image"),h=c([]),$=c([]),O=c("true".toLowerCase()==="true"),p=+"300",C="/v1/attachment",D=oe(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),b=Kt.debounce(f=>{et({k:f}).then(y=>{let x=[];y.suggest.map(e=>{x.push({label:e,value:e})}),v.value=x,w.value=!1}).catch(y=>{w.value=!1})},200),A=(f,y)=>{w.value||(w.value=!0,y==="@"&&b(f))},s=f=>{f.length>p?r.value=f.substring(0,p):r.value=f},g=f=>{T.value=f},F=f=>{for(let l=0;l30&&(f[l].name=x.substring(0,18)+"..."+x.substring(x.length-9)+"."+e)}h.value=f},z=async f=>{var y,x;return T.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((y=f.file.file)==null?void 0:y.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):T.value==="image"&&((x=f.file.file)==null?void 0:x.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},L=({file:f,event:y})=>{var x;try{let e=JSON.parse((x=y.target)==null?void 0:x.response);e.code===0&&T.value==="public/image"&&$.value.push({id:f.id,content:e.data.content})}catch{window.$message.error("上传失败")}},J=({file:f,event:y})=>{var x;try{let e=JSON.parse((x=y.target)==null?void 0:x.response);if(e.code!==0){let l=e.msg||"上传失败";e.details&&e.details.length>0&&e.details.map(M=>{l+=":"+M}),window.$message.error(l)}}catch{window.$message.error("上传失败")}},j=({file:f})=>{let y=$.value.findIndex(x=>x.id===f.id);y>-1&&$.value.splice(y,1)},V=()=>{k.value=!0},Q=()=>{var f;k.value=!1,(f=S.value)==null||f.clear(),h.value=[],r.value="",$.value=[]},K=()=>{if(r.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=ke(r.value);const y=[];let x=100;y.push({content:r.value,type:2,sort:x}),$.value.map(e=>{x++,y.push({content:e.content,type:3,sort:x})}),U.value=!0,tt({contents:y,post_id:i.postId,users:Array.from(new Set(f))}).then(e=>{window.$message.success("发布成功"),U.value=!1,q("post-success"),Q()}).catch(e=>{U.value=!1})},Y=f=>{m.commit("triggerAuth",!0),m.commit("triggerAuthKey",f)};return(f,y)=>{const x=ye,e=Pt,l=H,M=le,X=Tt,te=zt,he=Rt,fe=Ut,W=St;return o(),_("div",null,[a(m).state.userInfo.id>0?(o(),_("div",qs,[d("div",Ns,[d("div",Bs,[t(x,{round:"",size:30,src:a(m).state.userInfo.avatar},null,8,["src"])]),t(e,{type:"textarea",size:"large",autosize:"",bordered:!1,options:v.value,prefix:["@"],loading:w.value,value:r.value,disabled:i.lock===1,"onUpdate:value":s,onSearch:A,onFocus:V,placeholder:i.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),k.value?(o(),R(W,{key:0,ref_key:"uploadRef",ref:S,abstract:"","list-type":"image",multiple:!0,max:9,action:C,headers:{Authorization:D.value},data:{type:T.value},"file-list":h.value,onBeforeUpload:z,onFinish:L,onError:J,onRemove:j,"onUpdate:fileList":F},{default:n(()=>[d("div",js,[d("div",Fs,[t(X,{abstract:""},{default:n(({handleClick:Z})=>[t(M,{disabled:h.value.length>0&&T.value==="public/video"||h.value.length===9,onClick:()=>{g("public/image"),Z()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(l,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(pt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(he,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(te,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:r.value.length/a(p)*100},null,8,["percentage"])]),default:n(()=>[I(" "+P(r.value.length)+" / "+P(a(p)),1)]),_:1})]),d("div",Hs,[t(M,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:Q},{default:n(()=>[I(" 取消 ")]),_:1}),t(M,{loading:U.value,onClick:K,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[I(" 发布 ")]),_:1},8,["loading"])])]),d("div",Vs,[t(fe)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",Ys,[Js,O.value?u("",!0):(o(),_("div",Ks,[t(M,{strong:"",secondary:"",round:"",type:"primary",onClick:y[0]||(y[0]=Z=>Y("signin"))},{default:n(()=>[I(" 登录 ")]),_:1})])),O.value?(o(),_("div",Ws,[t(M,{strong:"",secondary:"",round:"",type:"primary",onClick:y[1]||(y[1]=Z=>Y("signin"))},{default:n(()=>[I(" 登录 ")]),_:1}),t(M,{strong:"",secondary:"",round:"",type:"info",onClick:y[2]||(y[2]=Z=>Y("signup"))},{default:n(()=>[I(" 注册 ")]),_:1})])):u("",!0)]))])}}});const Qs=ae(Gs,[["__scopeId","data-v-d9073453"]]),Xs={class:"username-wrap"},Zs={class:"options"},eo={key:0},to=["innerHTML"],so={class:"timestamp"},oo={key:0},no={key:1},ao={class:"opts-wrap"},lo=["onClick"],io={class:"opt-item"},uo=["onClick"],co=["onClick"],ro=ee({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const i=E,m="true".toLowerCase()==="true",v=ne(),k=Ee(),w=c(!1),U=c(!1),r=c(!1),S=c(!1),T=c(!1),h=c(!1),$=c(!1),O=c(!1),p=c(G.PUBLIC),C=c(!1),D=c({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),b=e=>{D.value=e,C.value=!0},A=()=>{C.value=!1},s=oe({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},i.post);return e.contents.map(l=>{(+l.type==1||+l.type==2)&&e.texts.push(l),+l.type==3&&e.imgs.push(l),+l.type==4&&e.videos.push(l),+l.type==6&&e.links.push(l),+l.type==7&&e.attachments.push(l),+l.type==8&&e.charge_attachments.push(l)}),e},set:e=>{i.post.upvote_count=e.upvote_count,i.post.comment_count=e.comment_count,i.post.collection_count=e.collection_count,i.post.is_essence=e.is_essence}}),g=e=>()=>$e(H,null,{default:()=>$e(e)}),F=oe(()=>{var M;let e=[{label:"私信",key:"whisper",icon:g(kt)}];if(!v.state.userInfo.is_admin&&v.state.userInfo.id!=i.post.user.id)return e;e.push({label:"删除",key:"delete",icon:g(wt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:g(bt)}):e.push({label:"解锁",key:"unlock",icon:g($t)}),v.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:g(xe)}):e.push({label:"取消置顶",key:"unstick",icon:g(xe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:g(Ie)}):e.push({label:"取消亮点",key:"unhighlight",icon:g(Ie)});let l;return s.value.visibility===G.PUBLIC?l={label:"公开",key:"vpublic",icon:g(ie),children:[{label:"私密",key:"vprivate",icon:g(ue)},{label:"关注可见",key:"vfollowing",icon:g(ce)}]}:s.value.visibility===G.PRIVATE?l={label:"私密",key:"vprivate",icon:g(ue),children:[{label:"公开",key:"vpublic",icon:g(ie)},{label:"关注可见",key:"vfollowing",icon:g(ce)}]}:m&&s.value.visibility===G.FRIEND?l={label:"好友可见",key:"vfriend",icon:g(Pe),children:[{label:"公开",key:"vpublic",icon:g(ie)},{label:"私密",key:"vprivate",icon:g(ue)},{label:"关注可见",key:"vfollowing",icon:g(ce)}]}:l={label:"关注可见",key:"vfollowing",icon:g(ce),children:[{label:"公开",key:"vpublic",icon:g(ie)},{label:"私密",key:"vprivate",icon:g(ue)}]},m&&s.value.visibility!==G.FRIEND&&((M=l.children)==null||M.push({label:"好友可见",key:"vfriend",icon:g(Pe)})),e.push(l),e}),z=e=>{k.push({name:"post",query:{id:e}})},L=(e,l)=>{if(e.target.dataset.detail){const M=e.target.dataset.detail.split(":");if(M.length===2){v.commit("refresh"),M[0]==="tag"?k.push({name:"home",query:{q:M[1],t:"tag"}}):k.push({name:"user",query:{s:M[1]}});return}}z(l)},J=e=>{switch(e){case"whisper":b(i.post.user);break;case"delete":r.value=!0;break;case"lock":case"unlock":S.value=!0;break;case"stick":case"unstick":T.value=!0;break;case"highlight":case"unhighlight":h.value=!0;break;case"vpublic":p.value=0,$.value=!0;break;case"vprivate":p.value=1,$.value=!0;break;case"vfriend":p.value=2,$.value=!0;break;case"vfollowing":p.value=3,$.value=!0;break}},j=()=>{nt({id:s.value.id}).then(e=>{window.$message.success("删除成功"),k.replace("/"),setTimeout(()=>{v.commit("refresh")},50)}).catch(e=>{O.value=!1})},V=()=>{at({id:s.value.id}).then(e=>{q("reload"),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{O.value=!1})},Q=()=>{lt({id:s.value.id}).then(e=>{q("reload"),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{O.value=!1})},K=()=>{it({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{O.value=!1})},Y=()=>{let e=p.value;e==3&&(e=0),ut({id:s.value.id,visibility:e}).then(l=>{q("reload"),window.$message.success("修改可见性成功")}).catch(l=>{O.value=!1})},f=()=>{ct({id:s.value.id}).then(e=>{w.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},y=()=>{rt({id:s.value.id}).then(e=>{U.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},x=()=>{Gt(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Re(()=>{v.state.userInfo.id>0&&(st({id:s.value.id}).then(e=>{w.value=e.status}).catch(e=>{console.log(e)}),ot({id:s.value.id}).then(e=>{U.value=e.status}).catch(e=>{console.log(e)}))}),(e,l)=>{const M=ye,X=ge("router-link"),te=Lt,he=le,fe=Ot,W=Dt,Z=Wt,we=Ft,qe=Me,Ne=Ht,Be=Vt,be=At,je=Ae,Fe=De;return o(),_("div",{class:"detail-item",onClick:l[7]||(l[7]=N=>z(s.value.id))},[t(Fe,null,{avatar:n(()=>[t(M,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(X,{onClick:l[0]||(l[0]=B(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[I(P(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",Xs," @"+P(s.value.user.username),1),s.value.is_top?(o(),R(te,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[I(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(G).PRIVATE?(o(),R(te,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[I(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(G).FRIEND?(o(),R(te,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[I(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Zs,[t(fe,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:J},{default:n(()=>[t(he,{quaternary:"",circle:""},{icon:n(()=>[t(a(H),null,{default:n(()=>[t(a(dt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(W,{show:r.value,"onUpdate:show":l[1]||(l[1]=N=>r.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:j},null,8,["show"]),t(W,{show:S.value,"onUpdate:show":l[2]||(l[2]=N=>S.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:V},null,8,["show","content"]),t(W,{show:T.value,"onUpdate:show":l[3]||(l[3]=N=>T.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Q},null,8,["show","content"]),t(W,{show:h.value,"onUpdate:show":l[4]||(l[4]=N=>h.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show","content"]),t(W,{show:$.value,"onUpdate:show":l[5]||(l[5]=N=>$.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Y},null,8,["show","content"]),t(Z,{show:C.value,user:D.value,onSuccess:A},null,8,["show","user"])]),footer:n(()=>[t(we,{attachments:s.value.attachments},null,8,["attachments"]),t(we,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(qe,{imgs:s.value.imgs},null,8,["imgs"]),t(Ne,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Be,{links:s.value.links},null,8,["links"]),d("div",so,[I(" 发布于 "+P(a(pe)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",oo,[t(be,{vertical:""}),I(" "+P(s.value.ip_loc),1)])):u("",!0),!a(v).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",no,[t(be,{vertical:""}),I(" 最后回复 "+P(a(pe)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",ao,[t(je,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:B(f,["stop"])},[t(a(H),{size:"20",class:"opt-item-icon"},{default:n(()=>[w.value?u("",!0):(o(),R(a(mt),{key:0})),w.value?(o(),R(a(vt),{key:1,color:"red"})):u("",!0)]),_:1}),I(" "+P(s.value.upvote_count),1)],8,lo),d("div",io,[t(a(H),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(ht))]),_:1}),I(" "+P(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:B(y,["stop"])},[t(a(H),{size:"20",class:"opt-item-icon"},{default:n(()=>[U.value?u("",!0):(o(),R(a(ft),{key:0})),U.value?(o(),R(a(gt),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),I(" "+P(s.value.collection_count),1)],8,uo),d("div",{class:"opt-item hover",onClick:B(x,["stop"])},[t(a(H),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(yt))]),_:1}),I(" "+P(s.value.share_count),1)],8,co)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",eo,[(o(!0),_(re,null,_e(s.value.texts,N=>(o(),_("span",{key:N.id,class:"post-text",onClick:l[6]||(l[6]=B(He=>L(He,s.value.id),["stop"])),innerHTML:a(ke)(N.content).content},null,8,to))),128))])):u("",!0)]),_:1})])}}});const _o=E=>(Te("data-v-0d01659f"),E=E(),ze(),E),po={key:0,class:"detail-wrap"},mo={key:1,class:"empty-wrap"},vo={key:0,class:"comment-opts-wrap"},ho=_o(()=>d("span",{class:"comment-title-item"},"评论",-1)),fo={key:2},go={key:0,class:"skeleton-wrap"},yo={key:1},ko={key:0,class:"empty-wrap"},wo={key:0,class:"load-more-spinner"},bo={key:1,class:"load-more-spinner"},$o={key:2,class:"load-more-spinner"},Co={key:3,class:"load-more-spinner"},se=20,xo=ee({__name:"Post",setup(E){const q=Yt(),i=c({}),m=c(!1),v=c(!1),k=c([]),w=oe(()=>+q.query.id),U=c("default"),r=c(!0);let S={loading(){},loaded(){},complete(){},error(){}};const T=z=>{U.value=z,z==="default"&&(r.value=!0),g(S)},h=()=>{i.value={id:0},m.value=!0,_t({id:w.value}).then(z=>{m.value=!1,i.value=z,g(S)}).catch(z=>{m.value=!1})};let $=1;const O=c(!1),p=c([]),C=z=>{O.value||Ce({id:i.value.id,sort_strategy:"default",page:$,page_size:se}).then(L=>{z!==null&&(S=z),L.list.length0&&($===1?p.value=L.list:p.value.push(...L.list),k.value=p.value),S.loaded(),v.value=!1}).catch(L=>{v.value=!1,S.error()})};let D=1,b=c(!1);const A=c([]),s=z=>{b.value||Ce({id:i.value.id,sort_strategy:"newest",page:D,page_size:se}).then(L=>{z!==null&&(S=z),L.list.length0&&(D===1?A.value=L.list:A.value.push(...L.list),k.value=A.value),S.loaded(),v.value=!1}).catch(L=>{v.value=!1,S.error()})},g=z=>{w.value<1||(k.value.length===0&&(v.value=!0),U.value==="default"?(k.value=p.value,C(z)):(k.value=A.value,s(z)),v.value=!1)},F=()=>{$=1,O.value=!1,p.value=[],D=1,b.value=!1,A.value=[],g(S)};return Re(()=>{h()}),Ye(w,()=>{w.value>0&&q.name==="post"&&h()}),(z,L)=>{const J=Qt,j=ro,V=Et,Q=qt,K=Nt,Y=Bt,f=jt,y=Qs,x=Jt,e=Ms,l=Ae,M=Mt;return o(),_("div",null,[t(J,{title:"泡泡详情",back:!0}),t(M,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(K,null,{default:n(()=>[t(Q,{show:m.value},{default:n(()=>[i.value.id>1?(o(),_("div",po,[t(j,{post:i.value,onReload:h},null,8,["post"])])):(o(),_("div",mo,[t(V,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),i.value.id>0?(o(),_("div",vo,[t(f,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":T},{prefix:n(()=>[ho]),default:n(()=>[t(Y,{name:"default",tab:"默认"}),t(Y,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),i.value.id>0?(o(),R(K,{key:1},{default:n(()=>[t(y,{lock:i.value.is_lock,"post-id":i.value.id,onPostSuccess:F},null,8,["lock","post-id"])]),_:1})):u("",!0),i.value.id>0?(o(),_("div",fo,[v.value?(o(),_("div",go,[t(x,{num:5})])):(o(),_("div",yo,[k.value.length===0?(o(),_("div",ko,[t(V,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(re,null,_e(k.value,X=>(o(),R(K,{key:X.id},{default:n(()=>[t(e,{comment:X,onReload:F},null,8,["comment"])]),_:2},1024))),128))]))])):u("",!0),k.value.length>=se?(o(),R(l,{key:3,justify:"center"},{default:n(()=>[t(a(Xt),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:g},{spinner:n(()=>[r.value&&O.value?(o(),_("span",wo)):u("",!0),!r.value&&a(b)?(o(),_("span",bo)):u("",!0),r.value&&!O.value?(o(),_("span",$o,"加载评论")):u("",!0),!r.value&&!a(b)?(o(),_("span",Co,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const ln=ae(xo,[["__scopeId","data-v-0d01659f"]]);export{ln as default}; +import{d as ee,H as c,r as ge,e as o,f as _,j as d,k as t,w as n,A as I,x as P,q as R,Y as u,bf as a,y as B,c as oe,al as Ve,F as re,u as _e,$ as Te,a0 as ze,b as Re,h as $e,E as Ye}from"./@vue-a481fc63.js";import{u as ne}from"./vuex-44de225f.js";import{f as pe}from"./formatTime-4210fcd1.js";import{t as Je,f as Ke,h as We,_ as ae,i as Ge,j as Qe,k as Xe,l as Ze,g as et,m as tt,n as st,o as ot,p as nt,q as at,s as lt,r as it,v as ut,u as ct,w as rt,x as _t,y as Ce}from"./index-8d220080.js";import{Y as de,V as G}from"./IEnum-5453a777.js";import{T as Ue,e as me,f as Se,g as ve,h as Le,I as pt,i as dt,j as mt,k as vt,l as ht,m as ft,n as gt,o as yt,p as kt,q as wt,r as bt,s as $t,t as xe,F as Ie,E as ie,u as ue,v as ce,w as Pe}from"./@vicons-7a4ef312.js";import{j as H,e as le,J as Oe,H as Ct,b as xt,K as It,o as ye,L as De,v as Pt,w as Tt,x as zt,y as Rt,z as Ut,B as St,M as Lt,O as Ot,i as Dt,P as At,a as Ae,F as Mt,I as Et,k as qt,G as Nt,f as Bt,g as jt}from"./naive-ui-d8de3dda.js";import{p as ke,_ as Me,a as Ft,b as Ht,c as Vt}from"./content-e3389a3a.js";import{u as Ee,b as Yt}from"./vue-router-e5a2430e.js";import{_ as Jt}from"./post-skeleton-54a835d7.js";import{l as Kt}from"./lodash-e0b37ac3.js";import{_ as Wt}from"./whisper-f9793dd1.js";import{c as Gt}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as Qt}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{W as Xt}from"./v3-infinite-loading-2c58ec2f.js";import"./moment-2ab8298d.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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"./paopao-video-player-2fe58954.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";const Zt={class:"reply-item"},es={class:"header-wrap"},ts={class:"username"},ss={class:"reply-name"},os={class:"timestamp"},ns={class:"base-wrap"},as={class:"content"},ls={class:"reply-switch"},is={class:"time-item"},us={class:"actions"},cs={class:"upvote-count"},rs=["onClick"],_s={class:"upvote-count"},ps={key:2,class:"action-item"},ds=["onClick"],ms=ee({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const i=E,m=ne(),v=c(i.reply.is_thumbs_up==de.YES),k=c(i.reply.is_thumbs_down==de.YES),w=c(i.reply.thumbs_up_count),U=()=>{Je({tweet_id:i.tweetId,comment_id:i.reply.comment_id,reply_id:i.reply.id}).then(h=>{v.value=!v.value,v.value?(w.value++,k.value=!1):w.value--}).catch(h=>{console.log(h)})},r=()=>{Ke({tweet_id:i.tweetId,comment_id:i.reply.comment_id,reply_id:i.reply.id}).then(h=>{k.value=!k.value,k.value&&v.value&&(w.value--,v.value=!1)}).catch(h=>{console.log(h)})},S=()=>{q("focusReply",i.reply)},T=()=>{We({id:i.reply.id}).then(h=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(h=>{console.log(h)})};return(h,$)=>{const O=ge("router-link"),p=H,C=le,D=Oe,b=Ct;return o(),_("div",Zt,[d("div",es,[d("div",ts,[t(O,{class:"user-link",to:{name:"user",query:{s:i.reply.user.username}}},{default:n(()=>[I(P(i.reply.user.username),1)]),_:1},8,["to"]),d("span",ss,P(i.reply.at_user_id>0?"回复":":"),1),i.reply.at_user_id>0?(o(),R(O,{key:0,class:"user-link",to:{name:"user",query:{s:i.reply.at_user.username}}},{default:n(()=>[I(P(i.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",os,[I(P(i.reply.ip_loc)+" ",1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===i.reply.user.id?(o(),R(D,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:T},{trigger:n(()=>[t(C,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(p,null,{default:n(()=>[t(a(Ue))]),_:1})]),_:1})]),default:n(()=>[I(" 是否确认删除? ")]),_:1})):u("",!0)])]),d("div",ns,[d("div",as,[t(b,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[I(P(i.reply.content),1)]),_:1})]),d("div",ls,[d("span",is,P(a(pe)(i.reply.created_on)),1),d("div",us,[a(m).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:$[0]||($[0]=B(()=>{},["stop"]))},[t(p,{size:"medium"},{default:n(()=>[t(a(me))]),_:1}),d("span",cs,P(w.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:B(U,["stop"])},[t(p,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),R(a(me),{key:0})),v.value?(o(),R(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",_s,P(w.value>0?w.value:"赞"),1)],8,rs)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",ps,[t(p,{size:"medium"},{default:n(()=>[t(a(ve))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:B(r,["stop"])},[t(p,{size:"medium"},{default:n(()=>[k.value?u("",!0):(o(),R(a(ve),{key:0})),k.value?(o(),R(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,ds)):u("",!0),a(m).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:S}," 回复 ")):u("",!0)])])])])}}});const vs=ae(ms,[["__scopeId","data-v-187a4ed3"]]),hs={class:"reply-compose-wrap"},fs={class:"reply-switch"},gs={class:"time-item"},ys={class:"actions"},ks={key:0,class:"action-item"},ws={class:"upvote-count"},bs=["onClick"],$s={class:"upvote-count"},Cs={key:2,class:"action-item"},xs=["onClick"],Is={key:0,class:"reply-input-wrap"},Ps=ee({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:i}){const m=E,v=ne(),k=c(),w=c(!1),U=c(""),r=c(!1),S=+"300",T=c(m.comment.is_thumbs_up==de.YES),h=c(m.comment.is_thumbs_down==de.YES),$=c(m.comment.thumbs_up_count),O=()=>{Ge({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(b=>{T.value=!T.value,T.value?($.value++,h.value=!1):$.value--}).catch(b=>{console.log(b)})},p=()=>{Qe({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(b=>{h.value=!h.value,h.value&&T.value&&($.value--,T.value=!1)}).catch(b=>{console.log(b)})},C=b=>{w.value=b,b?setTimeout(()=>{var A;(A=k.value)==null||A.focus()},10):(r.value=!1,U.value="",i("reset"))},D=()=>{r.value=!0,Xe({comment_id:m.comment.id,at_user_id:m.atUserid,content:U.value}).then(b=>{C(!1),window.$message.success("评论成功"),i("reload")}).catch(b=>{r.value=!1})};return q({switchReply:C}),(b,A)=>{const s=H,g=xt,F=le,z=It;return o(),_("div",hs,[d("div",fs,[d("span",gs,P(a(pe)(b.comment.created_on)),1),d("div",ys,[a(v).state.userLogined?u("",!0):(o(),_("div",ks,[t(s,{size:"medium"},{default:n(()=>[t(a(me))]),_:1}),d("span",ws,P($.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:B(O,["stop"])},[t(s,{size:"medium"},{default:n(()=>[T.value?u("",!0):(o(),R(a(me),{key:0})),T.value?(o(),R(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",$s,P($.value>0?$.value:"赞"),1)],8,bs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",Cs,[t(s,{size:"medium"},{default:n(()=>[t(a(ve))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:B(p,["stop"])},[t(s,{size:"medium"},{default:n(()=>[h.value?u("",!0):(o(),R(a(ve),{key:0})),h.value?(o(),R(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,xs)):u("",!0),a(v).state.userLogined&&!w.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:A[0]||(A[0]=L=>C(!0))}," 回复 ")):u("",!0),a(v).state.userLogined&&w.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:A[1]||(A[1]=L=>C(!1))}," 取消 ")):u("",!0)])]),w.value?(o(),_("div",Is,[t(z,null,{default:n(()=>[t(g,{ref_key:"inputInstRef",ref:k,size:"small",placeholder:m.atUsername?"@"+m.atUsername:"请输入回复内容..",maxlength:a(S),value:U.value,"onUpdate:value":A[2]||(A[2]=L=>U.value=L),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(F,{type:"primary",size:"small",ghost:"",loading:r.value,onClick:D},{default:n(()=>[I(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ts=ae(Ps,[["__scopeId","data-v-f9af7a93"]]),zs={class:"comment-item"},Rs={class:"nickname-wrap"},Us={class:"username-wrap"},Ss={class:"opt-wrap"},Ls={class:"timestamp"},Os=["innerHTML"],Ds={class:"reply-wrap"},As=ee({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(E,{emit:q}){const i=E,m=ne(),v=Ee(),k=c(0),w=c(""),U=c(),r=oe(()=>{let p=Object.assign({texts:[],imgs:[]},i.comment);return p.contents.map(C=>{(+C.type==1||+C.type==2)&&p.texts.push(C),+C.type==3&&p.imgs.push(C)}),p}),S=(p,C)=>{let D=p.target;if(D.dataset.detail){const b=D.dataset.detail.split(":");b.length===2&&(m.commit("refresh"),b[0]==="tag"?window.$message.warning("评论内的无效话题"):v.push({name:"user",query:{s:b[1]}}))}},T=p=>{var C,D;k.value=p.user_id,w.value=((C=p.user)==null?void 0:C.username)||"",(D=U.value)==null||D.switchReply(!0)},h=()=>{q("reload")},$=()=>{k.value=0,w.value=""},O=()=>{Ze({id:r.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{h()},50)}).catch(p=>{})};return(p,C)=>{const D=ye,b=ge("router-link"),A=H,s=le,g=Oe,F=Me,z=Ts,L=vs,J=De;return o(),_("div",zs,[t(J,{"content-indented":""},Ve({avatar:n(()=>[t(D,{round:"",size:30,src:r.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Rs,[t(b,{onClick:C[0]||(C[0]=B(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:r.value.user.username}}},{default:n(()=>[I(P(r.value.user.nickname),1)]),_:1},8,["to"])]),d("span",Us," @"+P(r.value.user.username),1)]),"header-extra":n(()=>[d("div",Ss,[d("span",Ls,P(r.value.ip_loc),1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===r.value.user.id?(o(),R(g,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:O},{trigger:n(()=>[t(s,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(A,null,{default:n(()=>[t(a(Ue))]),_:1})]),_:1})]),default:n(()=>[I(" 是否确认删除? ")]),_:1})):u("",!0)])]),footer:n(()=>[r.value.imgs.length>0?(o(),R(F,{key:0,imgs:r.value.imgs},null,8,["imgs"])):u("",!0),t(z,{ref_key:"replyComposeRef",ref:U,comment:r.value,"at-userid":k.value,"at-username":w.value,onReload:h,onReset:$},null,8,["comment","at-userid","at-username"]),d("div",Ds,[(o(!0),_(re,null,_e(r.value.replies,j=>(o(),R(L,{key:j.id,reply:j,"tweet-id":r.value.post_id,onFocusReply:T,onReload:h},null,8,["reply","tweet-id"]))),128))])]),_:2},[r.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(re,null,_e(r.value.texts,j=>(o(),_("span",{key:j.id,class:"comment-text",onClick:C[1]||(C[1]=B(V=>S(V,r.value.id),["stop"])),innerHTML:a(ke)(j.content).content},null,8,Os))),128))]),key:"0"}:void 0]),1024)])}}});const Ms=ae(As,[["__scopeId","data-v-36dac8c8"]]),Es=E=>(Te("data-v-d9073453"),E=E(),ze(),E),qs={key:0,class:"compose-wrap"},Ns={class:"compose-line"},Bs={class:"compose-user"},js={class:"compose-line compose-options"},Fs={class:"attachment"},Hs={class:"submit-wrap"},Vs={class:"attachment-list-wrap"},Ys={key:1,class:"compose-wrap"},Js=Es(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Ks={key:0,class:"login-only-wrap"},Ws={key:1,class:"login-wrap"},Gs=ee({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const i=E,m=ne(),v=c([]),k=c(!1),w=c(!1),U=c(!1),r=c(""),S=c(),T=c("public/image"),h=c([]),$=c([]),O=c("true".toLowerCase()==="true"),p=+"300",C="/v1/attachment",D=oe(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),b=Kt.debounce(f=>{et({k:f}).then(y=>{let x=[];y.suggest.map(e=>{x.push({label:e,value:e})}),v.value=x,w.value=!1}).catch(y=>{w.value=!1})},200),A=(f,y)=>{w.value||(w.value=!0,y==="@"&&b(f))},s=f=>{f.length>p?r.value=f.substring(0,p):r.value=f},g=f=>{T.value=f},F=f=>{for(let l=0;l30&&(f[l].name=x.substring(0,18)+"..."+x.substring(x.length-9)+"."+e)}h.value=f},z=async f=>{var y,x;return T.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((y=f.file.file)==null?void 0:y.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):T.value==="image"&&((x=f.file.file)==null?void 0:x.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},L=({file:f,event:y})=>{var x;try{let e=JSON.parse((x=y.target)==null?void 0:x.response);e.code===0&&T.value==="public/image"&&$.value.push({id:f.id,content:e.data.content})}catch{window.$message.error("上传失败")}},J=({file:f,event:y})=>{var x;try{let e=JSON.parse((x=y.target)==null?void 0:x.response);if(e.code!==0){let l=e.msg||"上传失败";e.details&&e.details.length>0&&e.details.map(M=>{l+=":"+M}),window.$message.error(l)}}catch{window.$message.error("上传失败")}},j=({file:f})=>{let y=$.value.findIndex(x=>x.id===f.id);y>-1&&$.value.splice(y,1)},V=()=>{k.value=!0},Q=()=>{var f;k.value=!1,(f=S.value)==null||f.clear(),h.value=[],r.value="",$.value=[]},K=()=>{if(r.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=ke(r.value);const y=[];let x=100;y.push({content:r.value,type:2,sort:x}),$.value.map(e=>{x++,y.push({content:e.content,type:3,sort:x})}),U.value=!0,tt({contents:y,post_id:i.postId,users:Array.from(new Set(f))}).then(e=>{window.$message.success("发布成功"),U.value=!1,q("post-success"),Q()}).catch(e=>{U.value=!1})},Y=f=>{m.commit("triggerAuth",!0),m.commit("triggerAuthKey",f)};return(f,y)=>{const x=ye,e=Pt,l=H,M=le,X=Tt,te=zt,he=Rt,fe=Ut,W=St;return o(),_("div",null,[a(m).state.userInfo.id>0?(o(),_("div",qs,[d("div",Ns,[d("div",Bs,[t(x,{round:"",size:30,src:a(m).state.userInfo.avatar},null,8,["src"])]),t(e,{type:"textarea",size:"large",autosize:"",bordered:!1,options:v.value,prefix:["@"],loading:w.value,value:r.value,disabled:i.lock===1,"onUpdate:value":s,onSearch:A,onFocus:V,placeholder:i.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),k.value?(o(),R(W,{key:0,ref_key:"uploadRef",ref:S,abstract:"","list-type":"image",multiple:!0,max:9,action:C,headers:{Authorization:D.value},data:{type:T.value},"file-list":h.value,onBeforeUpload:z,onFinish:L,onError:J,onRemove:j,"onUpdate:fileList":F},{default:n(()=>[d("div",js,[d("div",Fs,[t(X,{abstract:""},{default:n(({handleClick:Z})=>[t(M,{disabled:h.value.length>0&&T.value==="public/video"||h.value.length===9,onClick:()=>{g("public/image"),Z()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(l,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(pt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(he,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(te,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:r.value.length/a(p)*100},null,8,["percentage"])]),default:n(()=>[I(" "+P(r.value.length)+" / "+P(a(p)),1)]),_:1})]),d("div",Hs,[t(M,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:Q},{default:n(()=>[I(" 取消 ")]),_:1}),t(M,{loading:U.value,onClick:K,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[I(" 发布 ")]),_:1},8,["loading"])])]),d("div",Vs,[t(fe)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",Ys,[Js,O.value?u("",!0):(o(),_("div",Ks,[t(M,{strong:"",secondary:"",round:"",type:"primary",onClick:y[0]||(y[0]=Z=>Y("signin"))},{default:n(()=>[I(" 登录 ")]),_:1})])),O.value?(o(),_("div",Ws,[t(M,{strong:"",secondary:"",round:"",type:"primary",onClick:y[1]||(y[1]=Z=>Y("signin"))},{default:n(()=>[I(" 登录 ")]),_:1}),t(M,{strong:"",secondary:"",round:"",type:"info",onClick:y[2]||(y[2]=Z=>Y("signup"))},{default:n(()=>[I(" 注册 ")]),_:1})])):u("",!0)]))])}}});const Qs=ae(Gs,[["__scopeId","data-v-d9073453"]]),Xs={class:"username-wrap"},Zs={class:"options"},eo={key:0},to=["innerHTML"],so={class:"timestamp"},oo={key:0},no={key:1},ao={class:"opts-wrap"},lo=["onClick"],io={class:"opt-item"},uo=["onClick"],co=["onClick"],ro=ee({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const i=E,m="true".toLowerCase()==="true",v=ne(),k=Ee(),w=c(!1),U=c(!1),r=c(!1),S=c(!1),T=c(!1),h=c(!1),$=c(!1),O=c(!1),p=c(G.PUBLIC),C=c(!1),D=c({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),b=e=>{D.value=e,C.value=!0},A=()=>{C.value=!1},s=oe({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},i.post);return e.contents.map(l=>{(+l.type==1||+l.type==2)&&e.texts.push(l),+l.type==3&&e.imgs.push(l),+l.type==4&&e.videos.push(l),+l.type==6&&e.links.push(l),+l.type==7&&e.attachments.push(l),+l.type==8&&e.charge_attachments.push(l)}),e},set:e=>{i.post.upvote_count=e.upvote_count,i.post.comment_count=e.comment_count,i.post.collection_count=e.collection_count,i.post.is_essence=e.is_essence}}),g=e=>()=>$e(H,null,{default:()=>$e(e)}),F=oe(()=>{var M;let e=[];if(!v.state.userInfo.is_admin&&v.state.userInfo.id!=i.post.user.id)return e.push({label:"私信",key:"whisper",icon:g(kt)}),e;e.push({label:"删除",key:"delete",icon:g(wt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:g(bt)}):e.push({label:"解锁",key:"unlock",icon:g($t)}),v.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:g(xe)}):e.push({label:"取消置顶",key:"unstick",icon:g(xe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:g(Ie)}):e.push({label:"取消亮点",key:"unhighlight",icon:g(Ie)});let l;return s.value.visibility===G.PUBLIC?l={label:"公开",key:"vpublic",icon:g(ie),children:[{label:"私密",key:"vprivate",icon:g(ue)},{label:"关注可见",key:"vfollowing",icon:g(ce)}]}:s.value.visibility===G.PRIVATE?l={label:"私密",key:"vprivate",icon:g(ue),children:[{label:"公开",key:"vpublic",icon:g(ie)},{label:"关注可见",key:"vfollowing",icon:g(ce)}]}:m&&s.value.visibility===G.FRIEND?l={label:"好友可见",key:"vfriend",icon:g(Pe),children:[{label:"公开",key:"vpublic",icon:g(ie)},{label:"私密",key:"vprivate",icon:g(ue)},{label:"关注可见",key:"vfollowing",icon:g(ce)}]}:l={label:"关注可见",key:"vfollowing",icon:g(ce),children:[{label:"公开",key:"vpublic",icon:g(ie)},{label:"私密",key:"vprivate",icon:g(ue)}]},m&&s.value.visibility!==G.FRIEND&&((M=l.children)==null||M.push({label:"好友可见",key:"vfriend",icon:g(Pe)})),e.push(l),e}),z=e=>{k.push({name:"post",query:{id:e}})},L=(e,l)=>{if(e.target.dataset.detail){const M=e.target.dataset.detail.split(":");if(M.length===2){v.commit("refresh"),M[0]==="tag"?k.push({name:"home",query:{q:M[1],t:"tag"}}):k.push({name:"user",query:{s:M[1]}});return}}z(l)},J=e=>{switch(e){case"whisper":b(i.post.user);break;case"delete":r.value=!0;break;case"lock":case"unlock":S.value=!0;break;case"stick":case"unstick":T.value=!0;break;case"highlight":case"unhighlight":h.value=!0;break;case"vpublic":p.value=0,$.value=!0;break;case"vprivate":p.value=1,$.value=!0;break;case"vfriend":p.value=2,$.value=!0;break;case"vfollowing":p.value=3,$.value=!0;break}},j=()=>{nt({id:s.value.id}).then(e=>{window.$message.success("删除成功"),k.replace("/"),setTimeout(()=>{v.commit("refresh")},50)}).catch(e=>{O.value=!1})},V=()=>{at({id:s.value.id}).then(e=>{q("reload"),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{O.value=!1})},Q=()=>{lt({id:s.value.id}).then(e=>{q("reload"),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{O.value=!1})},K=()=>{it({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{O.value=!1})},Y=()=>{let e=p.value;e==3&&(e=0),ut({id:s.value.id,visibility:e}).then(l=>{q("reload"),window.$message.success("修改可见性成功")}).catch(l=>{O.value=!1})},f=()=>{ct({id:s.value.id}).then(e=>{w.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},y=()=>{rt({id:s.value.id}).then(e=>{U.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},x=()=>{Gt(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Re(()=>{v.state.userInfo.id>0&&(st({id:s.value.id}).then(e=>{w.value=e.status}).catch(e=>{console.log(e)}),ot({id:s.value.id}).then(e=>{U.value=e.status}).catch(e=>{console.log(e)}))}),(e,l)=>{const M=ye,X=ge("router-link"),te=Lt,he=le,fe=Ot,W=Dt,Z=Wt,we=Ft,qe=Me,Ne=Ht,Be=Vt,be=At,je=Ae,Fe=De;return o(),_("div",{class:"detail-item",onClick:l[7]||(l[7]=N=>z(s.value.id))},[t(Fe,null,{avatar:n(()=>[t(M,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(X,{onClick:l[0]||(l[0]=B(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[I(P(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",Xs," @"+P(s.value.user.username),1),s.value.is_top?(o(),R(te,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[I(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(G).PRIVATE?(o(),R(te,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[I(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(G).FRIEND?(o(),R(te,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[I(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Zs,[t(fe,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:J},{default:n(()=>[t(he,{quaternary:"",circle:""},{icon:n(()=>[t(a(H),null,{default:n(()=>[t(a(dt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(W,{show:r.value,"onUpdate:show":l[1]||(l[1]=N=>r.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:j},null,8,["show"]),t(W,{show:S.value,"onUpdate:show":l[2]||(l[2]=N=>S.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:V},null,8,["show","content"]),t(W,{show:T.value,"onUpdate:show":l[3]||(l[3]=N=>T.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Q},null,8,["show","content"]),t(W,{show:h.value,"onUpdate:show":l[4]||(l[4]=N=>h.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show","content"]),t(W,{show:$.value,"onUpdate:show":l[5]||(l[5]=N=>$.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Y},null,8,["show","content"]),t(Z,{show:C.value,user:D.value,onSuccess:A},null,8,["show","user"])]),footer:n(()=>[t(we,{attachments:s.value.attachments},null,8,["attachments"]),t(we,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(qe,{imgs:s.value.imgs},null,8,["imgs"]),t(Ne,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Be,{links:s.value.links},null,8,["links"]),d("div",so,[I(" 发布于 "+P(a(pe)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",oo,[t(be,{vertical:""}),I(" "+P(s.value.ip_loc),1)])):u("",!0),!a(v).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",no,[t(be,{vertical:""}),I(" 最后回复 "+P(a(pe)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",ao,[t(je,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:B(f,["stop"])},[t(a(H),{size:"20",class:"opt-item-icon"},{default:n(()=>[w.value?u("",!0):(o(),R(a(mt),{key:0})),w.value?(o(),R(a(vt),{key:1,color:"red"})):u("",!0)]),_:1}),I(" "+P(s.value.upvote_count),1)],8,lo),d("div",io,[t(a(H),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(ht))]),_:1}),I(" "+P(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:B(y,["stop"])},[t(a(H),{size:"20",class:"opt-item-icon"},{default:n(()=>[U.value?u("",!0):(o(),R(a(ft),{key:0})),U.value?(o(),R(a(gt),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),I(" "+P(s.value.collection_count),1)],8,uo),d("div",{class:"opt-item hover",onClick:B(x,["stop"])},[t(a(H),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(yt))]),_:1}),I(" "+P(s.value.share_count),1)],8,co)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",eo,[(o(!0),_(re,null,_e(s.value.texts,N=>(o(),_("span",{key:N.id,class:"post-text",onClick:l[6]||(l[6]=B(He=>L(He,s.value.id),["stop"])),innerHTML:a(ke)(N.content).content},null,8,to))),128))])):u("",!0)]),_:1})])}}});const _o=E=>(Te("data-v-0d01659f"),E=E(),ze(),E),po={key:0,class:"detail-wrap"},mo={key:1,class:"empty-wrap"},vo={key:0,class:"comment-opts-wrap"},ho=_o(()=>d("span",{class:"comment-title-item"},"评论",-1)),fo={key:2},go={key:0,class:"skeleton-wrap"},yo={key:1},ko={key:0,class:"empty-wrap"},wo={key:0,class:"load-more-spinner"},bo={key:1,class:"load-more-spinner"},$o={key:2,class:"load-more-spinner"},Co={key:3,class:"load-more-spinner"},se=20,xo=ee({__name:"Post",setup(E){const q=Yt(),i=c({}),m=c(!1),v=c(!1),k=c([]),w=oe(()=>+q.query.id),U=c("default"),r=c(!0);let S={loading(){},loaded(){},complete(){},error(){}};const T=z=>{U.value=z,z==="default"&&(r.value=!0),g(S)},h=()=>{i.value={id:0},m.value=!0,_t({id:w.value}).then(z=>{m.value=!1,i.value=z,g(S)}).catch(z=>{m.value=!1})};let $=1;const O=c(!1),p=c([]),C=z=>{O.value||Ce({id:i.value.id,sort_strategy:"default",page:$,page_size:se}).then(L=>{z!==null&&(S=z),L.list.length0&&($===1?p.value=L.list:p.value.push(...L.list),k.value=p.value),S.loaded(),v.value=!1}).catch(L=>{v.value=!1,S.error()})};let D=1,b=c(!1);const A=c([]),s=z=>{b.value||Ce({id:i.value.id,sort_strategy:"newest",page:D,page_size:se}).then(L=>{z!==null&&(S=z),L.list.length0&&(D===1?A.value=L.list:A.value.push(...L.list),k.value=A.value),S.loaded(),v.value=!1}).catch(L=>{v.value=!1,S.error()})},g=z=>{w.value<1||(k.value.length===0&&(v.value=!0),U.value==="default"?(k.value=p.value,C(z)):(k.value=A.value,s(z)),v.value=!1)},F=()=>{$=1,O.value=!1,p.value=[],D=1,b.value=!1,A.value=[],g(S)};return Re(()=>{h()}),Ye(w,()=>{w.value>0&&q.name==="post"&&h()}),(z,L)=>{const J=Qt,j=ro,V=Et,Q=qt,K=Nt,Y=Bt,f=jt,y=Qs,x=Jt,e=Ms,l=Ae,M=Mt;return o(),_("div",null,[t(J,{title:"泡泡详情",back:!0}),t(M,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(K,null,{default:n(()=>[t(Q,{show:m.value},{default:n(()=>[i.value.id>1?(o(),_("div",po,[t(j,{post:i.value,onReload:h},null,8,["post"])])):(o(),_("div",mo,[t(V,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),i.value.id>0?(o(),_("div",vo,[t(f,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":T},{prefix:n(()=>[ho]),default:n(()=>[t(Y,{name:"default",tab:"默认"}),t(Y,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),i.value.id>0?(o(),R(K,{key:1},{default:n(()=>[t(y,{lock:i.value.is_lock,"post-id":i.value.id,onPostSuccess:F},null,8,["lock","post-id"])]),_:1})):u("",!0),i.value.id>0?(o(),_("div",fo,[v.value?(o(),_("div",go,[t(x,{num:5})])):(o(),_("div",yo,[k.value.length===0?(o(),_("div",ko,[t(V,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(re,null,_e(k.value,X=>(o(),R(K,{key:X.id},{default:n(()=>[t(e,{comment:X,onReload:F},null,8,["comment"])]),_:2},1024))),128))]))])):u("",!0),k.value.length>=se?(o(),R(l,{key:3,justify:"center"},{default:n(()=>[t(a(Xt),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:g},{spinner:n(()=>[r.value&&O.value?(o(),_("span",wo)):u("",!0),!r.value&&a(b)?(o(),_("span",bo)):u("",!0),r.value&&!O.value?(o(),_("span",$o,"加载评论")):u("",!0),!r.value&&!a(b)?(o(),_("span",Co,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const ln=ae(xo,[["__scopeId","data-v-0d01659f"]]);export{ln as default}; diff --git a/web/dist/assets/Profile-25637d74.js b/web/dist/assets/Profile-6d9e62f3.js similarity index 95% rename from web/dist/assets/Profile-25637d74.js rename to web/dist/assets/Profile-6d9e62f3.js index c38e953d..b18fcb33 100644 --- a/web/dist/assets/Profile-25637d74.js +++ b/web/dist/assets/Profile-6d9e62f3.js @@ -1 +1 @@ -import{_ as de}from"./whisper-31e5b9ad.js";import{_ as ge,a as he}from"./post-item.vue_vue_type_style_index_0_lang-00295cef.js";import{_ as we}from"./post-skeleton-26b3006b.js";import{_ as ke}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{d as ye,H as s,b as be,E as Pe,r as Ie,f,k as u,bf as i,q as w,w as p,Y as y,e as r,j as c,x as d,A as $,y as Q,F as X,u as Z}from"./@vue-a481fc63.js";import{u as Te}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as b,_ as ze}from"./index-cb280048.js";import{b as qe}from"./formatTime-4210fcd1.js";import{W as xe}from"./v3-infinite-loading-2c58ec2f.js";import{F as Se,a as $e,o as Ce,M as Le,f as Be,g as Ne,I as Ve,k as De,G as Fe}from"./naive-ui-d8de3dda.js";import"./content-64ba0596.js";import"./@vicons-7a4ef312.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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-2ab8298d.js";const Ue={class:"profile-baseinfo"},We={class:"avatar"},je={class:"base-info"},Ee={class:"username"},He={class:"userinfo"},Re={class:"info-item"},Ae={class:"info-item"},Ge={class:"userinfo"},Ye={class:"info-item"},Je={class:"info-item"},Ke={key:0,class:"skeleton-wrap"},Oe={key:1},Qe={key:0,class:"empty-wrap"},Xe={key:1},Ze={key:2},ea={class:"load-more-wrap"},aa={class:"load-more-spinner"},ta=ye({__name:"Profile",setup(sa){const o=Te(),g=Me(),n=s(!1),_=s(!1),a=s([]),C=s([]),L=s([]),B=s([]),N=s([]),V=s([]),P=s("post"),D=s(+g.query.p||1),F=s(1),U=s(1),W=s(1),j=s(1),t=s(+g.query.p||1),v=s(20),l=s(0),E=s(0),H=s(0),R=s(0),A=s(0),G=s(0),I=s(!1),Y=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),J=e=>{Y.value=e,I.value=!0},ee=()=>{I.value=!1},T=()=>{switch(P.value){case"post":M();break;case"comment":z();break;case"highlight":q();break;case"media":x();break;case"star":S();break}},M=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"post",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),C.value=a.value,E.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},z=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"comment",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),L.value=a.value,H.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},q=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"highlight",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),B.value=a.value,R.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},x=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"media",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),N.value=a.value,A.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},S=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"star",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),V.value=a.value,G.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},ae=e=>{switch(P.value=e,P.value){case"post":a.value=C.value,t.value=D.value,l.value=E.value,M();break;case"comment":a.value=L.value,t.value=F.value,l.value=H.value,z();break;case"highlight":a.value=B.value,t.value=U.value,l.value=R.value,q();break;case"media":a.value=N.value,t.value=W.value,l.value=A.value,x();break;case"star":a.value=V.value,t.value=j.value,l.value=G.value,S();break}},te=()=>{switch(P.value){case"post":D.value=t.value,M();break;case"comment":F.value=t.value,z();break;case"highlight":U.value=t.value,q();break;case"media":W.value=t.value,x();break;case"star":j.value=t.value,S();break}},se=()=>{t.value{T()}),Pe(()=>({path:g.path,query:g.query,refresh:o.state.refresh}),(e,m)=>{if(e.refresh!==m.refresh){t.value=+g.query.p||1,setTimeout(()=>{T()},0);return}m.path!=="/post"&&e.path==="/profile"&&(t.value=+g.query.p||1,setTimeout(()=>{T()},0))}),(e,m)=>{const oe=ke,le=Ce,ne=Le,K=Ie("router-link"),k=Be,ue=Ne,ie=we,re=Ve,ce=ge,O=Fe,ve=he,_e=de,me=Se,pe=De,fe=$e;return r(),f("div",null,[u(oe,{title:"主页"}),i(o).state.userInfo.id>0?(r(),w(me,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:p(()=>[c("div",Ue,[c("div",We,[u(le,{size:72,src:i(o).state.userInfo.avatar},null,8,["src"])]),c("div",je,[c("div",Ee,[c("strong",null,d(i(o).state.userInfo.nickname),1),c("span",null," @"+d(i(o).state.userInfo.username),1),i(o).state.userInfo.is_admin?(r(),w(ne,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:p(()=>[$(" 管理员 ")]),_:1})):y("",!0)]),c("div",He,[c("span",Re,"UID. "+d(i(o).state.userInfo.id),1),c("span",Ae,d(i(qe)(i(o).state.userInfo.created_on))+" 加入",1)]),c("div",Ge,[c("span",Ye,[u(K,{onClick:m[0]||(m[0]=Q(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:i(o).state.userInfo.username,n:i(o).state.userInfo.nickname,t:"follows"}}},{default:p(()=>[$(" 关注  "+d(i(o).state.userInfo.follows),1)]),_:1},8,["to"])]),c("span",Je,[u(K,{onClick:m[1]||(m[1]=Q(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:i(o).state.userInfo.username,n:i(o).state.userInfo.nickname,t:"followings"}}},{default:p(()=>[$(" 粉丝  "+d(i(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),u(ue,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":ae},{default:p(()=>[u(k,{name:"post",tab:"泡泡"}),u(k,{name:"comment",tab:"评论"}),u(k,{name:"highlight",tab:"亮点"}),u(k,{name:"media",tab:"图文"}),u(k,{name:"star",tab:"喜欢"})]),_:1}),n.value&&a.value.length===0?(r(),f("div",Ke,[u(ie,{num:v.value},null,8,["num"])])):(r(),f("div",Oe,[a.value.length===0?(r(),f("div",Qe,[u(re,{size:"large",description:"暂无数据"})])):y("",!0),i(o).state.desktopModelShow?(r(),f("div",Xe,[(r(!0),f(X,null,Z(a.value,h=>(r(),w(O,{key:h.id},{default:p(()=>[u(ce,{post:h,onSendWhisper:J},null,8,["post"])]),_:2},1024))),128))])):(r(),f("div",Ze,[(r(!0),f(X,null,Z(a.value,h=>(r(),w(O,{key:h.id},{default:p(()=>[u(ve,{post:h,onSendWhisper:J},null,8,["post"])]),_:2},1024))),128))]))])),u(_e,{show:I.value,user:Y.value,onSuccess:ee},null,8,["show","user"])]),_:1})):y("",!0),l.value>0?(r(),w(fe,{key:1,justify:"center"},{default:p(()=>[u(i(xe),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:m[2]||(m[2]=h=>se())},{spinner:p(()=>[c("div",ea,[_.value?y("",!0):(r(),w(pe,{key:0,size:14})),c("span",aa,d(_.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const Da=ze(ta,[["__scopeId","data-v-52df1da9"]]);export{Da as default}; +import{_ as de}from"./whisper-f9793dd1.js";import{_ as ge,a as he}from"./post-item.vue_vue_type_style_index_0_lang-899852f8.js";import{_ as we}from"./post-skeleton-54a835d7.js";import{_ as ke}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{d as ye,H as s,b as be,E as Pe,r as Ie,f,k as u,bf as i,q as w,w as p,Y as y,e as r,j as c,x as d,A as $,y as Q,F as X,u as Z}from"./@vue-a481fc63.js";import{u as Te}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as b,_ as ze}from"./index-8d220080.js";import{b as qe}from"./formatTime-4210fcd1.js";import{W as xe}from"./v3-infinite-loading-2c58ec2f.js";import{F as Se,a as $e,o as Ce,M as Le,f as Be,g as Ne,I as Ve,k as De,G as Fe}from"./naive-ui-d8de3dda.js";import"./content-e3389a3a.js";import"./@vicons-7a4ef312.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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-2ab8298d.js";const Ue={class:"profile-baseinfo"},We={class:"avatar"},je={class:"base-info"},Ee={class:"username"},He={class:"userinfo"},Re={class:"info-item"},Ae={class:"info-item"},Ge={class:"userinfo"},Ye={class:"info-item"},Je={class:"info-item"},Ke={key:0,class:"skeleton-wrap"},Oe={key:1},Qe={key:0,class:"empty-wrap"},Xe={key:1},Ze={key:2},ea={class:"load-more-wrap"},aa={class:"load-more-spinner"},ta=ye({__name:"Profile",setup(sa){const o=Te(),g=Me(),n=s(!1),_=s(!1),a=s([]),C=s([]),L=s([]),B=s([]),N=s([]),V=s([]),P=s("post"),D=s(+g.query.p||1),F=s(1),U=s(1),W=s(1),j=s(1),t=s(+g.query.p||1),v=s(20),l=s(0),E=s(0),H=s(0),R=s(0),A=s(0),G=s(0),I=s(!1),Y=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),J=e=>{Y.value=e,I.value=!0},ee=()=>{I.value=!1},T=()=>{switch(P.value){case"post":M();break;case"comment":z();break;case"highlight":q();break;case"media":x();break;case"star":S();break}},M=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"post",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),C.value=a.value,E.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},z=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"comment",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),L.value=a.value,H.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},q=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"highlight",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),B.value=a.value,R.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},x=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"media",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),N.value=a.value,A.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},S=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"star",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),V.value=a.value,G.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},ae=e=>{switch(P.value=e,P.value){case"post":a.value=C.value,t.value=D.value,l.value=E.value,M();break;case"comment":a.value=L.value,t.value=F.value,l.value=H.value,z();break;case"highlight":a.value=B.value,t.value=U.value,l.value=R.value,q();break;case"media":a.value=N.value,t.value=W.value,l.value=A.value,x();break;case"star":a.value=V.value,t.value=j.value,l.value=G.value,S();break}},te=()=>{switch(P.value){case"post":D.value=t.value,M();break;case"comment":F.value=t.value,z();break;case"highlight":U.value=t.value,q();break;case"media":W.value=t.value,x();break;case"star":j.value=t.value,S();break}},se=()=>{t.value{T()}),Pe(()=>({path:g.path,query:g.query,refresh:o.state.refresh}),(e,m)=>{if(e.refresh!==m.refresh){t.value=+g.query.p||1,setTimeout(()=>{T()},0);return}m.path!=="/post"&&e.path==="/profile"&&(t.value=+g.query.p||1,setTimeout(()=>{T()},0))}),(e,m)=>{const oe=ke,le=Ce,ne=Le,K=Ie("router-link"),k=Be,ue=Ne,ie=we,re=Ve,ce=ge,O=Fe,ve=he,_e=de,me=Se,pe=De,fe=$e;return r(),f("div",null,[u(oe,{title:"主页"}),i(o).state.userInfo.id>0?(r(),w(me,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:p(()=>[c("div",Ue,[c("div",We,[u(le,{size:72,src:i(o).state.userInfo.avatar},null,8,["src"])]),c("div",je,[c("div",Ee,[c("strong",null,d(i(o).state.userInfo.nickname),1),c("span",null," @"+d(i(o).state.userInfo.username),1),i(o).state.userInfo.is_admin?(r(),w(ne,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:p(()=>[$(" 管理员 ")]),_:1})):y("",!0)]),c("div",He,[c("span",Re,"UID. "+d(i(o).state.userInfo.id),1),c("span",Ae,d(i(qe)(i(o).state.userInfo.created_on))+" 加入",1)]),c("div",Ge,[c("span",Ye,[u(K,{onClick:m[0]||(m[0]=Q(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:i(o).state.userInfo.username,n:i(o).state.userInfo.nickname,t:"follows"}}},{default:p(()=>[$(" 关注  "+d(i(o).state.userInfo.follows),1)]),_:1},8,["to"])]),c("span",Je,[u(K,{onClick:m[1]||(m[1]=Q(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:i(o).state.userInfo.username,n:i(o).state.userInfo.nickname,t:"followings"}}},{default:p(()=>[$(" 粉丝  "+d(i(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),u(ue,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":ae},{default:p(()=>[u(k,{name:"post",tab:"泡泡"}),u(k,{name:"comment",tab:"评论"}),u(k,{name:"highlight",tab:"亮点"}),u(k,{name:"media",tab:"图文"}),u(k,{name:"star",tab:"喜欢"})]),_:1}),n.value&&a.value.length===0?(r(),f("div",Ke,[u(ie,{num:v.value},null,8,["num"])])):(r(),f("div",Oe,[a.value.length===0?(r(),f("div",Qe,[u(re,{size:"large",description:"暂无数据"})])):y("",!0),i(o).state.desktopModelShow?(r(),f("div",Xe,[(r(!0),f(X,null,Z(a.value,h=>(r(),w(O,{key:h.id},{default:p(()=>[u(ce,{post:h,onSendWhisper:J},null,8,["post"])]),_:2},1024))),128))])):(r(),f("div",Ze,[(r(!0),f(X,null,Z(a.value,h=>(r(),w(O,{key:h.id},{default:p(()=>[u(ve,{post:h,onSendWhisper:J},null,8,["post"])]),_:2},1024))),128))]))])),u(_e,{show:I.value,user:Y.value,onSuccess:ee},null,8,["show","user"])]),_:1})):y("",!0),l.value>0?(r(),w(fe,{key:1,justify:"center"},{default:p(()=>[u(i(xe),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:m[2]||(m[2]=h=>se())},{spinner:p(()=>[c("div",ea,[_.value?y("",!0):(r(),w(pe,{key:0,size:14})),c("span",aa,d(_.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const Da=ze(ta,[["__scopeId","data-v-52df1da9"]]);export{Da as default}; diff --git a/web/dist/assets/Setting-ff8723d9.js b/web/dist/assets/Setting-42f80d67.js similarity index 97% rename from web/dist/assets/Setting-ff8723d9.js rename to web/dist/assets/Setting-42f80d67.js index bba51781..8cdbe551 100644 --- a/web/dist/assets/Setting-ff8723d9.js +++ b/web/dist/assets/Setting-42f80d67.js @@ -1 +1 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{d as ye,H as d,R as X,b as ke,f as g,k as t,w as s,q as b,Y as _,e as r,j as m,bf as u,A as c,x as R,O as be,D as Ce,Z as q,y as A,$ as Ie,a0 as $e}from"./@vue-a481fc63.js";import{u as Pe}from"./vuex-44de225f.js";import{X as Q,Y as Se,Z as Ue,$ as Re,a0 as qe,a1 as Ae,a2 as Be,_ as Ne}from"./index-cb280048.js";import{Y as ze}from"./@vicons-7a4ef312.js";import{h as Ke,o as xe,e as De,B as Fe,b as je,j as Oe,S as Te,$ as Ve,K as Ee,a0 as Le,a1 as Me,d as Ye}from"./naive-ui-d8de3dda.js";import"./vue-router-e5a2430e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const j=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),We={class:"base-line avatar"},Ze={class:"base-line"},Ge=j(()=>m("span",{class:"base-label"},"昵称",-1)),He={key:0},Je={class:"base-line"},Xe=j(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={key:0},et={key:1},tt=j(()=>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=j(()=>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(B){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),N=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),z=d(!1),K=d(!1),M=d(),Y=d(),C=d(!1),x=d(!1),S=d(!1),U=d(!1),I=d(60),y=d(!1),k=d(!1),W=d(),Z=d(),G=d(),H=d(),a=X({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=X({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return N.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):N.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&&N.value==="public/avatar"&&Se({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=H.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(x.value=!0,Ue({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,S.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=W.value)==null||e.validate(v=>{v||(z.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{z.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=>{z.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=Z.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{K.value=!1,f.code===20012&&T()}))})},O=()=>{Q().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},T=()=>{Q().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Ae({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&U.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Be({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{U.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,U.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&O(),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=Y.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),O(),T()}),(n,e)=>{const v=we,f=xe,p=De,D=Fe,h=je,ge=Oe,F=Ke,J=Te,w=Ve,he=Ee,V=Le,E=Me,L=Ye;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(D,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ze,[Ge,C.value?_("",!0):(r(),g("div",He,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:Y,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(ze))]),_:1})]),_:1})):_("",!0)]),m("div",Je,[Xe,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",Qe,[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(J,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:W,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(A(()=>{},["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:O},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:U.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&U.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:z.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(J,{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:Z,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(A(()=>{},["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:T},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),S.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>S.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),S.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:G,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(A(()=>{},["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(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:H,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(A(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>S.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 Ot=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Ot as default}; +import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{d as ye,H as d,R as X,b as ke,f as g,k as t,w as s,q as b,Y as _,e as r,j as m,bf as u,A as c,x as R,O as be,D as Ce,Z as q,y as A,$ as Ie,a0 as $e}from"./@vue-a481fc63.js";import{u as Pe}from"./vuex-44de225f.js";import{X as Q,Y as Se,Z as Ue,$ as Re,a0 as qe,a1 as Ae,a2 as Be,_ as Ne}from"./index-8d220080.js";import{Y as ze}from"./@vicons-7a4ef312.js";import{h as Ke,o as xe,e as De,B as Fe,b as je,j as Oe,S as Te,$ as Ve,K as Ee,a0 as Le,a1 as Me,d as Ye}from"./naive-ui-d8de3dda.js";import"./vue-router-e5a2430e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const j=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),We={class:"base-line avatar"},Ze={class:"base-line"},Ge=j(()=>m("span",{class:"base-label"},"昵称",-1)),He={key:0},Je={class:"base-line"},Xe=j(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={key:0},et={key:1},tt=j(()=>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=j(()=>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(B){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),N=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),z=d(!1),K=d(!1),M=d(),Y=d(),C=d(!1),x=d(!1),S=d(!1),U=d(!1),I=d(60),y=d(!1),k=d(!1),W=d(),Z=d(),G=d(),H=d(),a=X({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=X({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return N.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):N.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&&N.value==="public/avatar"&&Se({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=H.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(x.value=!0,Ue({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,S.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=W.value)==null||e.validate(v=>{v||(z.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{z.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=>{z.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=Z.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{K.value=!1,f.code===20012&&T()}))})},O=()=>{Q().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},T=()=>{Q().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Ae({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&U.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Be({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{U.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,U.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&O(),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=Y.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),O(),T()}),(n,e)=>{const v=we,f=xe,p=De,D=Fe,h=je,ge=Oe,F=Ke,J=Te,w=Ve,he=Ee,V=Le,E=Me,L=Ye;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(D,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ze,[Ge,C.value?_("",!0):(r(),g("div",He,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:Y,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(ze))]),_:1})]),_:1})):_("",!0)]),m("div",Je,[Xe,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",Qe,[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(J,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:W,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(A(()=>{},["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:O},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:U.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&U.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:z.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(J,{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:Z,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(A(()=>{},["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:T},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),S.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>S.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),S.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:G,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(A(()=>{},["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(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:H,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(A(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>S.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 Ot=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Ot as default}; diff --git a/web/dist/assets/Topic-36f0525d.js b/web/dist/assets/Topic-0e4d12d8.js similarity index 97% rename from web/dist/assets/Topic-36f0525d.js rename to web/dist/assets/Topic-0e4d12d8.js index 824175e7..3665d8c8 100644 --- a/web/dist/assets/Topic-36f0525d.js +++ b/web/dist/assets/Topic-0e4d12d8.js @@ -1 +1 @@ -import{z as $,A as I,B as M,C as O,_ as x}from"./index-cb280048.js";import{x as U}from"./@vicons-7a4ef312.js";import{d as F,H as i,c as A,b as q,r as j,e as c,f as _,k as n,w as s,q as b,A as B,x as f,Y as p,bf as h,E as D,al as H,F as Y,u as G}from"./@vue-a481fc63.js";import{o as J,M as C,j as K,e as P,O as Q,L as R,F as W,f as X,g as Z,a as ee,k as oe}from"./naive-ui-d8de3dda.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{u as ne}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=F({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=A(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":M({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return q(()=>{r.value=!1}),(e,o)=>{const w=j("router-link"),g=J,k=C,a=K,d=P,v=Q,u=R;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(u,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[B(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?p("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):p("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(U))]),_:1})]),_:1})]),_:1},8,["options"])])):p("",!0)]),_:1})])):p("",!0)}}});const _e=F({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,O({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return q(()=>{g()}),(a,d)=>{const v=te,u=X,L=C,V=Z,N=ie,S=ee,z=oe,E=W;return c(),_("div",null,[n(v,{title:"话题"}),n(E,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(V,{type:"line",animated:"","onUpdate:value":k},H({default:s(()=>[n(u,{name:"hot",tab:"热门"}),n(u,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(u,{key:0,name:"follow",tab:"关注"})):p("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(L,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[B(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(z,{show:l.value},{default:s(()=>[n(S,null,{default:s(()=>[(c(!0),_(Y,null,G(r.value,y=>(c(),b(N,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=x(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; +import{z as $,A as I,B as M,C as O,_ as x}from"./index-8d220080.js";import{x as U}from"./@vicons-7a4ef312.js";import{d as F,H as i,c as A,b as q,r as j,e as c,f as _,k as n,w as s,q as b,A as B,x as f,Y as p,bf as h,E as D,al as H,F as Y,u as G}from"./@vue-a481fc63.js";import{o as J,M as C,j as K,e as P,O as Q,L as R,F as W,f as X,g as Z,a as ee,k as oe}from"./naive-ui-d8de3dda.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{u as ne}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=F({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=A(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":M({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return q(()=>{r.value=!1}),(e,o)=>{const w=j("router-link"),g=J,k=C,a=K,d=P,v=Q,u=R;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(u,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[B(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?p("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):p("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(U))]),_:1})]),_:1})]),_:1},8,["options"])])):p("",!0)]),_:1})])):p("",!0)}}});const _e=F({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,O({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return q(()=>{g()}),(a,d)=>{const v=te,u=X,L=C,V=Z,N=ie,S=ee,z=oe,E=W;return c(),_("div",null,[n(v,{title:"话题"}),n(E,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(V,{type:"line",animated:"","onUpdate:value":k},H({default:s(()=>[n(u,{name:"hot",tab:"热门"}),n(u,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(u,{key:0,name:"follow",tab:"关注"})):p("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(L,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[B(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(z,{show:l.value},{default:s(()=>[n(S,null,{default:s(()=>[(c(!0),_(Y,null,G(r.value,y=>(c(),b(N,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=x(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; diff --git a/web/dist/assets/User-3da55cb6.js b/web/dist/assets/User-0e1e60bd.js similarity index 97% rename from web/dist/assets/User-3da55cb6.js rename to web/dist/assets/User-0e1e60bd.js index 19fe101a..132a97ff 100644 --- a/web/dist/assets/User-3da55cb6.js +++ b/web/dist/assets/User-0e1e60bd.js @@ -1 +1 @@ -import{_ as Re,a as He}from"./post-item.vue_vue_type_style_index_0_lang-00295cef.js";import{_ as Ne}from"./post-skeleton-26b3006b.js";import{_ as Ve}from"./whisper-31e5b9ad.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{d as ve,H as l,e as r,q as y,w as n,j as _,k as o,A as b,x as h,R as Ee,c as Ge,b as Ye,E as Je,r as Ke,f as g,Y as k,bf as m,y as ne,F as ue,u as ie,h as ce}from"./@vue-a481fc63.js";import{u as Qe}from"./vuex-44de225f.js";import{b as Xe}from"./vue-router-e5a2430e.js";import{D as Ze,_ as pe,E as ea,e as O,F as aa,G as sa,H as ta,I as la}from"./index-cb280048.js";import{R as oa,H as na,S as ua,b as ia,e as de,i as ca,T as ra,F as _a,a as va,j as re,o as pa,M as da,O as ma,k as fa,f as ga,g as ha,I as wa,G as ka}from"./naive-ui-d8de3dda.js";import{b as ya}from"./formatTime-4210fcd1.js";import{W as ba}from"./v3-infinite-loading-2c58ec2f.js";import{i as Pa,p as $a,y as _e,z as Ta,v as xa,D as za,G as Ua}from"./@vicons-7a4ef312.js";import"./content-64ba0596.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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-2ab8298d.js";const Fa={class:"whisper-wrap"},Ia={class:"whisper-line"},qa={class:"whisper-line send-wrap"},Ca=ve({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(ae,{emit:F}){const f=ae,p=l(""),P=l(!1),u=()=>{F("success")},v=()=>{P.value=!0,Ze({user_id:f.user.id,greetings:p.value}).then(a=>{window.$message.success("发送成功"),P.value=!1,p.value="",u()}).catch(a=>{P.value=!1})};return(a,c)=>{const x=oa,I=na,s=ua,q=ia,C=de,M=ca;return r(),y(M,{show:a.show,"onUpdate:show":u,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:n(()=>[_("div",Fa,[o(s,{"show-icon":!1},{default:n(()=>[b(" 发送添加朋友申请给: "),o(I,{style:{"max-width":"100%"}},{default:n(()=>[o(x,{type:"success"},{default:n(()=>[b(h(a.user.nickname)+"@"+h(a.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ia,[o(q,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:p.value,"onUpdate:value":c[0]||(c[0]=S=>p.value=S),maxlength:"120","show-count":""},null,8,["value"])]),_("div",qa,[o(C,{strong:"",secondary:"",type:"primary",loading:P.value,onClick:v},{default:n(()=>[b(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ma=pe(Ca,[["__scopeId","data-v-60be56a2"]]),Sa={key:0,class:"profile-baseinfo"},Wa={class:"avatar"},La={class:"base-info"},Oa={class:"username"},Aa={class:"userinfo"},Da={class:"info-item"},Ba={class:"info-item"},Ra={class:"userinfo"},Ha={class:"info-item"},Na={class:"info-item"},Va={key:0,class:"user-opts"},ja={key:0,class:"skeleton-wrap"},Ea={key:1},Ga={key:0,class:"empty-wrap"},Ya={key:1},Ja={key:2},Ka={class:"load-more-wrap"},Qa={class:"load-more-spinner"},Xa=ve({__name:"User",setup(ae){const F=ra(),f=Qe(),p=Xe(),P="true".toLowerCase()==="true",u=l(!1),v=l(!1),a=Ee({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),c=l(!1),x=l(!1),I=l(!1),s=l([]),q=l([]),C=l([]),M=l([]),S=l([]),D=l([]),$=l(p.query.s||""),t=l(+p.query.p||1),z=l("post"),B=l(+p.query.p||1),R=l(1),H=l(1),N=l(1),V=l(1),d=l(20),i=l(0),j=l(0),E=l(0),G=l(0),Y=l(0),J=l(0),se=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,x.value=!0},me=()=>{v.value=!1,s.value=[],q.value=[],C.value=[],M.value=[],S.value=[],D.value=[],z.value="post",t.value=1,B.value=1,R.value=1,H.value=1,N.value=1,V.value=1,i.value=0,j.value=0,E.value=0,G.value=0,Y.value=0,J.value=0},fe=()=>{switch(z.value){case"post":A();break;case"comment":K();break;case"highlight":Q();break;case"media":X();break;case"star":Z();break}},A=()=>{u.value=!0,O({username:$.value,style:"post",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),q.value=s.value,j.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},K=()=>{u.value=!0,O({username:$.value,style:"comment",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),C.value=s.value,E.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},Q=()=>{u.value=!0,O({username:$.value,style:"highlight",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),M.value=s.value,G.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},X=()=>{u.value=!0,O({username:$.value,style:"media",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),S.value=s.value,Y.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},Z=()=>{u.value=!0,O({username:$.value,style:"star",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),D.value=s.value,J.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},ge=e=>{switch(z.value=e,z.value){case"post":s.value=q.value,t.value=B.value,i.value=j.value,A();break;case"comment":s.value=C.value,t.value=R.value,i.value=E.value,K();break;case"highlight":s.value=M.value,t.value=H.value,i.value=G.value,Q();break;case"media":s.value=S.value,t.value=N.value,i.value=Y.value,X();break;case"star":s.value=D.value,t.value=V.value,i.value=J.value,Z();break}},W=()=>{c.value=!0,ea({username:$.value}).then(e=>{c.value=!1,a.id=e.id,a.avatar=e.avatar,a.username=e.username,a.nickname=e.nickname,a.is_admin=e.is_admin,a.is_friend=e.is_friend,a.created_on=e.created_on,a.is_following=e.is_following,a.follows=e.follows,a.followings=e.followings,a.status=e.status,fe()}).catch(e=>{c.value=!1,console.log(e)})},he=()=>{switch(z.value){case"post":B.value=t.value,A();break;case"comment":R.value=t.value,K();break;case"highlight":H.value=t.value,Q();break;case"media":N.value=t.value,X();break;case"star":V.value=t.value,Z();break}},we=()=>{x.value=!0},ke=()=>{I.value=!0},ye=()=>{x.value=!1},be=()=>{I.value=!1},T=e=>()=>ce(re,null,{default:()=>ce(e)}),Pe=Ge(()=>{let e=[{label:"私信",key:"whisper",icon:T($a)}];return f.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:T(_e)}):e.push({label:"解封",key:"deblocking",icon:T(_e)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:T(Ta)}):e.push({label:"关注",key:"follow",icon:T(xa)}),P&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:T(za)}):e.push({label:"添加朋友",key:"requesting",icon:T(Ua)})),e}),$e=e=>{switch(e){case"whisper":we();break;case"delete":Te();break;case"requesting":ke();break;case"follow":case"unfollow":xe();break;case"banned":case"deblocking":ze();break}},Te=()=>{F.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,aa({user_id:a.id}).then(e=>{c.value=!1,a.is_friend=!1,A()}).catch(e=>{c.value=!1,console.log(e)})}})},xe=()=>{F.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,a.is_following?sa({user_id:a.id}).then(e=>{c.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{c.value=!1,console.log(e)}):ta({user_id:a.id}).then(e=>{c.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{c.value=!1,console.log(e)})}})},ze=()=>{F.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,la({id:a.id,status:a.status===1?2:1}).then(e=>{c.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{c.value=!1,console.log(e)})}})},Ue=()=>{t.value{W()}),Je(()=>({path:p.path,query:p.query}),(e,w)=>{w.path==="/u"&&e.path==="/u"&&($.value=p.query.s||"",me(),W())}),(e,w)=>{const Fe=je,Ie=pa,ee=da,te=Ke("router-link"),qe=de,Ce=ma,Me=Ve,le=fa,L=ga,Se=ha,We=Ne,Le=wa,Oe=Re,oe=ka,Ae=He,De=_a,Be=va;return r(),g("div",null,[o(Fe,{title:"用户详情"}),o(De,{class:"main-content-wrap profile-wrap",bordered:""},{default:n(()=>[o(le,{show:c.value},{default:n(()=>[a.id>0?(r(),g("div",Sa,[_("div",Wa,[o(Ie,{size:72,src:a.avatar},null,8,["src"])]),_("div",La,[_("div",Oa,[_("strong",null,h(a.nickname),1),_("span",null," @"+h(a.username),1),P&&m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username&&a.is_friend?(r(),y(ee,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[b(" 好友 ")]),_:1})):k("",!0),m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username&&a.is_following?(r(),y(ee,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:n(()=>[b(" 已关注 ")]),_:1})):k("",!0),a.is_admin?(r(),y(ee,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[b(" 管理员 ")]),_:1})):k("",!0)]),_("div",Aa,[_("span",Da,"UID. "+h(a.id),1),_("span",Ba,h(m(ya)(a.created_on))+" 加入",1)]),_("div",Ra,[_("span",Ha,[o(te,{onClick:w[0]||(w[0]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:n(()=>[b(" 关注  "+h(a.follows),1)]),_:1},8,["to"])]),_("span",Na,[o(te,{onClick:w[1]||(w[1]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:n(()=>[b(" 粉丝  "+h(a.followings),1)]),_:1},8,["to"])])])]),m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username?(r(),g("div",Va,[o(Ce,{placement:"bottom-end",trigger:"click",size:"small",options:Pe.value,onSelect:$e},{default:n(()=>[o(qe,{quaternary:"",circle:""},{icon:n(()=>[o(m(re),null,{default:n(()=>[o(m(Pa))]),_:1})]),_:1})]),_:1},8,["options"])])):k("",!0)])):k("",!0),o(Me,{show:x.value,user:a,onSuccess:ye},null,8,["show","user"]),o(Ma,{show:I.value,user:a,onSuccess:be},null,8,["show","user"])]),_:1},8,["show"]),o(Se,{class:"profile-tabs-wrap",type:"line",animated:"",value:z.value,"onUpdate:value":ge},{default:n(()=>[o(L,{name:"post",tab:"泡泡"}),o(L,{name:"comment",tab:"评论"}),o(L,{name:"highlight",tab:"亮点"}),o(L,{name:"media",tab:"图文"}),o(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),u.value&&s.value.length===0?(r(),g("div",ja,[o(We,{num:d.value},null,8,["num"])])):(r(),g("div",Ea,[s.value.length===0?(r(),g("div",Ga,[o(Le,{size:"large",description:"暂无数据"})])):k("",!0),m(f).state.desktopModelShow?(r(),g("div",Ya,[(r(!0),g(ue,null,ie(s.value,U=>(r(),y(oe,{key:U.id},{default:n(()=>[o(Oe,{post:U,onSendWhisper:se},null,8,["post"])]),_:2},1024))),128))])):(r(),g("div",Ja,[(r(!0),g(ue,null,ie(s.value,U=>(r(),y(oe,{key:U.id},{default:n(()=>[o(Ae,{post:U,onSendWhisper:se},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),i.value>0?(r(),y(Be,{key:0,justify:"center"},{default:n(()=>[o(m(ba),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:w[2]||(w[2]=U=>Ue())},{spinner:n(()=>[_("div",Ka,[v.value?k("",!0):(r(),y(le,{key:0,size:14})),_("span",Qa,h(v.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Cs=pe(Xa,[["__scopeId","data-v-3584e0a9"]]);export{Cs as default}; +import{_ as Re,a as He}from"./post-item.vue_vue_type_style_index_0_lang-899852f8.js";import{_ as Ne}from"./post-skeleton-54a835d7.js";import{_ as Ve}from"./whisper-f9793dd1.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{d as ve,H as l,e as r,q as y,w as n,j as _,k as o,A as b,x as h,R as Ee,c as Ge,b as Ye,E as Je,r as Ke,f as g,Y as k,bf as m,y as ne,F as ue,u as ie,h as ce}from"./@vue-a481fc63.js";import{u as Qe}from"./vuex-44de225f.js";import{b as Xe}from"./vue-router-e5a2430e.js";import{D as Ze,_ as pe,E as ea,e as O,F as aa,G as sa,H as ta,I as la}from"./index-8d220080.js";import{R as oa,H as na,S as ua,b as ia,e as de,i as ca,T as ra,F as _a,a as va,j as re,o as pa,M as da,O as ma,k as fa,f as ga,g as ha,I as wa,G as ka}from"./naive-ui-d8de3dda.js";import{b as ya}from"./formatTime-4210fcd1.js";import{W as ba}from"./v3-infinite-loading-2c58ec2f.js";import{i as Pa,p as $a,y as _e,z as Ta,v as xa,D as za,G as Ua}from"./@vicons-7a4ef312.js";import"./content-e3389a3a.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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-2ab8298d.js";const Fa={class:"whisper-wrap"},Ia={class:"whisper-line"},qa={class:"whisper-line send-wrap"},Ca=ve({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(ae,{emit:F}){const f=ae,p=l(""),P=l(!1),u=()=>{F("success")},v=()=>{P.value=!0,Ze({user_id:f.user.id,greetings:p.value}).then(a=>{window.$message.success("发送成功"),P.value=!1,p.value="",u()}).catch(a=>{P.value=!1})};return(a,c)=>{const x=oa,I=na,s=ua,q=ia,C=de,M=ca;return r(),y(M,{show:a.show,"onUpdate:show":u,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:n(()=>[_("div",Fa,[o(s,{"show-icon":!1},{default:n(()=>[b(" 发送添加朋友申请给: "),o(I,{style:{"max-width":"100%"}},{default:n(()=>[o(x,{type:"success"},{default:n(()=>[b(h(a.user.nickname)+"@"+h(a.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ia,[o(q,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:p.value,"onUpdate:value":c[0]||(c[0]=S=>p.value=S),maxlength:"120","show-count":""},null,8,["value"])]),_("div",qa,[o(C,{strong:"",secondary:"",type:"primary",loading:P.value,onClick:v},{default:n(()=>[b(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ma=pe(Ca,[["__scopeId","data-v-60be56a2"]]),Sa={key:0,class:"profile-baseinfo"},Wa={class:"avatar"},La={class:"base-info"},Oa={class:"username"},Aa={class:"userinfo"},Da={class:"info-item"},Ba={class:"info-item"},Ra={class:"userinfo"},Ha={class:"info-item"},Na={class:"info-item"},Va={key:0,class:"user-opts"},ja={key:0,class:"skeleton-wrap"},Ea={key:1},Ga={key:0,class:"empty-wrap"},Ya={key:1},Ja={key:2},Ka={class:"load-more-wrap"},Qa={class:"load-more-spinner"},Xa=ve({__name:"User",setup(ae){const F=ra(),f=Qe(),p=Xe(),P="true".toLowerCase()==="true",u=l(!1),v=l(!1),a=Ee({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),c=l(!1),x=l(!1),I=l(!1),s=l([]),q=l([]),C=l([]),M=l([]),S=l([]),D=l([]),$=l(p.query.s||""),t=l(+p.query.p||1),z=l("post"),B=l(+p.query.p||1),R=l(1),H=l(1),N=l(1),V=l(1),d=l(20),i=l(0),j=l(0),E=l(0),G=l(0),Y=l(0),J=l(0),se=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,x.value=!0},me=()=>{v.value=!1,s.value=[],q.value=[],C.value=[],M.value=[],S.value=[],D.value=[],z.value="post",t.value=1,B.value=1,R.value=1,H.value=1,N.value=1,V.value=1,i.value=0,j.value=0,E.value=0,G.value=0,Y.value=0,J.value=0},fe=()=>{switch(z.value){case"post":A();break;case"comment":K();break;case"highlight":Q();break;case"media":X();break;case"star":Z();break}},A=()=>{u.value=!0,O({username:$.value,style:"post",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),q.value=s.value,j.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},K=()=>{u.value=!0,O({username:$.value,style:"comment",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),C.value=s.value,E.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},Q=()=>{u.value=!0,O({username:$.value,style:"highlight",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),M.value=s.value,G.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},X=()=>{u.value=!0,O({username:$.value,style:"media",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),S.value=s.value,Y.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},Z=()=>{u.value=!0,O({username:$.value,style:"star",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),D.value=s.value,J.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},ge=e=>{switch(z.value=e,z.value){case"post":s.value=q.value,t.value=B.value,i.value=j.value,A();break;case"comment":s.value=C.value,t.value=R.value,i.value=E.value,K();break;case"highlight":s.value=M.value,t.value=H.value,i.value=G.value,Q();break;case"media":s.value=S.value,t.value=N.value,i.value=Y.value,X();break;case"star":s.value=D.value,t.value=V.value,i.value=J.value,Z();break}},W=()=>{c.value=!0,ea({username:$.value}).then(e=>{c.value=!1,a.id=e.id,a.avatar=e.avatar,a.username=e.username,a.nickname=e.nickname,a.is_admin=e.is_admin,a.is_friend=e.is_friend,a.created_on=e.created_on,a.is_following=e.is_following,a.follows=e.follows,a.followings=e.followings,a.status=e.status,fe()}).catch(e=>{c.value=!1,console.log(e)})},he=()=>{switch(z.value){case"post":B.value=t.value,A();break;case"comment":R.value=t.value,K();break;case"highlight":H.value=t.value,Q();break;case"media":N.value=t.value,X();break;case"star":V.value=t.value,Z();break}},we=()=>{x.value=!0},ke=()=>{I.value=!0},ye=()=>{x.value=!1},be=()=>{I.value=!1},T=e=>()=>ce(re,null,{default:()=>ce(e)}),Pe=Ge(()=>{let e=[{label:"私信",key:"whisper",icon:T($a)}];return f.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:T(_e)}):e.push({label:"解封",key:"deblocking",icon:T(_e)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:T(Ta)}):e.push({label:"关注",key:"follow",icon:T(xa)}),P&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:T(za)}):e.push({label:"添加朋友",key:"requesting",icon:T(Ua)})),e}),$e=e=>{switch(e){case"whisper":we();break;case"delete":Te();break;case"requesting":ke();break;case"follow":case"unfollow":xe();break;case"banned":case"deblocking":ze();break}},Te=()=>{F.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,aa({user_id:a.id}).then(e=>{c.value=!1,a.is_friend=!1,A()}).catch(e=>{c.value=!1,console.log(e)})}})},xe=()=>{F.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,a.is_following?sa({user_id:a.id}).then(e=>{c.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{c.value=!1,console.log(e)}):ta({user_id:a.id}).then(e=>{c.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{c.value=!1,console.log(e)})}})},ze=()=>{F.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,la({id:a.id,status:a.status===1?2:1}).then(e=>{c.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{c.value=!1,console.log(e)})}})},Ue=()=>{t.value{W()}),Je(()=>({path:p.path,query:p.query}),(e,w)=>{w.path==="/u"&&e.path==="/u"&&($.value=p.query.s||"",me(),W())}),(e,w)=>{const Fe=je,Ie=pa,ee=da,te=Ke("router-link"),qe=de,Ce=ma,Me=Ve,le=fa,L=ga,Se=ha,We=Ne,Le=wa,Oe=Re,oe=ka,Ae=He,De=_a,Be=va;return r(),g("div",null,[o(Fe,{title:"用户详情"}),o(De,{class:"main-content-wrap profile-wrap",bordered:""},{default:n(()=>[o(le,{show:c.value},{default:n(()=>[a.id>0?(r(),g("div",Sa,[_("div",Wa,[o(Ie,{size:72,src:a.avatar},null,8,["src"])]),_("div",La,[_("div",Oa,[_("strong",null,h(a.nickname),1),_("span",null," @"+h(a.username),1),P&&m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username&&a.is_friend?(r(),y(ee,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[b(" 好友 ")]),_:1})):k("",!0),m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username&&a.is_following?(r(),y(ee,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:n(()=>[b(" 已关注 ")]),_:1})):k("",!0),a.is_admin?(r(),y(ee,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[b(" 管理员 ")]),_:1})):k("",!0)]),_("div",Aa,[_("span",Da,"UID. "+h(a.id),1),_("span",Ba,h(m(ya)(a.created_on))+" 加入",1)]),_("div",Ra,[_("span",Ha,[o(te,{onClick:w[0]||(w[0]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:n(()=>[b(" 关注  "+h(a.follows),1)]),_:1},8,["to"])]),_("span",Na,[o(te,{onClick:w[1]||(w[1]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:n(()=>[b(" 粉丝  "+h(a.followings),1)]),_:1},8,["to"])])])]),m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username?(r(),g("div",Va,[o(Ce,{placement:"bottom-end",trigger:"click",size:"small",options:Pe.value,onSelect:$e},{default:n(()=>[o(qe,{quaternary:"",circle:""},{icon:n(()=>[o(m(re),null,{default:n(()=>[o(m(Pa))]),_:1})]),_:1})]),_:1},8,["options"])])):k("",!0)])):k("",!0),o(Me,{show:x.value,user:a,onSuccess:ye},null,8,["show","user"]),o(Ma,{show:I.value,user:a,onSuccess:be},null,8,["show","user"])]),_:1},8,["show"]),o(Se,{class:"profile-tabs-wrap",type:"line",animated:"",value:z.value,"onUpdate:value":ge},{default:n(()=>[o(L,{name:"post",tab:"泡泡"}),o(L,{name:"comment",tab:"评论"}),o(L,{name:"highlight",tab:"亮点"}),o(L,{name:"media",tab:"图文"}),o(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),u.value&&s.value.length===0?(r(),g("div",ja,[o(We,{num:d.value},null,8,["num"])])):(r(),g("div",Ea,[s.value.length===0?(r(),g("div",Ga,[o(Le,{size:"large",description:"暂无数据"})])):k("",!0),m(f).state.desktopModelShow?(r(),g("div",Ya,[(r(!0),g(ue,null,ie(s.value,U=>(r(),y(oe,{key:U.id},{default:n(()=>[o(Oe,{post:U,onSendWhisper:se},null,8,["post"])]),_:2},1024))),128))])):(r(),g("div",Ja,[(r(!0),g(ue,null,ie(s.value,U=>(r(),y(oe,{key:U.id},{default:n(()=>[o(Ae,{post:U,onSendWhisper:se},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),i.value>0?(r(),y(Be,{key:0,justify:"center"},{default:n(()=>[o(m(ba),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:w[2]||(w[2]=U=>Ue())},{spinner:n(()=>[_("div",Ka,[v.value?k("",!0):(r(),y(le,{key:0,size:14})),_("span",Qa,h(v.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Cs=pe(Xa,[["__scopeId","data-v-3584e0a9"]]);export{Cs as default}; diff --git a/web/dist/assets/Wallet-ef7a3d97.js b/web/dist/assets/Wallet-f3715a73.js similarity index 96% rename from web/dist/assets/Wallet-ef7a3d97.js rename to web/dist/assets/Wallet-f3715a73.js index d47d4168..b162f3a2 100644 --- a/web/dist/assets/Wallet-ef7a3d97.js +++ b/web/dist/assets/Wallet-f3715a73.js @@ -1 +1 @@ -import{_ as K}from"./post-skeleton-26b3006b.js";import{_ as X}from"./main-nav.vue_vue_type_style_index_0_lang-b165919a.js";import{d as Z,H as c,b as J,f as _,k as e,w as o,e as a,bf as y,Y as w,j as n,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ne,$ as ae,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{T as _e,U as re,V as ue,W as pe,_ as de}from"./index-cb280048.js";import{a as me}from"./formatTime-4210fcd1.js";import{X as ge}from"./@vicons-7a4ef312.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,Q as be,I as xe,j as Ce,l as Ie,h as Se,G as Ae}from"./naive-ui-d8de3dda.js";import"./vooks-6d99783e.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-39372edb.js";import"./@css-render-7124a1a5.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-2ab8298d.js";const T=m=>(ae("data-v-870bd246"),m=m(),se(),m),Re={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Te={key:1},We={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Oe={key:1,style:{"margin-top":"10px"}},Pe={class:"qrcode-wrap"},Ue=T(()=>n("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},De={class:"pay-sub-tips"},Ee=T(()=>n("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Le=Z({__name:"Wallet",setup(m){const i=le(),W=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+W.query.p||1),C=c(20),I=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),A=()=>{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,A()},R=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),A()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},O=()=>{g.value=!0},P=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const S=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",R())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{R()}),(s,l)=>{const S=X,d=fe,V=ye,f=we,$=ke,D=be,E=K,L=xe,M=Ae,j=ve,Q=Ce,Y=Ie,G=Se,H=he;return a(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(a(),_("div",ze,[e(D,{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(()=>[n("div",Re,[n("div",$e,[e(V,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),n("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:O},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(a(),_("div",Ne,[e(E,{num:C.value},null,8,["num"])])):(a(),_("div",Te,[b.value.length===0?(a(),_("div",We,[e(L,{size:"large",description:"暂无数据"})])):w("",!0),(a(!0),_(q,null,z(b.value,t=>(a(),N(M,{key:t.id},{default:o(()=>[n("div",Be,[n("div",null,"NO."+r(t.id),1),n("div",null,r(t.reason),1),n("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),n("div",null,r(y(me)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(H,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(G,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(a(),_("div",Fe,[e($,{align:"baseline"},{default:o(()=>[(a(!0),_(q,null,z(B.value,t=>(a(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ne(Me=>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?(a(),_("div",Oe,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:P},{icon:o(()=>[e(Q,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(n("div",Pe,[Ue,n("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),n("div",De,[e(Y,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=de(Le,[["__scopeId","data-v-870bd246"]]);export{yt as default}; +import{_ as K}from"./post-skeleton-54a835d7.js";import{_ as X}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{d as Z,H as c,b as J,f as _,k as e,w as o,e as a,bf as y,Y as w,j as n,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ne,$ as ae,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{T as _e,U as re,V as ue,W as pe,_ as de}from"./index-8d220080.js";import{a as me}from"./formatTime-4210fcd1.js";import{X as ge}from"./@vicons-7a4ef312.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,Q as be,I as xe,j as Ce,l as Ie,h as Se,G as Ae}from"./naive-ui-d8de3dda.js";import"./vooks-6d99783e.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-39372edb.js";import"./@css-render-7124a1a5.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-2ab8298d.js";const T=m=>(ae("data-v-870bd246"),m=m(),se(),m),Re={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Te={key:1},We={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Oe={key:1,style:{"margin-top":"10px"}},Pe={class:"qrcode-wrap"},Ue=T(()=>n("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},De={class:"pay-sub-tips"},Ee=T(()=>n("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Le=Z({__name:"Wallet",setup(m){const i=le(),W=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+W.query.p||1),C=c(20),I=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),A=()=>{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,A()},R=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),A()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},O=()=>{g.value=!0},P=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const S=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",R())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{R()}),(s,l)=>{const S=X,d=fe,V=ye,f=we,$=ke,D=be,E=K,L=xe,M=Ae,j=ve,Q=Ce,Y=Ie,G=Se,H=he;return a(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(a(),_("div",ze,[e(D,{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(()=>[n("div",Re,[n("div",$e,[e(V,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),n("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:O},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(a(),_("div",Ne,[e(E,{num:C.value},null,8,["num"])])):(a(),_("div",Te,[b.value.length===0?(a(),_("div",We,[e(L,{size:"large",description:"暂无数据"})])):w("",!0),(a(!0),_(q,null,z(b.value,t=>(a(),N(M,{key:t.id},{default:o(()=>[n("div",Be,[n("div",null,"NO."+r(t.id),1),n("div",null,r(t.reason),1),n("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),n("div",null,r(y(me)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(H,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(G,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(a(),_("div",Fe,[e($,{align:"baseline"},{default:o(()=>[(a(!0),_(q,null,z(B.value,t=>(a(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ne(Me=>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?(a(),_("div",Oe,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:P},{icon:o(()=>[e(Q,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(n("div",Pe,[Ue,n("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),n("div",De,[e(Y,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=de(Le,[["__scopeId","data-v-870bd246"]]);export{yt as default}; diff --git a/web/dist/assets/content-64ba0596.js b/web/dist/assets/content-e3389a3a.js similarity index 99% rename from web/dist/assets/content-64ba0596.js rename to web/dist/assets/content-e3389a3a.js index a5725713..8682153a 100644 --- a/web/dist/assets/content-64ba0596.js +++ b/web/dist/assets/content-e3389a3a.js @@ -1 +1 @@ -import{d as h,e,f as r,F as a,u as m,k as s,w as o,bf as c,j as C,y as k,x as I,q as d,Y as g,H as j,A as N,h as b}from"./@vue-a481fc63.js";import{R as V,U}from"./@vicons-7a4ef312.js";import{j as $,V as A,W as B,m as z,X as F,e as L,i as O}from"./naive-ui-d8de3dda.js";import{_ as D,O as P,P as R}from"./index-cb280048.js";import{e as T}from"./paopao-video-player-2fe58954.js";const M={class:"link-wrap"},q={class:"link-txt-wrap"},H=["href"],S={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",M,[(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(V))]),_:1}),C("div",q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",S,I(n.content),1)],8,H)])]))),128))])}}});const ot=D(W,[["__scopeId","data-v-36eef76b"]]),X={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=A,n=B;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(T),{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)}}}),Y={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=z,_=A,f=B,w=F;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(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(),d(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(),d(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(),d(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(),d(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(),d(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(),d(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(),d(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 Z={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=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),P({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{R({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=$,t=L,i=O;return e(),r("div",Z,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(U))]),_:1})]),default:o(()=>[N(" "+I(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=D(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,e,f as r,F as a,u as m,k as s,w as o,bf as c,j as C,y as k,x as I,q as d,Y as g,H as j,A as N,h as b}from"./@vue-a481fc63.js";import{R as V,U}from"./@vicons-7a4ef312.js";import{j as $,V as A,W as B,m as z,X as F,e as L,i as O}from"./naive-ui-d8de3dda.js";import{_ as D,O as P,P as R}from"./index-8d220080.js";import{e as T}from"./paopao-video-player-2fe58954.js";const M={class:"link-wrap"},q={class:"link-txt-wrap"},H=["href"],S={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",M,[(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(V))]),_:1}),C("div",q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",S,I(n.content),1)],8,H)])]))),128))])}}});const ot=D(W,[["__scopeId","data-v-36eef76b"]]),X={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=A,n=B;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(T),{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)}}}),Y={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=z,_=A,f=B,w=F;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(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(),d(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(),d(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(),d(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(),d(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(),d(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(),d(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(),d(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 Z={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=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),P({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{R({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=$,t=L,i=O;return e(),r("div",Z,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(U))]),_:1})]),default:o(()=>[N(" "+I(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=D(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-cb280048.js b/web/dist/assets/index-8d220080.js similarity index 89% rename from web/dist/assets/index-cb280048.js rename to web/dist/assets/index-8d220080.js index 64d72d55..05b4e7be 100644 --- a/web/dist/assets/index-cb280048.js +++ b/web/dist/assets/index-8d220080.js @@ -1 +1 @@ -import{d as W,H as $,R as Z,b as G,e as w,q as D,w as r,j as y,k as s,f as R,A as S,Z as q,y as K,Y as U,bf as g,c as Q,E as j,r as le,F as J,u as X,x as I,h as k,a5 as he,s as ee,l as ge,ag as fe}from"./@vue-a481fc63.js";import{c as ve,a as we,u as ue,b as ye}from"./vue-router-e5a2430e.js";import{c as be,u as B}from"./vuex-44de225f.js";import{a as ke}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ce,b as ie,c as Oe,d as Ae,e as de,f as Te,g as Ee,h as pe,i as Re,j as V,k as $e,u as Ce,l as Ie,m as Se,n as Ue,o as Me,p as qe,q as Ke,r as De,s as Ne,t as xe}from"./naive-ui-d8de3dda.js";import{S as Fe,M as Ve,L as ze,C as We,B as Be,P as He,W as je,a as Ge,H as te,b as oe,c as se}from"./@vicons-7a4ef312.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 d of n.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function a(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=a(c);fetch(c.href,n)}})();const Qe="modulepreload",Ye=function(e){return"/"+e},ne={},O=function(t,a,i){if(!a||a.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(a.map(n=>{if(n=Ye(n),n in ne)return;ne[n]=!0;const d=n.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const h=c[b];if(h.href===n&&(!d||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${p}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Qe,d||(f.as="script",f.crossOrigin=""),f.href=n,document.head.appendChild(f),d)return new Promise((b,h)=>{f.addEventListener("load",b),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n})},Ze=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>O(()=>import("./Home-9d65330f.js"),["assets/Home-9d65330f.js","assets/whisper-31e5b9ad.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-00295cef.js","assets/content-64ba0596.js","assets/@vicons-7a4ef312.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-26b3006b.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/@opentiny-d73a2d67.js","assets/vue-1e3b54ec.js","assets/xss-a5544f63.js","assets/cssfilter-af71ba68.js","assets/@opentiny-0f942bd4.css","assets/axios-4a70c6fc.js","assets/Home-af58e3ca.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>O(()=>import("./Post-b0a250af.js"),["assets/Post-b0a250af.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/IEnum-5453a777.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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-64ba0596.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-26b3006b.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-31e5b9ad.js","assets/whisper-61451957.css","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Post-1ac7281c.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>O(()=>import("./Topic-36f0525d.js"),["assets/Topic-36f0525d.js","assets/@vicons-7a4ef312.js","assets/@vue-a481fc63.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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-b165919a.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>O(()=>import("./Anouncement-2e8c2b37.js"),["assets/Anouncement-2e8c2b37.js","assets/post-skeleton-26b3006b.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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-b165919a.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.js","assets/main-nav-569a7b0c.css","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>O(()=>import("./Profile-25637d74.js"),["assets/Profile-25637d74.js","assets/whisper-31e5b9ad.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-00295cef.js","assets/content-64ba0596.js","assets/@vicons-7a4ef312.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-26b3006b.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Profile-88292227.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>O(()=>import("./User-3da55cb6.js"),["assets/User-3da55cb6.js","assets/post-item.vue_vue_type_style_index_0_lang-00295cef.js","assets/content-64ba0596.js","assets/@vue-a481fc63.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-26b3006b.js","assets/post-skeleton-f1900002.css","assets/whisper-31e5b9ad.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/User-e6eae837.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>O(()=>import("./Messages-a82c4399.js"),["assets/Messages-a82c4399.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-31e5b9ad.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Messages-3c6066fb.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>O(()=>import("./Collection-137c1486.js"),["assets/Collection-137c1486.js","assets/whisper-31e5b9ad.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-00295cef.js","assets/content-64ba0596.js","assets/@vicons-7a4ef312.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-26b3006b.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Collection-5c3a44e2.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>O(()=>import("./Contacts-38a5cec7.js"),["assets/Contacts-38a5cec7.js","assets/whisper-31e5b9ad.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-7a4ef312.js","assets/post-skeleton-26b3006b.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Contacts-7fa3e0d6.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>O(()=>import("./Following-0841e0ed.js"),["assets/Following-0841e0ed.js","assets/whisper-31e5b9ad.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-7a4ef312.js","assets/post-skeleton-26b3006b.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Following-6aa7d36c.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>O(()=>import("./Wallet-ef7a3d97.js"),["assets/Wallet-ef7a3d97.js","assets/post-skeleton-26b3006b.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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-b165919a.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>O(()=>import("./Setting-ff8723d9.js"),["assets/Setting-ff8723d9.js","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/@css-render-7124a1a5.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-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>O(()=>import("./404-b2b07932.js"),["assets/404-b2b07932.js","assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/@css-render-7124a1a5.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-569a7b0c.css","assets/axios-4a70c6fc.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],me=ve({history:we(),routes:Ze});me.beforeEach((e,t,a)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,a()});const Je=be({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:"",created_on:0,follows:0,followings:0}},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:"",created_on:0,follows:0,followings:0},e.userLogined=!1}},actions:{},modules:{}}),Y=ke.create({baseURL:"",timeout:3e4});Y.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Y.interceptors.response.use(e=>{const{data:t={},code:a=0}=(e==null?void 0:e.data)||{};if(+a==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var a;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(((a=t==null?void 0:t.data)==null?void 0:a.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return Y(e)}const re=e=>o({method:"post",url:"/v1/auth/login",data:e}),Xe=e=>o({method:"post",url:"/v1/auth/register",data:e}),H=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=W({__name:"auth",setup(e){const t=$("true".toLowerCase()==="true"),a=B(),i=$(!1),c=$(),n=Z({username:"",password:""}),d=$(),p=Z({username:"",password:"",repassword:""}),M={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(h,u)=>!!p.password&&p.password.startsWith(u)&&p.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},f=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=c.value)==null||u.validate(A=>{A||(i.value=!0,re({username:n.username,password:n.password}).then(_=>{const L=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",L),H(L)}).then(_=>{window.$message.success("登录成功"),i.value=!1,a.commit("updateUserinfo",_),a.commit("triggerAuth",!1),a.commit("refresh"),n.username="",n.password=""}).catch(_=>{i.value=!1}))})},b=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=d.value)==null||u.validate(A=>{A||(i.value=!0,Xe({username:p.username,password:p.password}).then(_=>re({username:p.username,password:p.password})).then(_=>{const L=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",L),H(L)}).then(_=>{window.$message.success("注册成功"),i.value=!1,a.commit("updateUserinfo",_),a.commit("triggerAuth",!1),p.username="",p.password="",p.repassword=""}).catch(_=>{i.value=!1}))})};return G(()=>{const h=localStorage.getItem("PAOPAO_TOKEN")||"";h?H(h).then(u=>{a.commit("updateUserinfo",u),a.commit("triggerAuth",!1)}).catch(u=>{a.commit("userLogout")}):a.commit("userLogout")}),(h,u)=>{const A=Pe,_=Le,L=ce,T=ie,P=Oe,v=Ae,l=de,E=Te,F=Ee,N=pe,x=Re;return w(),D(x,{show:g(a).state.authModalShow,"onUpdate:show":u[7]||(u[7]=m=>g(a).state.authModalShow=m),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:r(()=>[y("div",et,[s(N,{bordered:!1},{default:r(()=>[t.value?U("",!0):(w(),R("div",tt,[s(L,{justify:"center"},{default:r(()=>[s(_,null,{default:r(()=>[s(A,{type:"success"},{default:r(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),s(v,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:r(()=>[s(P,{label:"账户",path:"username"},{default:r(()=>[s(T,{value:n.username,"onUpdate:value":u[0]||(u[0]=m=>n.username=m),placeholder:"请输入用户名",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=m=>n.password=m),placeholder:"请输入账户密码",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:f},{default:r(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),D(F,{key:1,"default-value":g(a).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:r(()=>[s(E,{name:"signin",tab:"登录"},{default:r(()=>[s(v,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:r(()=>[s(P,{label:"账户",path:"username"},{default:r(()=>[s(T,{value:n.username,"onUpdate:value":u[2]||(u[2]=m=>n.username=m),placeholder:"请输入用户名",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=m=>n.password=m),placeholder:"请输入账户密码",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:f},{default:r(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(E,{name:"signup",tab:"注册"},{default:r(()=>[s(v,{ref_key:"registerRef",ref:d,model:p,rules:M},{default:r(()=>[s(P,{label:"用户名",path:"username"},{default:r(()=>[s(T,{value:p.username,"onUpdate:value":u[4]||(u[4]=m=>p.username=m),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:p.password,"onUpdate:value":u[5]||(u[5]=m=>p.password=m),onKeyup:q(K(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"重复密码",path:"repassword"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:p.repassword,"onUpdate:value":u[6]||(u[6]=m=>p.repassword=m),onKeyup:q(K(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:b},{default:r(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):U("",!0)]),_:1})])]),_:1},8,["show"])}}});const _e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,c]of t)a[i]=c;return a},st=_e(ot,[["__scopeId","data-v-053dfa44"]]),Zt=e=>o({method:"get",url:"/v1/posts",params:e}),nt=e=>o({method:"get",url:"/v1/tags",params:e}),Jt=e=>o({method:"get",url:"/v1/post",params:e}),Xt=e=>o({method:"get",url:"/v1/post/star",params:e}),eo=e=>o({method:"post",url:"/v1/post/star",data:e}),to=e=>o({method:"get",url:"/v1/post/collection",params:e}),oo=e=>o({method:"post",url:"/v1/post/collection",data:e}),so=e=>o({method:"get",url:"/v1/post/comments",params:e}),no=e=>o({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>o({method:"post",url:"/v1/post",data:e}),ao=e=>o({method:"delete",url:"/v1/post",data:e}),lo=e=>o({method:"post",url:"/v1/post/lock",data:e}),uo=e=>o({method:"post",url:"/v1/post/stick",data:e}),co=e=>o({method:"post",url:"/v1/post/highlight",data:e}),io=e=>o({method:"post",url:"/v1/post/visibility",data:e}),po=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),mo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),_o=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),ho=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),go=e=>o({method:"post",url:"/v1/post/comment",data:e}),fo=e=>o({method:"delete",url:"/v1/post/comment",data:e}),vo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),wo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),yo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),bo=e=>o({method:"post",url:"/v1/topic/follow",data:e}),ko=e=>o({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=W({__name:"rightbar",setup(e){const t=$([]),a=$([]),i=$(!1),c=$(""),n=B(),d=ue(),p="2023 paopao.info",M="Roc's Me",f="",b="泡泡(PaoPao)开源社区",h="https://www.paopao.info",u=+"6",A=+"12",_=()=>{i.value=!0,nt({type:"hot_extral",num:A,extral_num:u}).then(v=>{t.value=v.topics,a.value=v.extral_topics??[],P.value=!0,i.value=!1}).catch(v=>{i.value=!1})},L=v=>v>=1e3?(v/1e3).toFixed(1)+"k":v,T=()=>{d.push({name:"home",query:{q:c.value}})},P=Q({get:()=>n.state.userLogined&&a.value.length!==0,set:v=>{}});return j(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(v,l)=>{(v.refreshTopicFollow!==l.refreshTopicFollow||v.userLogined)&&_()}),G(()=>{_()}),(v,l)=>{const E=V,F=ie,N=le("router-link"),x=$e,m=pe,z=ce;return g(n).state.collapsedRight?U("",!0):(w(),R("div",rt,[y("div",at,[s(F,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":l[0]||(l[0]=C=>c.value=C),onKeyup:q(K(T,["prevent"]),["enter"])},{prefix:r(()=>[s(E,{component:g(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),P.value?(w(),D(m,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:r(()=>[s(x,{show:i.value},{default:r(()=>[(w(!0),R(J,null,X(a.value,C=>(w(),R("div",{class:"hot-tag-item",key:C.id},[s(N,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:r(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),y("div",lt,I(L(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):U("",!0),s(m,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:r(()=>[s(x,{show:i.value},{default:r(()=>[(w(!0),R(J,null,X(t.value,C=>(w(),R("div",{class:"hot-tag-item",key:C.id},[s(N,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:r(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),y("div",ut,I(L(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(m,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:r(()=>[y("div",ct,"© "+I(g(p)),1),y("div",null,[s(z,null,{default:r(()=>[y("a",{href:g(f),target:"_blank",class:"hash-link"},I(g(M)),9,it),y("a",{href:g(h),target:"_blank",class:"hash-link"},I(g(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=_e(pt,[["__scopeId","data-v-52b86ac0"]]),Po=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Lo=e=>o({method:"post",url:"/v1/captcha",data:e}),Oo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),Ao=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),To=e=>o({method:"post",url:"/v1/friend/add",data:e}),Eo=e=>o({method:"post",url:"/v1/user/follow",data:e}),Ro=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),$o=e=>o({method:"get",url:"/v1/user/follows",params:e}),Co=e=>o({method:"get",url:"/v1/user/followings",params:e}),Io=e=>o({method:"post",url:"/v1/friend/reject",data:e}),So=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Uo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Mo=e=>o({method:"post",url:"/v1/user/activate",data:e}),qo=e=>o({method:"post",url:"/v1/user/password",data:e}),Ko=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Do=e=>o({method:"post",url:"/v1/user/avatar",data:e}),ae=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),No=e=>o({method:"get",url:"/v1/user/messages",params:e}),xo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Fo=e=>o({method:"get",url:"/v1/user/collections",params:e}),Vo=e=>o({method:"get",url:"/v1/user/profile",params:e}),zo=e=>o({method:"get",url:"/v1/user/posts",params:e}),Wo=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),Bo=e=>o({method:"post",url:"/v1/user/recharge",data:e}),Ho=e=>o({method:"get",url:"/v1/user/recharge",params:e}),jo=e=>o({method:"get",url:"/v1/suggest/users",params:e}),Go=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),Qo=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),Yo=e=>o({method:"get",url:"/v1/attachment",params:e}),Zo=e=>o({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"},bt={class:"username"},kt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},At=W({__name:"sidebar",setup(e){const t=B(),a=ye(),i=ue(),c=$(!1),n=$(a.name||""),d=$(),p="true".toLowerCase()==="true",M="false".toLowerCase()==="true",f="false".toLocaleLowerCase()==="true",b=$("true".toLowerCase()==="true"),h=+"5000";j(a,()=>{n.value=a.name}),j(t.state,()=>{t.state.userInfo.id>0?d.value||(ae().then(l=>{c.value=l.count>0}).catch(l=>{console.log(l)}),d.value=setInterval(()=>{ae().then(l=>{c.value=l.count>0}).catch(l=>{console.log(l)})},h)):d.value&&clearInterval(d.value)}),G(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const u=Q(()=>{const l=[{label:"广场",key:"home",icon:()=>k(te),href:"/"},{label:"话题",key:"topic",icon:()=>k(oe),href:"/topic"}];return M&&l.push({label:"公告",key:"anouncement",icon:()=>k(Ve),href:"/anouncement"}),l.push({label:"主页",key:"profile",icon:()=>k(ze),href:"/profile"}),l.push({label:"消息",key:"messages",icon:()=>k(We),href:"/messages"}),l.push({label:"收藏",key:"collection",icon:()=>k(Be),href:"/collection"}),p&&l.push({label:"好友",key:"contacts",icon:()=>k(He),href:"/contacts"}),f&&l.push({label:"钱包",key:"wallet",icon:()=>k(je),href:"/wallet"}),l.push({label:"设置",key:"setting",icon:()=>k(Ge),href:"/setting"}),t.state.userInfo.id>0?l:[{label:"广场",key:"home",icon:()=>k(te),href:"/"},{label:"话题",key:"topic",icon:()=>k(oe),href:"/topic"}]}),A=l=>"href"in l?k("div",{},l.label):l.label,_=l=>l.key==="messages"?k(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>k(V,{color:l.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:l.icon})}):k(V,null,{default:l.icon}),L=(l,E={})=>{n.value=l,i.push({name:l,query:{t:new Date().getTime()}})},T=()=>{a.path==="/"&&t.commit("refresh"),L("home")},P=l=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",l)},v=()=>{t.commit("userLogout"),t.commit("refresh"),T()};return window.$store=t,window.$message=Ce(),(l,E)=>{const F=Se,N=Ue,x=Me,m=de;return w(),R("div",ht,[y("div",gt,[s(F,{class:"logo-img",width:"36",src:g(_t),"preview-disabled":!0,onClick:T},null,8,["src"])]),s(N,{accordion:!0,"icon-size":24,options:u.value,"render-label":A,"render-icon":_,value:n.value,"onUpdate:value":L},null,8,["options","value"]),g(t).state.userInfo.id>0?(w(),R("div",ft,[s(x,{class:"user-avatar",round:"",size:34,src:g(t).state.userInfo.avatar},null,8,["src"]),y("div",vt,[y("div",wt,[y("span",yt,I(g(t).state.userInfo.nickname),1),s(m,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:v},{icon:r(()=>[s(g(V),null,{default:r(()=>[s(g(se))]),_:1})]),_:1})]),y("div",bt,"@"+I(g(t).state.userInfo.username),1)]),y("div",kt,[s(m,{class:"logout",quaternary:"",circle:"",onClick:v},{icon:r(()=>[s(g(V),{size:24},{default:r(()=>[s(g(se))]),_:1})]),_:1})])])):(w(),R("div",Pt,[b.value?U("",!0):(w(),R("div",Lt,[s(m,{strong:"",secondary:"",round:"",type:"primary",onClick:E[0]||(E[0]=z=>P("signin"))},{default:r(()=>[S(" 登录 ")]),_:1})])),b.value?(w(),R("div",Ot,[s(m,{strong:"",secondary:"",round:"",type:"primary",onClick:E[1]||(E[1]=z=>P("signin"))},{default:r(()=>[S(" 登录 ")]),_:1}),s(m,{strong:"",secondary:"",round:"",type:"info",onClick:E[2]||(E[2]=z=>P("signup"))},{default:r(()=>[S(" 注册 ")]),_:1})])):U("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Et={key:0},Rt={class:"content-wrap"},$t=W({__name:"App",setup(e){const t=B(),a=Q(()=>t.state.theme==="dark"?Ke:null);return(i,c)=>{const n=At,d=le("router-view"),p=mt,M=st,f=De,b=Ne,h=xe,u=qe;return w(),D(u,{theme:a.value},{default:r(()=>[s(b,null,{default:r(()=>[s(f,null,{default:r(()=>{var A;return[y("div",{class:ge(["app-container",{dark:((A=a.value)==null?void 0:A.name)==="dark",mobile:!g(t).state.desktopModelShow}])},[y("div",Tt,[g(t).state.desktopModelShow?(w(),R("div",Et,[s(n)])):U("",!0),y("div",Rt,[s(d,{class:"app-wrap"},{default:r(({Component:_})=>[(w(),D(he,null,[i.$route.meta.keepAlive?(w(),D(ee(_),{key:0})):U("",!0)],1024)),i.$route.meta.keepAlive?U("",!0):(w(),D(ee(_),{key:0}))]),_:1})]),s(p)]),s(M)],2)]}),_:1})]),_:1}),s(h)]),_:1},8,["theme"])}}});fe($t).use(me).use(Je).mount("#app");export{Uo as $,ko as A,bo as B,nt as C,Ao as D,Vo as E,So as F,Ro as G,Eo as H,Zo as I,To as J,Io as K,xo as L,No as M,Fo as N,Qo as O,Yo as P,$o as Q,Co as R,Oo as S,H as T,Wo as U,Bo as V,Ho as W,Po as X,Do as Y,qo as Z,_e as _,Go as a,Mo as a0,Ko as a1,Lo as a2,At as a3,no as b,ro as c,Zt as d,zo as e,ho as f,jo as g,wo as h,po as i,mo as j,vo as k,fo as l,go as m,Xt as n,to as o,ao as p,lo as q,co as r,uo as s,_o as t,eo as u,io as v,oo as w,Jt as x,so as y,yo as z}; +import{d as W,H as $,R as Z,b as G,e as w,q as D,w as r,j as y,k as s,f as R,A as S,Z as q,y as K,Y as U,bf as g,c as Q,E as j,r as le,F as J,u as X,x as I,h as k,a5 as he,s as ee,l as ge,ag as fe}from"./@vue-a481fc63.js";import{c as ve,a as we,u as ue,b as ye}from"./vue-router-e5a2430e.js";import{c as be,u as B}from"./vuex-44de225f.js";import{a as ke}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ce,b as ie,c as Oe,d as Ae,e as de,f as Te,g as Ee,h as pe,i as Re,j as V,k as $e,u as Ce,l as Ie,m as Se,n as Ue,o as Me,p as qe,q as Ke,r as De,s as Ne,t as xe}from"./naive-ui-d8de3dda.js";import{S as Fe,M as Ve,L as ze,C as We,B as Be,P as He,W as je,a as Ge,H as te,b as oe,c as se}from"./@vicons-7a4ef312.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 d of n.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function a(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=a(c);fetch(c.href,n)}})();const Qe="modulepreload",Ye=function(e){return"/"+e},ne={},O=function(t,a,i){if(!a||a.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(a.map(n=>{if(n=Ye(n),n in ne)return;ne[n]=!0;const d=n.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const h=c[b];if(h.href===n&&(!d||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${p}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Qe,d||(f.as="script",f.crossOrigin=""),f.href=n,document.head.appendChild(f),d)return new Promise((b,h)=>{f.addEventListener("load",b),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n})},Ze=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>O(()=>import("./Home-62c9b54d.js"),["assets/Home-62c9b54d.js","assets/whisper-f9793dd1.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-899852f8.js","assets/content-e3389a3a.js","assets/@vicons-7a4ef312.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-54a835d7.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/@opentiny-d73a2d67.js","assets/vue-1e3b54ec.js","assets/xss-a5544f63.js","assets/cssfilter-af71ba68.js","assets/@opentiny-0f942bd4.css","assets/axios-4a70c6fc.js","assets/Home-af58e3ca.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>O(()=>import("./Post-ed61910e.js"),["assets/Post-ed61910e.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/IEnum-5453a777.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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-e3389a3a.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-54a835d7.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-f9793dd1.js","assets/whisper-61451957.css","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Post-1ac7281c.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>O(()=>import("./Topic-0e4d12d8.js"),["assets/Topic-0e4d12d8.js","assets/@vicons-7a4ef312.js","assets/@vue-a481fc63.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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-a402eae2.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>O(()=>import("./Anouncement-52f985c0.js"),["assets/Anouncement-52f985c0.js","assets/post-skeleton-54a835d7.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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-a402eae2.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.js","assets/main-nav-569a7b0c.css","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>O(()=>import("./Profile-6d9e62f3.js"),["assets/Profile-6d9e62f3.js","assets/whisper-f9793dd1.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-899852f8.js","assets/content-e3389a3a.js","assets/@vicons-7a4ef312.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-54a835d7.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Profile-88292227.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>O(()=>import("./User-0e1e60bd.js"),["assets/User-0e1e60bd.js","assets/post-item.vue_vue_type_style_index_0_lang-899852f8.js","assets/content-e3389a3a.js","assets/@vue-a481fc63.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-54a835d7.js","assets/post-skeleton-f1900002.css","assets/whisper-f9793dd1.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/User-e6eae837.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>O(()=>import("./Messages-e4d02674.js"),["assets/Messages-e4d02674.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-f9793dd1.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Messages-3c6066fb.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>O(()=>import("./Collection-619e8473.js"),["assets/Collection-619e8473.js","assets/whisper-f9793dd1.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-899852f8.js","assets/content-e3389a3a.js","assets/@vicons-7a4ef312.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-54a835d7.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Collection-5c3a44e2.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>O(()=>import("./Contacts-da926c71.js"),["assets/Contacts-da926c71.js","assets/whisper-f9793dd1.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-7a4ef312.js","assets/post-skeleton-54a835d7.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Contacts-7fa3e0d6.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>O(()=>import("./Following-8e085d0b.js"),["assets/Following-8e085d0b.js","assets/whisper-f9793dd1.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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/whisper-61451957.css","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-7a4ef312.js","assets/post-skeleton-54a835d7.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Following-6aa7d36c.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>O(()=>import("./Wallet-f3715a73.js"),["assets/Wallet-f3715a73.js","assets/post-skeleton-54a835d7.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.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-a402eae2.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>O(()=>import("./Setting-42f80d67.js"),["assets/Setting-42f80d67.js","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/@css-render-7124a1a5.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-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>O(()=>import("./404-71d65ace.js"),["assets/404-71d65ace.js","assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.js","assets/@css-render-7124a1a5.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-569a7b0c.css","assets/axios-4a70c6fc.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],me=ve({history:we(),routes:Ze});me.beforeEach((e,t,a)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,a()});const Je=be({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:"",created_on:0,follows:0,followings:0}},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:"",created_on:0,follows:0,followings:0},e.userLogined=!1}},actions:{},modules:{}}),Y=ke.create({baseURL:"",timeout:3e4});Y.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Y.interceptors.response.use(e=>{const{data:t={},code:a=0}=(e==null?void 0:e.data)||{};if(+a==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var a;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(((a=t==null?void 0:t.data)==null?void 0:a.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return Y(e)}const re=e=>o({method:"post",url:"/v1/auth/login",data:e}),Xe=e=>o({method:"post",url:"/v1/auth/register",data:e}),H=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=W({__name:"auth",setup(e){const t=$("true".toLowerCase()==="true"),a=B(),i=$(!1),c=$(),n=Z({username:"",password:""}),d=$(),p=Z({username:"",password:"",repassword:""}),M={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(h,u)=>!!p.password&&p.password.startsWith(u)&&p.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},f=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=c.value)==null||u.validate(A=>{A||(i.value=!0,re({username:n.username,password:n.password}).then(_=>{const L=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",L),H(L)}).then(_=>{window.$message.success("登录成功"),i.value=!1,a.commit("updateUserinfo",_),a.commit("triggerAuth",!1),a.commit("refresh"),n.username="",n.password=""}).catch(_=>{i.value=!1}))})},b=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=d.value)==null||u.validate(A=>{A||(i.value=!0,Xe({username:p.username,password:p.password}).then(_=>re({username:p.username,password:p.password})).then(_=>{const L=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",L),H(L)}).then(_=>{window.$message.success("注册成功"),i.value=!1,a.commit("updateUserinfo",_),a.commit("triggerAuth",!1),p.username="",p.password="",p.repassword=""}).catch(_=>{i.value=!1}))})};return G(()=>{const h=localStorage.getItem("PAOPAO_TOKEN")||"";h?H(h).then(u=>{a.commit("updateUserinfo",u),a.commit("triggerAuth",!1)}).catch(u=>{a.commit("userLogout")}):a.commit("userLogout")}),(h,u)=>{const A=Pe,_=Le,L=ce,T=ie,P=Oe,v=Ae,l=de,E=Te,F=Ee,N=pe,x=Re;return w(),D(x,{show:g(a).state.authModalShow,"onUpdate:show":u[7]||(u[7]=m=>g(a).state.authModalShow=m),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:r(()=>[y("div",et,[s(N,{bordered:!1},{default:r(()=>[t.value?U("",!0):(w(),R("div",tt,[s(L,{justify:"center"},{default:r(()=>[s(_,null,{default:r(()=>[s(A,{type:"success"},{default:r(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),s(v,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:r(()=>[s(P,{label:"账户",path:"username"},{default:r(()=>[s(T,{value:n.username,"onUpdate:value":u[0]||(u[0]=m=>n.username=m),placeholder:"请输入用户名",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=m=>n.password=m),placeholder:"请输入账户密码",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:f},{default:r(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),D(F,{key:1,"default-value":g(a).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:r(()=>[s(E,{name:"signin",tab:"登录"},{default:r(()=>[s(v,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:r(()=>[s(P,{label:"账户",path:"username"},{default:r(()=>[s(T,{value:n.username,"onUpdate:value":u[2]||(u[2]=m=>n.username=m),placeholder:"请输入用户名",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=m=>n.password=m),placeholder:"请输入账户密码",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:f},{default:r(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(E,{name:"signup",tab:"注册"},{default:r(()=>[s(v,{ref_key:"registerRef",ref:d,model:p,rules:M},{default:r(()=>[s(P,{label:"用户名",path:"username"},{default:r(()=>[s(T,{value:p.username,"onUpdate:value":u[4]||(u[4]=m=>p.username=m),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:p.password,"onUpdate:value":u[5]||(u[5]=m=>p.password=m),onKeyup:q(K(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"重复密码",path:"repassword"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:p.repassword,"onUpdate:value":u[6]||(u[6]=m=>p.repassword=m),onKeyup:q(K(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:b},{default:r(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):U("",!0)]),_:1})])]),_:1},8,["show"])}}});const _e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,c]of t)a[i]=c;return a},st=_e(ot,[["__scopeId","data-v-053dfa44"]]),Zt=e=>o({method:"get",url:"/v1/posts",params:e}),nt=e=>o({method:"get",url:"/v1/tags",params:e}),Jt=e=>o({method:"get",url:"/v1/post",params:e}),Xt=e=>o({method:"get",url:"/v1/post/star",params:e}),eo=e=>o({method:"post",url:"/v1/post/star",data:e}),to=e=>o({method:"get",url:"/v1/post/collection",params:e}),oo=e=>o({method:"post",url:"/v1/post/collection",data:e}),so=e=>o({method:"get",url:"/v1/post/comments",params:e}),no=e=>o({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>o({method:"post",url:"/v1/post",data:e}),ao=e=>o({method:"delete",url:"/v1/post",data:e}),lo=e=>o({method:"post",url:"/v1/post/lock",data:e}),uo=e=>o({method:"post",url:"/v1/post/stick",data:e}),co=e=>o({method:"post",url:"/v1/post/highlight",data:e}),io=e=>o({method:"post",url:"/v1/post/visibility",data:e}),po=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),mo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),_o=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),ho=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),go=e=>o({method:"post",url:"/v1/post/comment",data:e}),fo=e=>o({method:"delete",url:"/v1/post/comment",data:e}),vo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),wo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),yo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),bo=e=>o({method:"post",url:"/v1/topic/follow",data:e}),ko=e=>o({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=W({__name:"rightbar",setup(e){const t=$([]),a=$([]),i=$(!1),c=$(""),n=B(),d=ue(),p="2023 paopao.info",M="Roc's Me",f="",b="泡泡(PaoPao)开源社区",h="https://www.paopao.info",u=+"6",A=+"12",_=()=>{i.value=!0,nt({type:"hot_extral",num:A,extral_num:u}).then(v=>{t.value=v.topics,a.value=v.extral_topics??[],P.value=!0,i.value=!1}).catch(v=>{i.value=!1})},L=v=>v>=1e3?(v/1e3).toFixed(1)+"k":v,T=()=>{d.push({name:"home",query:{q:c.value}})},P=Q({get:()=>n.state.userLogined&&a.value.length!==0,set:v=>{}});return j(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(v,l)=>{(v.refreshTopicFollow!==l.refreshTopicFollow||v.userLogined)&&_()}),G(()=>{_()}),(v,l)=>{const E=V,F=ie,N=le("router-link"),x=$e,m=pe,z=ce;return g(n).state.collapsedRight?U("",!0):(w(),R("div",rt,[y("div",at,[s(F,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":l[0]||(l[0]=C=>c.value=C),onKeyup:q(K(T,["prevent"]),["enter"])},{prefix:r(()=>[s(E,{component:g(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),P.value?(w(),D(m,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:r(()=>[s(x,{show:i.value},{default:r(()=>[(w(!0),R(J,null,X(a.value,C=>(w(),R("div",{class:"hot-tag-item",key:C.id},[s(N,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:r(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),y("div",lt,I(L(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):U("",!0),s(m,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:r(()=>[s(x,{show:i.value},{default:r(()=>[(w(!0),R(J,null,X(t.value,C=>(w(),R("div",{class:"hot-tag-item",key:C.id},[s(N,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:r(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),y("div",ut,I(L(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(m,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:r(()=>[y("div",ct,"© "+I(g(p)),1),y("div",null,[s(z,null,{default:r(()=>[y("a",{href:g(f),target:"_blank",class:"hash-link"},I(g(M)),9,it),y("a",{href:g(h),target:"_blank",class:"hash-link"},I(g(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=_e(pt,[["__scopeId","data-v-52b86ac0"]]),Po=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Lo=e=>o({method:"post",url:"/v1/captcha",data:e}),Oo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),Ao=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),To=e=>o({method:"post",url:"/v1/friend/add",data:e}),Eo=e=>o({method:"post",url:"/v1/user/follow",data:e}),Ro=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),$o=e=>o({method:"get",url:"/v1/user/follows",params:e}),Co=e=>o({method:"get",url:"/v1/user/followings",params:e}),Io=e=>o({method:"post",url:"/v1/friend/reject",data:e}),So=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Uo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Mo=e=>o({method:"post",url:"/v1/user/activate",data:e}),qo=e=>o({method:"post",url:"/v1/user/password",data:e}),Ko=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Do=e=>o({method:"post",url:"/v1/user/avatar",data:e}),ae=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),No=e=>o({method:"get",url:"/v1/user/messages",params:e}),xo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Fo=e=>o({method:"get",url:"/v1/user/collections",params:e}),Vo=e=>o({method:"get",url:"/v1/user/profile",params:e}),zo=e=>o({method:"get",url:"/v1/user/posts",params:e}),Wo=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),Bo=e=>o({method:"post",url:"/v1/user/recharge",data:e}),Ho=e=>o({method:"get",url:"/v1/user/recharge",params:e}),jo=e=>o({method:"get",url:"/v1/suggest/users",params:e}),Go=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),Qo=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),Yo=e=>o({method:"get",url:"/v1/attachment",params:e}),Zo=e=>o({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"},bt={class:"username"},kt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},At=W({__name:"sidebar",setup(e){const t=B(),a=ye(),i=ue(),c=$(!1),n=$(a.name||""),d=$(),p="true".toLowerCase()==="true",M="false".toLowerCase()==="true",f="false".toLocaleLowerCase()==="true",b=$("true".toLowerCase()==="true"),h=+"5000";j(a,()=>{n.value=a.name}),j(t.state,()=>{t.state.userInfo.id>0?d.value||(ae().then(l=>{c.value=l.count>0}).catch(l=>{console.log(l)}),d.value=setInterval(()=>{ae().then(l=>{c.value=l.count>0}).catch(l=>{console.log(l)})},h)):d.value&&clearInterval(d.value)}),G(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const u=Q(()=>{const l=[{label:"广场",key:"home",icon:()=>k(te),href:"/"},{label:"话题",key:"topic",icon:()=>k(oe),href:"/topic"}];return M&&l.push({label:"公告",key:"anouncement",icon:()=>k(Ve),href:"/anouncement"}),l.push({label:"主页",key:"profile",icon:()=>k(ze),href:"/profile"}),l.push({label:"消息",key:"messages",icon:()=>k(We),href:"/messages"}),l.push({label:"收藏",key:"collection",icon:()=>k(Be),href:"/collection"}),p&&l.push({label:"好友",key:"contacts",icon:()=>k(He),href:"/contacts"}),f&&l.push({label:"钱包",key:"wallet",icon:()=>k(je),href:"/wallet"}),l.push({label:"设置",key:"setting",icon:()=>k(Ge),href:"/setting"}),t.state.userInfo.id>0?l:[{label:"广场",key:"home",icon:()=>k(te),href:"/"},{label:"话题",key:"topic",icon:()=>k(oe),href:"/topic"}]}),A=l=>"href"in l?k("div",{},l.label):l.label,_=l=>l.key==="messages"?k(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>k(V,{color:l.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:l.icon})}):k(V,null,{default:l.icon}),L=(l,E={})=>{n.value=l,i.push({name:l,query:{t:new Date().getTime()}})},T=()=>{a.path==="/"&&t.commit("refresh"),L("home")},P=l=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",l)},v=()=>{t.commit("userLogout"),t.commit("refresh"),T()};return window.$store=t,window.$message=Ce(),(l,E)=>{const F=Se,N=Ue,x=Me,m=de;return w(),R("div",ht,[y("div",gt,[s(F,{class:"logo-img",width:"36",src:g(_t),"preview-disabled":!0,onClick:T},null,8,["src"])]),s(N,{accordion:!0,"icon-size":24,options:u.value,"render-label":A,"render-icon":_,value:n.value,"onUpdate:value":L},null,8,["options","value"]),g(t).state.userInfo.id>0?(w(),R("div",ft,[s(x,{class:"user-avatar",round:"",size:34,src:g(t).state.userInfo.avatar},null,8,["src"]),y("div",vt,[y("div",wt,[y("span",yt,I(g(t).state.userInfo.nickname),1),s(m,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:v},{icon:r(()=>[s(g(V),null,{default:r(()=>[s(g(se))]),_:1})]),_:1})]),y("div",bt,"@"+I(g(t).state.userInfo.username),1)]),y("div",kt,[s(m,{class:"logout",quaternary:"",circle:"",onClick:v},{icon:r(()=>[s(g(V),{size:24},{default:r(()=>[s(g(se))]),_:1})]),_:1})])])):(w(),R("div",Pt,[b.value?U("",!0):(w(),R("div",Lt,[s(m,{strong:"",secondary:"",round:"",type:"primary",onClick:E[0]||(E[0]=z=>P("signin"))},{default:r(()=>[S(" 登录 ")]),_:1})])),b.value?(w(),R("div",Ot,[s(m,{strong:"",secondary:"",round:"",type:"primary",onClick:E[1]||(E[1]=z=>P("signin"))},{default:r(()=>[S(" 登录 ")]),_:1}),s(m,{strong:"",secondary:"",round:"",type:"info",onClick:E[2]||(E[2]=z=>P("signup"))},{default:r(()=>[S(" 注册 ")]),_:1})])):U("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Et={key:0},Rt={class:"content-wrap"},$t=W({__name:"App",setup(e){const t=B(),a=Q(()=>t.state.theme==="dark"?Ke:null);return(i,c)=>{const n=At,d=le("router-view"),p=mt,M=st,f=De,b=Ne,h=xe,u=qe;return w(),D(u,{theme:a.value},{default:r(()=>[s(b,null,{default:r(()=>[s(f,null,{default:r(()=>{var A;return[y("div",{class:ge(["app-container",{dark:((A=a.value)==null?void 0:A.name)==="dark",mobile:!g(t).state.desktopModelShow}])},[y("div",Tt,[g(t).state.desktopModelShow?(w(),R("div",Et,[s(n)])):U("",!0),y("div",Rt,[s(d,{class:"app-wrap"},{default:r(({Component:_})=>[(w(),D(he,null,[i.$route.meta.keepAlive?(w(),D(ee(_),{key:0})):U("",!0)],1024)),i.$route.meta.keepAlive?U("",!0):(w(),D(ee(_),{key:0}))]),_:1})]),s(p)]),s(M)],2)]}),_:1})]),_:1}),s(h)]),_:1},8,["theme"])}}});fe($t).use(me).use(Je).mount("#app");export{Uo as $,ko as A,bo as B,nt as C,Ao as D,Vo as E,So as F,Ro as G,Eo as H,Zo as I,To as J,Io as K,xo as L,No as M,Fo as N,Qo as O,Yo as P,$o as Q,Co as R,Oo as S,H as T,Wo as U,Bo as V,Ho as W,Po as X,Do as Y,qo as Z,_e as _,Go as a,Mo as a0,Ko as a1,Lo as a2,At as a3,no as b,ro as c,Zt as d,zo as e,ho as f,jo as g,wo as h,po as i,mo as j,vo as k,fo as l,go as m,Xt as n,to as o,ao as p,lo as q,co as r,uo as s,_o as t,eo as u,io as v,oo as w,Jt as x,so as y,yo as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js index 0cdceb75..17324807 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-b165919a.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a402eae2.js @@ -1 +1 @@ -import{a3 as A}from"./index-cb280048.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{Z as C,_ as N,$ as P,a0 as D}from"./@vicons-7a4ef312.js";import{u as R,a3 as $,a4 as x,j as H,e as I,a5 as V,h as j}from"./naive-ui-d8de3dda.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as Z}from"./@vue-a481fc63.js";const G={key:0},J={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=$,M=x,r=H,p=I,O=V,S=j;return n(),f(Z,null,[a(o).state.drawerModelShow?(n(),f("div",G,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",J,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; +import{a3 as A}from"./index-8d220080.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{Z as C,_ as N,$ as P,a0 as D}from"./@vicons-7a4ef312.js";import{u as R,a3 as $,a4 as x,j as H,e as I,a5 as V,h as j}from"./naive-ui-d8de3dda.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as Z}from"./@vue-a481fc63.js";const G={key:0},J={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=$,M=x,r=H,p=I,O=V,S=j;return n(),f(Z,null,[a(o).state.drawerModelShow?(n(),f("div",G,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",J,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-00295cef.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-899852f8.js similarity index 98% rename from web/dist/assets/post-item.vue_vue_type_style_index_0_lang-00295cef.js rename to web/dist/assets/post-item.vue_vue_type_style_index_0_lang-899852f8.js index d0598079..56df3cb6 100644 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-00295cef.js +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-899852f8.js @@ -1 +1 @@ -import{p as V,a as E,_ as R,b as Y,c as G}from"./content-64ba0596.js";import{d as J,c as C,r as K,e as a,f,k as n,al as Q,w as o,j as i,F as U,u as W,y as m,bf as l,A as r,x as p,q as u,Y as c,h as x}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{c as ee}from"./formatTime-4210fcd1.js";import{u as te,w as se}from"./index-cb280048.js";import{c as oe}from"./copy-to-clipboard-4ef7d3eb.js";import{i as ne,j as ae,l as le,m as ie,p as ue,o as ce}from"./@vicons-7a4ef312.js";import{j as v,o as re,M as pe,e as _e,O as me,a as ve,L as de}from"./naive-ui-d8de3dda.js";const he={class:"post-item"},ge={class:"nickname-wrap"},ke={class:"username-wrap"},ye={class:"timestamp-mobile"},fe={class:"item-header-extra"},we=["innerHTML"],be=["onClick"],Ce=["onClick"],Ae=J({__name:"mobile-post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>x(v,null,{default:()=>x(t)}),q=C(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=C({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},O=()=>{se({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=E,H=R,B=Y,I=G,N=ve,A=de;return a(),f("div",he,[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",ge,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",ke," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0),i("div",null,[i("span",ye,p(l(ee)(e.value.created_on))+" "+p(e.value.ip_loc),1)])]),"header-extra":o(()=>[i("div",fe,[n(D,{placement:"bottom-end",trigger:"click",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,be),i("div",{class:"opt-item",onClick:s[3]||(s[3]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,Ce)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[i("div",{onClick:s[2]||(s[2]=h=>k(e.value.id))},[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(V)(h.content).content},null,8,we))),128))])]),key:"0"}:void 0]),1024)])}}});const xe={class:"nickname-wrap"},$e={class:"username-wrap"},ze={class:"item-header-extra"},Te={class:"timestamp"},qe=["innerHTML"],Pe=["onClick"],Le=["onClick"],Fe=J({__name:"post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>x(v,null,{default:()=>x(t)}),q=C(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=C({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},O=()=>{se({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=E,H=R,B=Y,I=G,N=ve,A=de;return a(),f("div",{class:"post-item",onClick:s[3]||(s[3]=h=>k(e.value.id))},[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",xe,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",$e," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0)]),"header-extra":o(()=>[i("div",ze,[i("span",Te,p(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+p(l(ee)(e.value.created_on)),1),n(D,{placement:"bottom-end",trigger:"hover",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item hover",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,Pe),i("div",{class:"opt-item hover",onClick:s[2]||(s[2]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item hover",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,Le)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text hover",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(V)(h.content).content},null,8,qe))),128))]),key:"0"}:void 0]),1024)])}}});export{Fe as _,Ae as a}; +import{p as V,a as E,_ as R,b as Y,c as G}from"./content-e3389a3a.js";import{d as J,c as C,r as K,e as a,f,k as n,al as Q,w as o,j as i,F as U,u as W,y as m,bf as l,A as r,x as p,q as u,Y as c,h as x}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{c as ee}from"./formatTime-4210fcd1.js";import{u as te,w as se}from"./index-8d220080.js";import{c as oe}from"./copy-to-clipboard-4ef7d3eb.js";import{i as ne,j as ae,l as le,m as ie,p as ue,o as ce}from"./@vicons-7a4ef312.js";import{j as v,o as re,M as pe,e as _e,O as me,a as ve,L as de}from"./naive-ui-d8de3dda.js";const he={class:"post-item"},ge={class:"nickname-wrap"},ke={class:"username-wrap"},ye={class:"timestamp-mobile"},fe={class:"item-header-extra"},we=["innerHTML"],be=["onClick"],Ce=["onClick"],Ae=J({__name:"mobile-post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>x(v,null,{default:()=>x(t)}),q=C(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=C({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},O=()=>{se({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=E,H=R,B=Y,I=G,N=ve,A=de;return a(),f("div",he,[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",ge,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",ke," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0),i("div",null,[i("span",ye,p(l(ee)(e.value.created_on))+" "+p(e.value.ip_loc),1)])]),"header-extra":o(()=>[i("div",fe,[n(D,{placement:"bottom-end",trigger:"click",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,be),i("div",{class:"opt-item",onClick:s[3]||(s[3]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,Ce)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[i("div",{onClick:s[2]||(s[2]=h=>k(e.value.id))},[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(V)(h.content).content},null,8,we))),128))])]),key:"0"}:void 0]),1024)])}}});const xe={class:"nickname-wrap"},$e={class:"username-wrap"},ze={class:"item-header-extra"},Te={class:"timestamp"},qe=["innerHTML"],Pe=["onClick"],Le=["onClick"],Fe=J({__name:"post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>x(v,null,{default:()=>x(t)}),q=C(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=C({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},O=()=>{se({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=E,H=R,B=Y,I=G,N=ve,A=de;return a(),f("div",{class:"post-item",onClick:s[3]||(s[3]=h=>k(e.value.id))},[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",xe,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",$e," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0)]),"header-extra":o(()=>[i("div",ze,[i("span",Te,p(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+p(l(ee)(e.value.created_on)),1),n(D,{placement:"bottom-end",trigger:"hover",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item hover",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,Pe),i("div",{class:"opt-item hover",onClick:s[2]||(s[2]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item hover",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,Le)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text hover",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(V)(h.content).content},null,8,qe))),128))]),key:"0"}:void 0]),1024)])}}});export{Fe as _,Ae as a}; diff --git a/web/dist/assets/post-skeleton-26b3006b.js b/web/dist/assets/post-skeleton-54a835d7.js similarity index 88% rename from web/dist/assets/post-skeleton-26b3006b.js rename to web/dist/assets/post-skeleton-54a835d7.js index f569abb3..4d1d4b23 100644 --- a/web/dist/assets/post-skeleton-26b3006b.js +++ b/web/dist/assets/post-skeleton-54a835d7.js @@ -1 +1 @@ -import{U as r}from"./naive-ui-d8de3dda.js";import{d as c,e as s,f as n,u as p,j as o,k as t,F as l}from"./@vue-a481fc63.js";import{_ as i}from"./index-cb280048.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; +import{U as r}from"./naive-ui-d8de3dda.js";import{d as c,e as s,f as n,u as p,j as o,k as t,F as l}from"./@vue-a481fc63.js";import{_ as i}from"./index-8d220080.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/assets/whisper-31e5b9ad.js b/web/dist/assets/whisper-f9793dd1.js similarity index 95% rename from web/dist/assets/whisper-31e5b9ad.js rename to web/dist/assets/whisper-f9793dd1.js index 94934c87..e131fb55 100644 --- a/web/dist/assets/whisper-31e5b9ad.js +++ b/web/dist/assets/whisper-f9793dd1.js @@ -1 +1 @@ -import{S as b,_ as k}from"./index-cb280048.js";import{R as B,H as C,S as N,b as R,e as S,i as U}from"./naive-ui-d8de3dda.js";import{d as V,H as p,e as $,q as z,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";const H={class:"whisper-wrap"},W={class:"whisper-line"},j={class:"whisper-line send-wrap"},q=V({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=B,w=C,f=N,v=R,g=S,y=U;return $(),z(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",H,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",W,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",j,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const M=k(q,[["__scopeId","data-v-0cbfe47c"]]);export{M as _}; +import{S as b,_ as k}from"./index-8d220080.js";import{R as B,H as C,S as N,b as R,e as S,i as U}from"./naive-ui-d8de3dda.js";import{d as V,H as p,e as $,q as z,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";const H={class:"whisper-wrap"},W={class:"whisper-line"},j={class:"whisper-line send-wrap"},q=V({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=B,w=C,f=N,v=R,g=S,y=U;return $(),z(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",H,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",W,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",j,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const M=k(q,[["__scopeId","data-v-0cbfe47c"]]);export{M as _}; diff --git a/web/dist/index.html b/web/dist/index.html index bfe6e8ca..76b090bf 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/components/post-detail.vue b/web/src/components/post-detail.vue index 144c73aa..75b599b7 100644 --- a/web/src/components/post-detail.vue +++ b/web/src/components/post-detail.vue @@ -355,14 +355,13 @@ const renderIcon = (icon: Component) => { }; const adminOptions = computed(() => { - let options: DropdownOption[] = [ - { + let options: DropdownOption[] = []; + if (!store.state.userInfo.is_admin && store.state.userInfo.id != props.post.user.id) { + options.push({ label: '私信', key: 'whisper', icon: renderIcon(PaperPlaneOutline) - }, - ]; - if (!store.state.userInfo.is_admin && store.state.userInfo.id != props.post.user.id) { + }); return options; } options.push({