From decc0eb7158a1df13154e9d9da09c202f1f26f12 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Fri, 28 Apr 2023 22:35:52 +0800 Subject: [PATCH] frontend: ajust index page display --- web/dist/assets/{404-55fd2878.js => 404-adce0e88.js} | 2 +- .../assets/{Anouncement-5bb39360.js => Anouncement-38edf4be.js} | 2 +- .../assets/{Collection-c3a6d815.js => Collection-9c6b07e0.js} | 2 +- web/dist/assets/{Contacts-774b9ff5.js => Contacts-e7ae0ddf.js} | 2 +- web/dist/assets/{Home-635b1403.js => Home-842a0689.js} | 2 +- web/dist/assets/{Messages-f3f6acae.js => Messages-b7a5e991.js} | 2 +- web/dist/assets/{Post-9fdb3280.js => Post-ad38db7b.js} | 2 +- web/dist/assets/{Profile-20bcef92.js => Profile-373e91c0.js} | 2 +- web/dist/assets/{Setting-b9175f11.js => Setting-62b2e199.js} | 2 +- web/dist/assets/{Topic-69ad069c.js => Topic-70be769e.js} | 2 +- web/dist/assets/{User-b8b6d21c.js => User-556bdfe3.js} | 2 +- web/dist/assets/{Wallet-cef6a923.js => Wallet-9f12aaf1.js} | 2 +- web/dist/assets/{content-be850479.js => content-13239b6c.js} | 2 +- web/dist/assets/{index-71725d26.js => index-ddd65805.js} | 2 +- ....js => main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js} | 2 +- .../post-item.vue_vue_type_style_index_0_lang-2d543dae.js | 1 - .../post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js | 1 + .../{post-skeleton-ce689406.js => post-skeleton-a319fe06.js} | 2 +- web/dist/index.html | 2 +- web/src/components/post-item.vue | 2 +- 20 files changed, 19 insertions(+), 19 deletions(-) rename web/dist/assets/{404-55fd2878.js => 404-adce0e88.js} (84%) rename web/dist/assets/{Anouncement-5bb39360.js => Anouncement-38edf4be.js} (91%) rename web/dist/assets/{Collection-c3a6d815.js => Collection-9c6b07e0.js} (83%) rename web/dist/assets/{Contacts-774b9ff5.js => Contacts-e7ae0ddf.js} (93%) rename web/dist/assets/{Home-635b1403.js => Home-842a0689.js} (97%) rename web/dist/assets/{Messages-f3f6acae.js => Messages-b7a5e991.js} (97%) rename web/dist/assets/{Post-9fdb3280.js => Post-ad38db7b.js} (99%) rename web/dist/assets/{Profile-20bcef92.js => Profile-373e91c0.js} (84%) rename web/dist/assets/{Setting-b9175f11.js => Setting-62b2e199.js} (97%) rename web/dist/assets/{Topic-69ad069c.js => Topic-70be769e.js} (97%) rename web/dist/assets/{User-b8b6d21c.js => User-556bdfe3.js} (96%) rename web/dist/assets/{Wallet-cef6a923.js => Wallet-9f12aaf1.js} (96%) rename web/dist/assets/{content-be850479.js => content-13239b6c.js} (99%) rename web/dist/assets/{index-71725d26.js => index-ddd65805.js} (90%) rename web/dist/assets/{main-nav.vue_vue_type_style_index_0_lang-8c788975.js => main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js} (96%) delete mode 100644 web/dist/assets/post-item.vue_vue_type_style_index_0_lang-2d543dae.js create mode 100644 web/dist/assets/post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js rename web/dist/assets/{post-skeleton-ce689406.js => post-skeleton-a319fe06.js} (88%) diff --git a/web/dist/assets/404-55fd2878.js b/web/dist/assets/404-adce0e88.js similarity index 84% rename from web/dist/assets/404-55fd2878.js rename to web/dist/assets/404-adce0e88.js index 8bb16b71..0ec70068 100644 --- a/web/dist/assets/404-55fd2878.js +++ b/web/dist/assets/404-adce0e88.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{u as a}from"./vue-router-88cc84d1.js";import{F as i,e as c,a2 as u}from"./naive-ui-2035804c.js";import{d as l,c as d,L as t,$ as o,o as f,e as x}from"./@vue-ca177dbe.js";import{_ as g}from"./index-71725d26.js";import"./vuex-d28e9067.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-a45d17e4.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{u as a}from"./vue-router-88cc84d1.js";import{F as i,e as c,a2 as u}from"./naive-ui-2035804c.js";import{d as l,c as d,L as t,$ as o,o as f,e as x}from"./@vue-ca177dbe.js";import{_ as g}from"./index-ddd65805.js";import"./vuex-d28e9067.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-a45d17e4.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; diff --git a/web/dist/assets/Anouncement-5bb39360.js b/web/dist/assets/Anouncement-38edf4be.js similarity index 91% rename from web/dist/assets/Anouncement-5bb39360.js rename to web/dist/assets/Anouncement-38edf4be.js index 2160521f..9ed39c85 100644 --- a/web/dist/assets/Anouncement-5bb39360.js +++ b/web/dist/assets/Anouncement-38edf4be.js @@ -1 +1 @@ -import{_ as F}from"./post-skeleton-ce689406.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{u as z}from"./vuex-d28e9067.js";import{b as A}from"./vue-router-88cc84d1.js";import{a as R}from"./formatTime-000dbebb.js";import{d as S,r as n,j as V,c as o,L as a,$ as p,o as e,Y as u,O as l,F as I,a2 as L,K as M,a as s,M as _,a4 as O}from"./@vue-ca177dbe.js";import{F as P,G as $,I as j,H as q}from"./naive-ui-2035804c.js";import{_ as D}from"./index-71725d26.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-a45d17e4.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";/* empty css */const E={key:0,class:"pagination-wrap"},G={key:0,class:"skeleton-wrap"},H={key:1},K={key:0,class:"empty-wrap"},T={class:"bill-line"},U=S({__name:"Anouncement",setup(Y){const d=z(),g=A(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return V(()=>{}),(m,J)=>{const y=N,k=$,x=F,w=j,B=q,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",E,[a(k,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",G,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",H,[r.value.length===0?(e(),o("div",K,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",T,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(R)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=D(U,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; +import{_ as F}from"./post-skeleton-a319fe06.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{u as z}from"./vuex-d28e9067.js";import{b as A}from"./vue-router-88cc84d1.js";import{a as R}from"./formatTime-000dbebb.js";import{d as S,r as n,j as V,c as o,L as a,$ as p,o as e,Y as u,O as l,F as I,a2 as L,K as M,a as s,M as _,a4 as O}from"./@vue-ca177dbe.js";import{F as P,G as $,I as j,H as q}from"./naive-ui-2035804c.js";import{_ as D}from"./index-ddd65805.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-a45d17e4.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";/* empty css */const E={key:0,class:"pagination-wrap"},G={key:0,class:"skeleton-wrap"},H={key:1},K={key:0,class:"empty-wrap"},T={class:"bill-line"},U=S({__name:"Anouncement",setup(Y){const d=z(),g=A(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return V(()=>{}),(m,J)=>{const y=N,k=$,x=F,w=j,B=q,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",E,[a(k,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",G,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",H,[r.value.length===0?(e(),o("div",K,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",T,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(R)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=D(U,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; diff --git a/web/dist/assets/Collection-c3a6d815.js b/web/dist/assets/Collection-9c6b07e0.js similarity index 83% rename from web/dist/assets/Collection-c3a6d815.js rename to web/dist/assets/Collection-9c6b07e0.js index 70652fe4..30e31894 100644 --- a/web/dist/assets/Collection-c3a6d815.js +++ b/web/dist/assets/Collection-9c6b07e0.js @@ -1 +1 @@ -import{_ as z}from"./post-item.vue_vue_type_style_index_0_lang-2d543dae.js";import{_ as B}from"./post-skeleton-ce689406.js";import{_ as F}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{u as P}from"./vuex-d28e9067.js";import{b as R,u as $}from"./vue-router-88cc84d1.js";import{K as b,_ as I}from"./index-71725d26.js";import{d as K,r as a,j as L,c as e,L as n,$ as m,Y as M,O as u,o as t,F as N,a2 as S,K as V}from"./@vue-ca177dbe.js";import{F as j,G as q,I as E,H as G}from"./naive-ui-2035804c.js";import"./content-be850479.js";import"./@vicons-a45d17e4.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const H={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={key:0,class:"pagination-wrap"},Y=K({__name:"Collection",setup(A){const d=P(),g=R();$();const s=a(!1),p=a([]),_=a(+g.query.p||1),i=a(20),r=a(0),l=()=>{s.value=!0,b({page:_.value,page_size:i.value}).then(o=>{s.value=!1,p.value=o.list,r.value=Math.ceil(o.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(o=>{s.value=!1})},v=o=>{_.value=o,l()};return L(()=>{l()}),(o,D)=>{const f=F,h=B,k=E,y=z,w=G,C=j,x=q;return t(),e("div",null,[n(f,{title:"收藏"}),n(C,{class:"main-content-wrap",bordered:""},{default:m(()=>[s.value?(t(),e("div",H,[n(h,{num:i.value},null,8,["num"])])):(t(),e("div",O,[p.value.length===0?(t(),e("div",T,[n(k,{size:"large",description:"暂无数据"})])):u("",!0),(t(!0),e(N,null,S(p.value,c=>(t(),V(w,{key:c.id},{default:m(()=>[n(y,{post:c},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),r.value>0?(t(),e("div",U,[n(x,{page:_.value,"onUpdate:page":v,"page-slot":M(d).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):u("",!0)])}}});const Bt=I(Y,[["__scopeId","data-v-1e709369"]]);export{Bt as default}; +import{_ as z}from"./post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js";import{_ as B}from"./post-skeleton-a319fe06.js";import{_ as F}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{u as P}from"./vuex-d28e9067.js";import{b as R,u as $}from"./vue-router-88cc84d1.js";import{K as b,_ as I}from"./index-ddd65805.js";import{d as K,r as a,j as L,c as e,L as n,$ as m,Y as M,O as u,o as t,F as N,a2 as S,K as V}from"./@vue-ca177dbe.js";import{F as j,G as q,I as E,H as G}from"./naive-ui-2035804c.js";import"./content-13239b6c.js";import"./@vicons-a45d17e4.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const H={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={key:0,class:"pagination-wrap"},Y=K({__name:"Collection",setup(A){const d=P(),g=R();$();const s=a(!1),p=a([]),_=a(+g.query.p||1),i=a(20),r=a(0),l=()=>{s.value=!0,b({page:_.value,page_size:i.value}).then(o=>{s.value=!1,p.value=o.list,r.value=Math.ceil(o.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(o=>{s.value=!1})},v=o=>{_.value=o,l()};return L(()=>{l()}),(o,D)=>{const f=F,h=B,k=E,y=z,w=G,C=j,x=q;return t(),e("div",null,[n(f,{title:"收藏"}),n(C,{class:"main-content-wrap",bordered:""},{default:m(()=>[s.value?(t(),e("div",H,[n(h,{num:i.value},null,8,["num"])])):(t(),e("div",O,[p.value.length===0?(t(),e("div",T,[n(k,{size:"large",description:"暂无数据"})])):u("",!0),(t(!0),e(N,null,S(p.value,c=>(t(),V(w,{key:c.id},{default:m(()=>[n(y,{post:c},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),r.value>0?(t(),e("div",U,[n(x,{page:_.value,"onUpdate:page":v,"page-slot":M(d).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):u("",!0)])}}});const Bt=I(Y,[["__scopeId","data-v-1e709369"]]);export{Bt as default}; diff --git a/web/dist/assets/Contacts-774b9ff5.js b/web/dist/assets/Contacts-e7ae0ddf.js similarity index 93% rename from web/dist/assets/Contacts-774b9ff5.js rename to web/dist/assets/Contacts-e7ae0ddf.js index 04e86e7f..4f5231d9 100644 --- a/web/dist/assets/Contacts-774b9ff5.js +++ b/web/dist/assets/Contacts-e7ae0ddf.js @@ -1 +1 @@ -import{u as M,b as P}from"./vue-router-88cc84d1.js";import{d as b,o as t,c as n,a,L as s,M as v,r as i,j as R,$ as h,Y as S,O as y,F as k,a2 as U,K as V}from"./@vue-ca177dbe.js";import{o as q,F as D,G as L,I as T,H as j}from"./naive-ui-2035804c.js";import{_ as C,N as E}from"./index-71725d26.js";import{_ as G}from"./post-skeleton-ce689406.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{u as K}from"./vuex-d28e9067.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";import"./@vicons-a45d17e4.js";/* empty css */const O={class:"avatar"},Y={class:"base-info"},A={class:"username"},J={class:"uid"},Q=b({__name:"contact-item",props:{contact:null},setup(c){const p=M(),m=e=>{p.push({name:"user",query:{username:e}})};return(e,o)=>{const _=q;return t(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=l=>m(c.contact.username))},[a("div",O,[s(_,{size:"large",src:c.contact.avatar},null,8,["src"])]),a("div",Y,[a("div",A,[a("strong",null,v(c.contact.nickname),1),a("span",null," @"+v(c.contact.username),1)]),a("div",J,"UID. "+v(c.contact.user_id),1)])])}}});const W=C(Q,[["__scopeId","data-v-08ee9b2e"]]),X={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=b({__name:"Contacts",setup(c){const p=K(),m=P(),e=i(!1),o=i([]),_=i(+m.query.p||1),l=i(20),d=i(0),$=r=>{_.value=r,g()};R(()=>{g()});const g=(r=!1)=>{o.value.length===0&&(e.value=!0),E({page:_.value,page_size:l.value}).then(u=>{e.value=!1,o.value=u.list,d.value=Math.ceil(u.pager.total_rows/l.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(u=>{e.value=!1})};return(r,u)=>{const w=H,x=G,I=T,z=W,B=j,N=D,F=L;return t(),n(k,null,[a("div",null,[s(w,{title:"好友"}),s(N,{class:"main-content-wrap",bordered:""},{default:h(()=>[e.value?(t(),n("div",X,[s(x,{num:l.value},null,8,["num"])])):(t(),n("div",Z,[o.value.length===0?(t(),n("div",tt,[s(I,{size:"large",description:"暂无数据"})])):y("",!0),(t(!0),n(k,null,U(o.value,f=>(t(),V(B,{key:f.user_id},{default:h(()=>[s(z,{contact:f},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(t(),n("div",et,[s(F,{page:_.value,"onUpdate:page":$,"page-slot":S(p).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):y("",!0)],64)}}});const It=C(ot,[["__scopeId","data-v-3b2bf978"]]);export{It as default}; +import{u as M,b as P}from"./vue-router-88cc84d1.js";import{d as b,o as t,c as n,a,L as s,M as v,r as i,j as R,$ as h,Y as S,O as y,F as k,a2 as U,K as V}from"./@vue-ca177dbe.js";import{o as q,F as D,G as L,I as T,H as j}from"./naive-ui-2035804c.js";import{_ as C,N as E}from"./index-ddd65805.js";import{_ as G}from"./post-skeleton-a319fe06.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{u as K}from"./vuex-d28e9067.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-707ed124.js";import"./@vicons-a45d17e4.js";/* empty css */const O={class:"avatar"},Y={class:"base-info"},A={class:"username"},J={class:"uid"},Q=b({__name:"contact-item",props:{contact:null},setup(c){const p=M(),m=e=>{p.push({name:"user",query:{username:e}})};return(e,o)=>{const _=q;return t(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=l=>m(c.contact.username))},[a("div",O,[s(_,{size:"large",src:c.contact.avatar},null,8,["src"])]),a("div",Y,[a("div",A,[a("strong",null,v(c.contact.nickname),1),a("span",null," @"+v(c.contact.username),1)]),a("div",J,"UID. "+v(c.contact.user_id),1)])])}}});const W=C(Q,[["__scopeId","data-v-08ee9b2e"]]),X={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=b({__name:"Contacts",setup(c){const p=K(),m=P(),e=i(!1),o=i([]),_=i(+m.query.p||1),l=i(20),d=i(0),$=r=>{_.value=r,g()};R(()=>{g()});const g=(r=!1)=>{o.value.length===0&&(e.value=!0),E({page:_.value,page_size:l.value}).then(u=>{e.value=!1,o.value=u.list,d.value=Math.ceil(u.pager.total_rows/l.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(u=>{e.value=!1})};return(r,u)=>{const w=H,x=G,I=T,z=W,B=j,N=D,F=L;return t(),n(k,null,[a("div",null,[s(w,{title:"好友"}),s(N,{class:"main-content-wrap",bordered:""},{default:h(()=>[e.value?(t(),n("div",X,[s(x,{num:l.value},null,8,["num"])])):(t(),n("div",Z,[o.value.length===0?(t(),n("div",tt,[s(I,{size:"large",description:"暂无数据"})])):y("",!0),(t(!0),n(k,null,U(o.value,f=>(t(),V(B,{key:f.user_id},{default:h(()=>[s(z,{contact:f},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(t(),n("div",et,[s(F,{page:_.value,"onUpdate:page":$,"page-slot":S(p).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):y("",!0)],64)}}});const It=C(ot,[["__scopeId","data-v-3b2bf978"]]);export{It as default}; diff --git a/web/dist/assets/Home-635b1403.js b/web/dist/assets/Home-842a0689.js similarity index 97% rename from web/dist/assets/Home-635b1403.js rename to web/dist/assets/Home-842a0689.js index f187c2cc..04109f54 100644 --- a/web/dist/assets/Home-635b1403.js +++ b/web/dist/assets/Home-842a0689.js @@ -1 +1 @@ -import{_ as qe}from"./post-item.vue_vue_type_style_index_0_lang-2d543dae.js";import{_ as Ie}from"./post-skeleton-ce689406.js";import{d as Q,r as l,j as X,o as c,c as v,Y as $,a as I,L as t,$ as s,K as N,O as q,a0 as K,e as z,M as G,F as Y,a2 as W,n as Te,w as Ue}from"./@vue-ca177dbe.js";import{u as Z}from"./vuex-d28e9067.js";import{l as J}from"./lodash-3329902d.js";import{g as xe,a as Ee,c as Re,b as Le,_ as ze}from"./index-71725d26.js";import{p as Ae}from"./content-be850479.js";import{V as T,P as S}from"./IEnum-a180d93e.js";import{I as Pe,V as Se,A as Ne,d as Ve,E as Be}from"./@vicons-a45d17e4.js";import{o as Oe,v as Me,j as Fe,e as De,w as je,x as He,y as Ke,z as Ge,A as Je,B as Qe,C as Xe,a as Ye,D as We,E as Ze,F as et,G as tt,H as at,I as ot}from"./naive-ui-2035804c.js";import{_ as nt}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{b as st,u as lt}from"./vue-router-88cc84d1.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./nonesir-video-db921567.js";const it={key:0,class:"compose-wrap"},ut={class:"compose-line"},rt={class:"compose-user"},ct={class:"compose-line compose-options"},pt={class:"attachment"},_t={class:"submit-wrap"},dt={class:"attachment-list-wrap"},mt={key:0,class:"attachment-price-wrap"},vt=I("span",null," 附件价格¥",-1),gt={key:0,class:"eye-wrap"},ft={key:1,class:"link-wrap"},yt={key:1,class:"compose-wrap"},ht=I("div",{class:"login-wrap"},[I("span",{class:"login-banner"}," 登录后,精彩更多")],-1),wt={key:0,class:"login-only-wrap"},bt={key:1,class:"login-wrap"},kt=Q({__name:"compose",emits:["post-success"],setup(ee,{emit:V}){const r=Z(),E=l([]),y=l(!1),h=l(!1),f=l(!1),w=l(!1),b=l(""),U=l([]),R=l(),A=l(0),d=l("public/image"),i=l([]),g=l([]),k=l([]),m=l([]),C=l(T.FRIEND),x=l(T.FRIEND),M=[{value:T.PUBLIC,label:"公开"},{value:T.PRIVATE,label:"私密"},{value:T.FRIEND,label:"好友可见"}],P=+"300",B=l("true".toLowerCase()==="true"),F=l("true".toLowerCase()==="true"),O=l("true".toLowerCase()==="true"),te=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),oe="/v1/attachment",H=l(),ne=()=>{f.value=!f.value,f.value&&w.value&&(w.value=!1)},se=()=>{w.value=!w.value,w.value&&f.value&&(f.value=!1)},le=J.debounce(a=>{xe({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ie=J.debounce(a=>{Ee({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ue=(a,e)=>{y.value||(y.value=!0,e==="@"?le(a):ie(a))},re=a=>{a.length>P||(b.value=a)},D=a=>{d.value=a},ce=a=>{i.value=a},pe=async a=>{var e,n,o,u,_,L;return d.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=a.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):d.value==="image"&&((n=a.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):d.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=a.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):d.value==="public/video"&&((u=a.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):d.value==="attachment"&&!["application/zip"].includes((_=a.file.file)==null?void 0:_.type)?(window.$message.warning("附件仅允许 zip 格式"),!1):d.value==="attachment"&&((L=a.file.file)==null?void 0:L.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(d.value==="public/image"&&g.value.push({id:a.id,content:o.data.content}),d.value==="public/video"&&k.value.push({id:a.id,content:o.data.content}),d.value==="attachment"&&m.value.push({id:a.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let u=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(_=>{u+=":"+_}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},me=({file:a})=>{let e=g.value.findIndex(n=>n.id===a.id);e>-1&&g.value.splice(e,1),e=k.value.findIndex(n=>n.id===a.id),e>-1&&k.value.splice(e,1),e=m.value.findIndex(n=>n.id===a.id),e>-1&&m.value.splice(e,1)},ve=()=>{if(b.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:a,users:e}=Ae(b.value);const n=[];let o=100;n.push({content:b.value,type:S.TEXT,sort:o}),g.value.map(u=>{o++,n.push({content:u.content,type:S.IMAGEURL,sort:o})}),k.value.map(u=>{o++,n.push({content:u.content,type:S.VIDEOURL,sort:o})}),m.value.map(u=>{o++,n.push({content:u.content,type:S.ATTACHMENT,sort:o})}),U.value.length>0&&U.value.map(u=>{o++,n.push({content:u,type:S.LINKURL,sort:o})}),h.value=!0,Re({contents:n,tags:Array.from(new Set(a)),users:Array.from(new Set(e)),attachment_price:+A.value*100,visibility:C.value}).then(u=>{var _;window.$message.success("发布成功"),h.value=!1,V("post-success",u),f.value=!1,w.value=!1,(_=R.value)==null||_.clear(),i.value=[],b.value="",U.value=[],g.value=[],k.value=[],m.value=[],C.value=x.value}).catch(u=>{h.value=!1})},j=a=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",a)};return X(()=>{"friend".toLowerCase()==="friend"?x.value=T.FRIEND:"friend".toLowerCase()==="public"?x.value=T.PUBLIC:x.value=T.PRIVATE,C.value=x.value,H.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(a,e)=>{const n=Oe,o=Me,u=Fe,_=De,L=je,ge=He,fe=Ke,ye=Ge,he=Je,we=Qe,be=Xe,ke=Ye,Ce=We,$e=Ze;return c(),v("div",null,[$(r).state.userInfo.id>0?(c(),v("div",it,[I("div",ut,[I("div",rt,[t(n,{round:"",size:30,src:$(r).state.userInfo.avatar},null,8,["src"])]),t(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:y.value,value:b.value,prefix:["@","#"],options:E.value,onSearch:ue,"onUpdate:value":re,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),t(we,{ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:H.value},data:{type:d.value},onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[I("div",ct,[I("div",pt,[t(L,{abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value==="public/video"||i.value.length===9,onClick:()=>{D("public/image"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Pe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),F.value?(c(),N(L,{key:0,abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value!=="public/video"||i.value.length===9,onClick:()=>{D("public/video"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):q("",!0),O.value?(c(),N(L,{key:1,abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value==="public/video"||i.value.length===9,onClick:()=>{D("attachment"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):q("",!0),t(_,{quaternary:"",circle:"",type:"primary",onClick:K(ne,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ve))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),N(_,{key:2,quaternary:"",circle:"",type:"primary",onClick:K(se,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Be))]),_:1})]),_:1},8,["onClick"])):q("",!0)]),I("div",_t,[t(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[t(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:b.value.length/$(P)*100},null,8,["percentage"])]),default:s(()=>[z(" "+G(b.value.length)+" / "+G($(P)),1)]),_:1}),t(_,{loading:h.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[z(" 发布 ")]),_:1},8,["loading"])])]),I("div",dt,[t(ye),m.value.length>0?(c(),v("div",mt,[te.value?(c(),N(he,{key:0,value:A.value,"onUpdate:value":e[0]||(e[0]=p=>A.value=p),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[vt]),_:1},8,["value"])):q("",!0)])):q("",!0)])]),_:1},8,["headers","data"]),w.value?(c(),v("div",gt,[t(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=p=>C.value=p),name:"radiogroup"},{default:s(()=>[t(ke,null,{default:s(()=>[(c(),v(Y,null,W(M,p=>t(be,{key:p.value,value:p.value,label:p.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):q("",!0),f.value?(c(),v("div",ft,[t($e,{value:U.value,"onUpdate:value":e[2]||(e[2]=p=>U.value=p),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[z(" 创建链接 ")]),_:1},8,["value"])])):q("",!0)])):(c(),v("div",yt,[ht,B.value?q("",!0):(c(),v("div",wt,[t(_,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=p=>j("signin"))},{default:s(()=>[z(" 登录 ")]),_:1})])),B.value?(c(),v("div",bt,[t(_,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=p=>j("signin"))},{default:s(()=>[z(" 登录 ")]),_:1}),t(_,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=p=>j("signup"))},{default:s(()=>[z(" 注册 ")]),_:1})])):q("",!0)]))])}}});const Ct={key:0,class:"skeleton-wrap"},$t={key:1},qt={key:0,class:"empty-wrap"},It={key:0,class:"pagination-wrap"},Tt=Q({__name:"Home",setup(ee){const V=Z(),r=st(),E=lt(),y=l(!1),h=l([]),f=l(+r.query.p||1),w=l(20),b=l(0),U=Te(()=>{let i="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?i="#"+decodeURIComponent(r.query.q):i="搜索: "+decodeURIComponent(r.query.q)),i}),R=()=>{y.value=!0,Le({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:f.value,page_size:w.value}).then(i=>{y.value=!1,h.value=i.list,b.value=Math.ceil(i.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(i=>{y.value=!1})},A=i=>{if(f.value!=1){E.push({name:"post",query:{id:i.id}});return}let g=[],k=h.value.length;k==w.value&&k--;for(var m=0;m{E.push({name:"home",query:{...r.query,p:i}})};return X(()=>{R()}),Ue(()=>({path:r.path,query:r.query,refresh:V.state.refresh}),(i,g)=>{if(i.refresh!==g.refresh){f.value=+r.query.p||1,setTimeout(()=>{R()},0);return}g.path!=="/post"&&i.path==="/"&&(f.value=+r.query.p||1,setTimeout(()=>{R()},0))}),(i,g)=>{const k=nt,m=kt,C=at,x=Ie,M=ot,P=qe,B=et,F=tt;return c(),v("div",null,[t(k,{title:$(U)},null,8,["title"]),t(B,{class:"main-content-wrap",bordered:""},{default:s(()=>[t(C,null,{default:s(()=>[t(m,{onPostSuccess:A})]),_:1}),y.value?(c(),v("div",Ct,[t(x,{num:w.value},null,8,["num"])])):(c(),v("div",$t,[h.value.length===0?(c(),v("div",qt,[t(M,{size:"large",description:"暂无数据"})])):q("",!0),(c(!0),v(Y,null,W(h.value,O=>(c(),N(C,{key:O.id},{default:s(()=>[t(P,{post:O},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),b.value>0?(c(),v("div",It,[t(F,{page:f.value,"onUpdate:page":d,"page-slot":$(V).state.collapsedRight?5:8,"page-count":b.value},null,8,["page","page-slot","page-count"])])):q("",!0)])}}});const la=ze(Tt,[["__scopeId","data-v-936146f2"]]);export{la as default}; +import{_ as qe}from"./post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js";import{_ as Ie}from"./post-skeleton-a319fe06.js";import{d as Q,r as l,j as X,o as c,c as v,Y as $,a as I,L as t,$ as s,K as N,O as q,a0 as K,e as z,M as G,F as Y,a2 as W,n as Te,w as Ue}from"./@vue-ca177dbe.js";import{u as Z}from"./vuex-d28e9067.js";import{l as J}from"./lodash-3329902d.js";import{g as xe,a as Ee,c as Re,b as Le,_ as ze}from"./index-ddd65805.js";import{p as Ae}from"./content-13239b6c.js";import{V as T,P as S}from"./IEnum-a180d93e.js";import{I as Pe,V as Se,A as Ne,d as Ve,E as Be}from"./@vicons-a45d17e4.js";import{o as Oe,v as Me,j as Fe,e as De,w as je,x as He,y as Ke,z as Ge,A as Je,B as Qe,C as Xe,a as Ye,D as We,E as Ze,F as et,G as tt,H as at,I as ot}from"./naive-ui-2035804c.js";import{_ as nt}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{b as st,u as lt}from"./vue-router-88cc84d1.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./nonesir-video-db921567.js";const it={key:0,class:"compose-wrap"},ut={class:"compose-line"},rt={class:"compose-user"},ct={class:"compose-line compose-options"},pt={class:"attachment"},_t={class:"submit-wrap"},dt={class:"attachment-list-wrap"},mt={key:0,class:"attachment-price-wrap"},vt=I("span",null," 附件价格¥",-1),gt={key:0,class:"eye-wrap"},ft={key:1,class:"link-wrap"},yt={key:1,class:"compose-wrap"},ht=I("div",{class:"login-wrap"},[I("span",{class:"login-banner"}," 登录后,精彩更多")],-1),wt={key:0,class:"login-only-wrap"},bt={key:1,class:"login-wrap"},kt=Q({__name:"compose",emits:["post-success"],setup(ee,{emit:V}){const r=Z(),E=l([]),y=l(!1),h=l(!1),f=l(!1),w=l(!1),b=l(""),U=l([]),R=l(),A=l(0),d=l("public/image"),i=l([]),g=l([]),k=l([]),m=l([]),C=l(T.FRIEND),x=l(T.FRIEND),M=[{value:T.PUBLIC,label:"公开"},{value:T.PRIVATE,label:"私密"},{value:T.FRIEND,label:"好友可见"}],P=+"300",B=l("true".toLowerCase()==="true"),F=l("true".toLowerCase()==="true"),O=l("true".toLowerCase()==="true"),te=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),oe="/v1/attachment",H=l(),ne=()=>{f.value=!f.value,f.value&&w.value&&(w.value=!1)},se=()=>{w.value=!w.value,w.value&&f.value&&(f.value=!1)},le=J.debounce(a=>{xe({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ie=J.debounce(a=>{Ee({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ue=(a,e)=>{y.value||(y.value=!0,e==="@"?le(a):ie(a))},re=a=>{a.length>P||(b.value=a)},D=a=>{d.value=a},ce=a=>{i.value=a},pe=async a=>{var e,n,o,u,_,L;return d.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=a.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):d.value==="image"&&((n=a.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):d.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=a.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):d.value==="public/video"&&((u=a.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):d.value==="attachment"&&!["application/zip"].includes((_=a.file.file)==null?void 0:_.type)?(window.$message.warning("附件仅允许 zip 格式"),!1):d.value==="attachment"&&((L=a.file.file)==null?void 0:L.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(d.value==="public/image"&&g.value.push({id:a.id,content:o.data.content}),d.value==="public/video"&&k.value.push({id:a.id,content:o.data.content}),d.value==="attachment"&&m.value.push({id:a.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let u=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(_=>{u+=":"+_}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},me=({file:a})=>{let e=g.value.findIndex(n=>n.id===a.id);e>-1&&g.value.splice(e,1),e=k.value.findIndex(n=>n.id===a.id),e>-1&&k.value.splice(e,1),e=m.value.findIndex(n=>n.id===a.id),e>-1&&m.value.splice(e,1)},ve=()=>{if(b.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:a,users:e}=Ae(b.value);const n=[];let o=100;n.push({content:b.value,type:S.TEXT,sort:o}),g.value.map(u=>{o++,n.push({content:u.content,type:S.IMAGEURL,sort:o})}),k.value.map(u=>{o++,n.push({content:u.content,type:S.VIDEOURL,sort:o})}),m.value.map(u=>{o++,n.push({content:u.content,type:S.ATTACHMENT,sort:o})}),U.value.length>0&&U.value.map(u=>{o++,n.push({content:u,type:S.LINKURL,sort:o})}),h.value=!0,Re({contents:n,tags:Array.from(new Set(a)),users:Array.from(new Set(e)),attachment_price:+A.value*100,visibility:C.value}).then(u=>{var _;window.$message.success("发布成功"),h.value=!1,V("post-success",u),f.value=!1,w.value=!1,(_=R.value)==null||_.clear(),i.value=[],b.value="",U.value=[],g.value=[],k.value=[],m.value=[],C.value=x.value}).catch(u=>{h.value=!1})},j=a=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",a)};return X(()=>{"friend".toLowerCase()==="friend"?x.value=T.FRIEND:"friend".toLowerCase()==="public"?x.value=T.PUBLIC:x.value=T.PRIVATE,C.value=x.value,H.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(a,e)=>{const n=Oe,o=Me,u=Fe,_=De,L=je,ge=He,fe=Ke,ye=Ge,he=Je,we=Qe,be=Xe,ke=Ye,Ce=We,$e=Ze;return c(),v("div",null,[$(r).state.userInfo.id>0?(c(),v("div",it,[I("div",ut,[I("div",rt,[t(n,{round:"",size:30,src:$(r).state.userInfo.avatar},null,8,["src"])]),t(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:y.value,value:b.value,prefix:["@","#"],options:E.value,onSearch:ue,"onUpdate:value":re,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),t(we,{ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:H.value},data:{type:d.value},onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[I("div",ct,[I("div",pt,[t(L,{abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value==="public/video"||i.value.length===9,onClick:()=>{D("public/image"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Pe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),F.value?(c(),N(L,{key:0,abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value!=="public/video"||i.value.length===9,onClick:()=>{D("public/video"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):q("",!0),O.value?(c(),N(L,{key:1,abstract:""},{default:s(({handleClick:p})=>[t(_,{disabled:i.value.length>0&&d.value==="public/video"||i.value.length===9,onClick:()=>{D("attachment"),p()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):q("",!0),t(_,{quaternary:"",circle:"",type:"primary",onClick:K(ne,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ve))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),N(_,{key:2,quaternary:"",circle:"",type:"primary",onClick:K(se,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Be))]),_:1})]),_:1},8,["onClick"])):q("",!0)]),I("div",_t,[t(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[t(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:b.value.length/$(P)*100},null,8,["percentage"])]),default:s(()=>[z(" "+G(b.value.length)+" / "+G($(P)),1)]),_:1}),t(_,{loading:h.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[z(" 发布 ")]),_:1},8,["loading"])])]),I("div",dt,[t(ye),m.value.length>0?(c(),v("div",mt,[te.value?(c(),N(he,{key:0,value:A.value,"onUpdate:value":e[0]||(e[0]=p=>A.value=p),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[vt]),_:1},8,["value"])):q("",!0)])):q("",!0)])]),_:1},8,["headers","data"]),w.value?(c(),v("div",gt,[t(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=p=>C.value=p),name:"radiogroup"},{default:s(()=>[t(ke,null,{default:s(()=>[(c(),v(Y,null,W(M,p=>t(be,{key:p.value,value:p.value,label:p.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):q("",!0),f.value?(c(),v("div",ft,[t($e,{value:U.value,"onUpdate:value":e[2]||(e[2]=p=>U.value=p),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[z(" 创建链接 ")]),_:1},8,["value"])])):q("",!0)])):(c(),v("div",yt,[ht,B.value?q("",!0):(c(),v("div",wt,[t(_,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=p=>j("signin"))},{default:s(()=>[z(" 登录 ")]),_:1})])),B.value?(c(),v("div",bt,[t(_,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=p=>j("signin"))},{default:s(()=>[z(" 登录 ")]),_:1}),t(_,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=p=>j("signup"))},{default:s(()=>[z(" 注册 ")]),_:1})])):q("",!0)]))])}}});const Ct={key:0,class:"skeleton-wrap"},$t={key:1},qt={key:0,class:"empty-wrap"},It={key:0,class:"pagination-wrap"},Tt=Q({__name:"Home",setup(ee){const V=Z(),r=st(),E=lt(),y=l(!1),h=l([]),f=l(+r.query.p||1),w=l(20),b=l(0),U=Te(()=>{let i="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?i="#"+decodeURIComponent(r.query.q):i="搜索: "+decodeURIComponent(r.query.q)),i}),R=()=>{y.value=!0,Le({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:f.value,page_size:w.value}).then(i=>{y.value=!1,h.value=i.list,b.value=Math.ceil(i.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(i=>{y.value=!1})},A=i=>{if(f.value!=1){E.push({name:"post",query:{id:i.id}});return}let g=[],k=h.value.length;k==w.value&&k--;for(var m=0;m{E.push({name:"home",query:{...r.query,p:i}})};return X(()=>{R()}),Ue(()=>({path:r.path,query:r.query,refresh:V.state.refresh}),(i,g)=>{if(i.refresh!==g.refresh){f.value=+r.query.p||1,setTimeout(()=>{R()},0);return}g.path!=="/post"&&i.path==="/"&&(f.value=+r.query.p||1,setTimeout(()=>{R()},0))}),(i,g)=>{const k=nt,m=kt,C=at,x=Ie,M=ot,P=qe,B=et,F=tt;return c(),v("div",null,[t(k,{title:$(U)},null,8,["title"]),t(B,{class:"main-content-wrap",bordered:""},{default:s(()=>[t(C,null,{default:s(()=>[t(m,{onPostSuccess:A})]),_:1}),y.value?(c(),v("div",Ct,[t(x,{num:w.value},null,8,["num"])])):(c(),v("div",$t,[h.value.length===0?(c(),v("div",qt,[t(M,{size:"large",description:"暂无数据"})])):q("",!0),(c(!0),v(Y,null,W(h.value,O=>(c(),N(C,{key:O.id},{default:s(()=>[t(P,{post:O},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),b.value>0?(c(),v("div",It,[t(F,{page:f.value,"onUpdate:page":d,"page-slot":$(V).state.collapsedRight?5:8,"page-count":b.value},null,8,["page","page-slot","page-count"])])):q("",!0)])}}});const la=ze(Tt,[["__scopeId","data-v-936146f2"]]);export{la as default}; diff --git a/web/dist/assets/Messages-f3f6acae.js b/web/dist/assets/Messages-b7a5e991.js similarity index 97% rename from web/dist/assets/Messages-f3f6acae.js rename to web/dist/assets/Messages-b7a5e991.js index 7364ca6b..01050136 100644 --- a/web/dist/assets/Messages-f3f6acae.js +++ b/web/dist/assets/Messages-b7a5e991.js @@ -1 +1 @@ -import{d as b,a1 as V,o as a,c as o,L as n,$ as i,a as k,a0 as $,e as u,M as g,K as z,O as l,Y as p,a4 as A,a2 as N,F as O,r as y,j as D}from"./@vue-ca177dbe.js";import{u as L,b as G}from"./vue-router-88cc84d1.js";import{G as H,H as P,I as T,_ as F,J as U}from"./index-71725d26.js";import{a as E}from"./formatTime-000dbebb.js";import{q as J,r as K,s as q,t as Y}from"./@vicons-a45d17e4.js";import{o as Q,l as W,j as X,S as Z,L as ee,U as se,F as te,G as ne,I as ae,H as oe}from"./naive-ui-2035804c.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{u as le}from"./vuex-d28e9067.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";const re={class:"sender-wrap"},ce={key:0,class:"nickname"},_e={class:"username"},ue={key:1,class:"nickname"},de={class:"timestamp"},me={class:"timestamp-txt"},pe={key:0,class:"brief-content"},ge={key:1,class:"whisper-content-wrap"},ve={key:2,class:"requesting-friend-wrap"},fe={key:2,class:"status-info"},ye={key:3,class:"status-info"},ke=b({__name:"message-item",props:{message:null},setup(e){const h="https://assets.paopao.info/public/avatar/default/admin.png",w=L(),r=s=>{c(s),(s.type===1||s.type===2||s.type===3)&&(s.post&&s.post.id>0?w.push({name:"post",query:{id:s.post_id}}):window.$message.error("该动态已被删除"))},d=s=>{c(s),H({user_id:s.sender_user_id}).then(t=>{s.reply_id=2,window.$message.success("已同意添加好友")}).catch(t=>{console.log(t)})},v=s=>{c(s),P({user_id:s.sender_user_id}).then(t=>{s.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(t=>{console.log(t)})},c=s=>{s.is_read===0&&T({id:s.id}).then(t=>{s.is_read=1}).catch(t=>{console.log(t)})};return(s,t)=>{const x=Q,_=V("router-link"),I=W,m=X,C=Z,M=ee;return a(),o("div",{class:A(["message-item",{unread:e.message.is_read===0}]),onClick:t[4]||(t[4]=f=>c(e.message))},[n(M,{"content-indented":""},{avatar:i(()=>[n(x,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:h},null,8,["src"])]),header:i(()=>[k("div",re,[e.message.sender_user.id>0?(a(),o("span",ce,[n(_,{onClick:t[0]||(t[0]=$(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:i(()=>[u(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),k("span",_e," @"+g(e.message.sender_user.username),1)])):(a(),o("span",ue," 系统 "))])]),"header-extra":i(()=>[k("span",de,[e.message.is_read===0?(a(),z(I,{key:0,dot:"",processing:""})):l("",!0),k("span",me,g(p(E)(e.message.created_on)),1)])]),description:i(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:i(()=>[e.message.type!=4?(a(),o("div",pe,[u(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),o("span",{key:0,onClick:t[1]||(t[1]=$(f=>r(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(J))]),_:1}),u(" 查看详情 ")])):l("",!0)])):l("",!0),e.message.type===4?(a(),o("div",ge,g(e.message.content),1)):l("",!0),e.message.type===5?(a(),o("div",ve,[u(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),o("span",{key:0,onClick:t[2]||(t[2]=$(f=>d(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(K))]),_:1}),u(" 同意 ")])):l("",!0),e.message.reply_id===1?(a(),o("span",{key:1,onClick:t[3]||(t[3]=$(f=>v(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(q))]),_:1}),u(" 拒绝 ")])):l("",!0),e.message.reply_id===2?(a(),o("span",fe,[n(m,null,{default:i(()=>[n(p(Y))]),_:1}),u(" 已同意 ")])):l("",!0),e.message.reply_id===3?(a(),o("span",ye,[n(m,null,{default:i(()=>[n(p(q))]),_:1}),u(" 已拒绝 ")])):l("",!0)])):l("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const he=F(ke,[["__scopeId","data-v-4a0e27fa"]]),we={class:"content"},$e=b({__name:"message-skeleton",props:{num:{default:1}},setup(e){return(h,w)=>{const r=se;return a(!0),o(O,null,N(new Array(e.num),d=>(a(),o("div",{class:"skeleton-item",key:d},[k("div",we,[n(r,{text:"",repeat:2}),n(r,{text:"",style:{width:"60%"}})])]))),128)}}});const xe=F($e,[["__scopeId","data-v-01d2e871"]]),Ce={key:0,class:"skeleton-wrap"},Me={key:1},be={key:0,class:"empty-wrap"},Fe={key:0,class:"pagination-wrap"},Ie=b({__name:"Messages",setup(e){const h=G(),w=le(),r=y(!1),d=y(+h.query.p||1),v=y(10),c=y(0),s=y([]),t=()=>{r.value=!0,U({page:d.value,page_size:v.value}).then(_=>{r.value=!1,s.value=_.list,c.value=Math.ceil(_.pager.total_rows/v.value)}).catch(_=>{r.value=!1})},x=_=>{d.value=_,t()};return D(()=>{t()}),(_,I)=>{const m=ie,C=xe,M=ae,f=he,R=oe,j=te,B=ne;return a(),o("div",null,[n(m,{title:"消息"}),n(j,{class:"main-content-wrap messages-wrap",bordered:""},{default:i(()=>[r.value?(a(),o("div",Ce,[n(C,{num:v.value},null,8,["num"])])):(a(),o("div",Me,[s.value.length===0?(a(),o("div",be,[n(M,{size:"large",description:"暂无数据"})])):l("",!0),(a(!0),o(O,null,N(s.value,S=>(a(),z(R,{key:S.id},{default:i(()=>[n(f,{message:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),c.value>0?(a(),o("div",Fe,[n(B,{page:d.value,"onUpdate:page":x,"page-slot":p(w).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)])}}});const Ze=F(Ie,[["__scopeId","data-v-4e7b1342"]]);export{Ze as default}; +import{d as b,a1 as V,o as a,c as o,L as n,$ as i,a as k,a0 as $,e as u,M as g,K as z,O as l,Y as p,a4 as A,a2 as N,F as O,r as y,j as D}from"./@vue-ca177dbe.js";import{u as L,b as G}from"./vue-router-88cc84d1.js";import{G as H,H as P,I as T,_ as F,J as U}from"./index-ddd65805.js";import{a as E}from"./formatTime-000dbebb.js";import{q as J,r as K,s as q,t as Y}from"./@vicons-a45d17e4.js";import{o as Q,l as W,j as X,S as Z,L as ee,U as se,F as te,G as ne,I as ae,H as oe}from"./naive-ui-2035804c.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{u as le}from"./vuex-d28e9067.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";const re={class:"sender-wrap"},ce={key:0,class:"nickname"},_e={class:"username"},ue={key:1,class:"nickname"},de={class:"timestamp"},me={class:"timestamp-txt"},pe={key:0,class:"brief-content"},ge={key:1,class:"whisper-content-wrap"},ve={key:2,class:"requesting-friend-wrap"},fe={key:2,class:"status-info"},ye={key:3,class:"status-info"},ke=b({__name:"message-item",props:{message:null},setup(e){const h="https://assets.paopao.info/public/avatar/default/admin.png",w=L(),r=s=>{c(s),(s.type===1||s.type===2||s.type===3)&&(s.post&&s.post.id>0?w.push({name:"post",query:{id:s.post_id}}):window.$message.error("该动态已被删除"))},d=s=>{c(s),H({user_id:s.sender_user_id}).then(t=>{s.reply_id=2,window.$message.success("已同意添加好友")}).catch(t=>{console.log(t)})},v=s=>{c(s),P({user_id:s.sender_user_id}).then(t=>{s.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(t=>{console.log(t)})},c=s=>{s.is_read===0&&T({id:s.id}).then(t=>{s.is_read=1}).catch(t=>{console.log(t)})};return(s,t)=>{const x=Q,_=V("router-link"),I=W,m=X,C=Z,M=ee;return a(),o("div",{class:A(["message-item",{unread:e.message.is_read===0}]),onClick:t[4]||(t[4]=f=>c(e.message))},[n(M,{"content-indented":""},{avatar:i(()=>[n(x,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:h},null,8,["src"])]),header:i(()=>[k("div",re,[e.message.sender_user.id>0?(a(),o("span",ce,[n(_,{onClick:t[0]||(t[0]=$(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:i(()=>[u(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),k("span",_e," @"+g(e.message.sender_user.username),1)])):(a(),o("span",ue," 系统 "))])]),"header-extra":i(()=>[k("span",de,[e.message.is_read===0?(a(),z(I,{key:0,dot:"",processing:""})):l("",!0),k("span",me,g(p(E)(e.message.created_on)),1)])]),description:i(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:i(()=>[e.message.type!=4?(a(),o("div",pe,[u(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),o("span",{key:0,onClick:t[1]||(t[1]=$(f=>r(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(J))]),_:1}),u(" 查看详情 ")])):l("",!0)])):l("",!0),e.message.type===4?(a(),o("div",ge,g(e.message.content),1)):l("",!0),e.message.type===5?(a(),o("div",ve,[u(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),o("span",{key:0,onClick:t[2]||(t[2]=$(f=>d(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(K))]),_:1}),u(" 同意 ")])):l("",!0),e.message.reply_id===1?(a(),o("span",{key:1,onClick:t[3]||(t[3]=$(f=>v(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(q))]),_:1}),u(" 拒绝 ")])):l("",!0),e.message.reply_id===2?(a(),o("span",fe,[n(m,null,{default:i(()=>[n(p(Y))]),_:1}),u(" 已同意 ")])):l("",!0),e.message.reply_id===3?(a(),o("span",ye,[n(m,null,{default:i(()=>[n(p(q))]),_:1}),u(" 已拒绝 ")])):l("",!0)])):l("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const he=F(ke,[["__scopeId","data-v-4a0e27fa"]]),we={class:"content"},$e=b({__name:"message-skeleton",props:{num:{default:1}},setup(e){return(h,w)=>{const r=se;return a(!0),o(O,null,N(new Array(e.num),d=>(a(),o("div",{class:"skeleton-item",key:d},[k("div",we,[n(r,{text:"",repeat:2}),n(r,{text:"",style:{width:"60%"}})])]))),128)}}});const xe=F($e,[["__scopeId","data-v-01d2e871"]]),Ce={key:0,class:"skeleton-wrap"},Me={key:1},be={key:0,class:"empty-wrap"},Fe={key:0,class:"pagination-wrap"},Ie=b({__name:"Messages",setup(e){const h=G(),w=le(),r=y(!1),d=y(+h.query.p||1),v=y(10),c=y(0),s=y([]),t=()=>{r.value=!0,U({page:d.value,page_size:v.value}).then(_=>{r.value=!1,s.value=_.list,c.value=Math.ceil(_.pager.total_rows/v.value)}).catch(_=>{r.value=!1})},x=_=>{d.value=_,t()};return D(()=>{t()}),(_,I)=>{const m=ie,C=xe,M=ae,f=he,R=oe,j=te,B=ne;return a(),o("div",null,[n(m,{title:"消息"}),n(j,{class:"main-content-wrap messages-wrap",bordered:""},{default:i(()=>[r.value?(a(),o("div",Ce,[n(C,{num:v.value},null,8,["num"])])):(a(),o("div",Me,[s.value.length===0?(a(),o("div",be,[n(M,{size:"large",description:"暂无数据"})])):l("",!0),(a(!0),o(O,null,N(s.value,S=>(a(),z(R,{key:S.id},{default:i(()=>[n(f,{message:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),c.value>0?(a(),o("div",Fe,[n(B,{page:d.value,"onUpdate:page":x,"page-slot":p(w).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)])}}});const Ze=F(Ie,[["__scopeId","data-v-4e7b1342"]]);export{Ze as default}; diff --git a/web/dist/assets/Post-9fdb3280.js b/web/dist/assets/Post-ad38db7b.js similarity index 99% rename from web/dist/assets/Post-9fdb3280.js rename to web/dist/assets/Post-ad38db7b.js index 94626ad7..2db0b623 100644 --- a/web/dist/assets/Post-9fdb3280.js +++ b/web/dist/assets/Post-ad38db7b.js @@ -1 +1 @@ -import{d as Q,r as u,a1 as de,o as n,c,a as d,L as t,$ as a,e as I,M as T,K as z,O as i,Y as e,a0 as j,n as ae,a6 as Ue,F as le,a2 as ie,j as me,U as ge,V as ye,w as Pe}from"./@vue-ca177dbe.js";import{u as ee}from"./vuex-d28e9067.js";import{f as ce}from"./formatTime-000dbebb.js";import{t as Re,d as Se,e as Le,_ as te,f as Ae,h as De,i as Me,j as Oe,g as qe,k as Be,l as Ee,m as Ne,n as je,o as Ve,s as He,v as Fe,p as Ye,q as Ke,r as Je,u as he}from"./index-71725d26.js";import{Y as ue,V as Z}from"./IEnum-a180d93e.js";import{T as ke,e as re,f as we,g as _e,h as be,I as Ge,i as Qe,j as We,k as Xe,l as Ze,m as et,n as tt,o as st}from"./@vicons-a45d17e4.js";import{j as se,e as oe,J as $e,b as ot,K as nt,o as ve,L as Ce,v as at,w as lt,x as it,y as ct,z as ut,B as rt,M as _t,O as pt,i as dt,P as mt,a as xe,F as vt,I as ft,k as ht,H as gt,f as yt,g as kt}from"./naive-ui-2035804c.js";import{p as fe,_ as Ie,a as wt,b as bt,c as $t}from"./content-be850479.js";import{u as Te,b as Ct}from"./vue-router-88cc84d1.js";import{_ as xt}from"./post-skeleton-ce689406.js";import{l as It}from"./lodash-3329902d.js";import{a as Tt}from"./copy-to-clipboard-ca358197.js";import{_ as zt}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{K as Ut}from"./v3-infinite-loading-fcb59c38.js";import"./moment-b7869f98.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./nonesir-video-db921567.js";import"./toggle-selection-93f4ad84.js";const Pt={class:"reply-item"},Rt={class:"header-wrap"},St={class:"username"},Lt={class:"reply-name"},At={class:"timestamp"},Dt={class:"base-wrap"},Mt={class:"content"},Ot={class:"reply-switch"},qt={class:"time-item"},Bt={class:"actions"},Et={class:"upvote-count"},Nt=["onClick"],jt={class:"upvote-count"},Vt={key:2,class:"action-item"},Ht=["onClick"],Ft=Q({__name:"reply-item",props:{tweetId:null,reply:null},emits:["focusReply","reload"],setup(A,{emit:O}){const l=A,r=ee(),g=u(l.reply.is_thumbs_up==ue.YES),y=u(l.reply.is_thumbs_down==ue.YES),w=u(l.reply.thumbs_up_count),S=()=>{Re({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(k=>{g.value=!g.value,g.value?(w.value++,y.value=!1):w.value--}).catch(k=>{console.log(k)})},_=()=>{Se({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(k=>{y.value=!y.value,y.value&&g.value&&(w.value--,g.value=!1)}).catch(k=>{console.log(k)})},C=()=>{O("focusReply",l.reply)},f=()=>{Le({id:l.reply.id}).then(k=>{window.$message.success("删除成功"),setTimeout(()=>{O("reload")},50)}).catch(k=>{console.log(k)})};return(k,U)=>{const s=de("router-link"),h=se,b=oe,$=$e;return n(),c("div",Pt,[d("div",Rt,[d("div",St,[t(s,{class:"user-link",to:{name:"user",query:{username:l.reply.user.username}}},{default:a(()=>[I(T(l.reply.user.username),1)]),_:1},8,["to"]),d("span",Lt,T(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(n(),z(s,{key:0,class:"user-link",to:{name:"user",query:{username:l.reply.at_user.username}}},{default:a(()=>[I(T(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),d("div",At,[I(T(l.reply.ip_loc)+" ",1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===l.reply.user.id?(n(),z($,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:f},{trigger:a(()=>[t(b,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(h,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[I(" 是否确认删除? ")]),_:1})):i("",!0)])]),d("div",Dt,[d("div",Mt,T(l.reply.content),1),d("div",Ot,[d("span",qt,T(e(ce)(l.reply.created_on)),1),d("div",Bt,[e(r).state.userLogined?i("",!0):(n(),c("div",{key:0,class:"action-item",onClick:U[0]||(U[0]=j(()=>{},["stop"]))},[t(h,{size:"medium"},{default:a(()=>[t(e(re))]),_:1}),d("span",Et,T(w.value),1)])),e(r).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(S,["stop"])},[t(h,{size:"medium"},{default:a(()=>[g.value?i("",!0):(n(),z(e(re),{key:0})),g.value?(n(),z(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",jt,T(w.value),1)],8,Nt)):i("",!0),e(r).state.userLogined?i("",!0):(n(),c("div",Vt,[t(h,{size:"medium"},{default:a(()=>[t(e(_e))]),_:1})])),e(r).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(_,["stop"])},[t(h,{size:"medium"},{default:a(()=>[y.value?i("",!0):(n(),z(e(_e),{key:0})),y.value?(n(),z(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,Ht)):i("",!0),e(r).state.userLogined?(n(),c("span",{key:4,class:"show opacity-item reply-btn",onClick:C}," 回复 ")):i("",!0)])])])])}}});const Yt=te(Ft,[["__scopeId","data-v-783f5693"]]),Kt={class:"reply-compose-wrap"},Jt={class:"reply-switch"},Gt={class:"time-item"},Qt={class:"actions"},Wt={key:0,class:"action-item"},Xt={class:"upvote-count"},Zt=["onClick"],es={class:"upvote-count"},ts={key:2,class:"action-item"},ss=["onClick"],os={key:0,class:"reply-input-wrap"},ns=Q({__name:"compose-reply",props:{comment:null,atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(A,{expose:O,emit:l}){const r=A,g=ee(),y=u(),w=u(!1),S=u(""),_=u(!1),C=u(r.comment.is_thumbs_up==ue.YES),f=u(r.comment.is_thumbs_down==ue.YES),k=u(r.comment.thumbs_up_count),U=()=>{Ae({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then($=>{C.value=!C.value,C.value?(k.value++,f.value=!1):k.value--}).catch($=>{console.log($)})},s=()=>{De({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then($=>{f.value=!f.value,f.value&&C.value&&(k.value--,C.value=!1)}).catch($=>{console.log($)})},h=$=>{w.value=$,$?setTimeout(()=>{var x;(x=y.value)==null||x.focus()},10):(_.value=!1,S.value="",l("reset"))},b=()=>{_.value=!0,Me({comment_id:r.comment.id,at_user_id:r.atUserid,content:S.value}).then($=>{h(!1),window.$message.success("评论成功"),l("reload")}).catch($=>{_.value=!1})};return O({switchReply:h}),($,x)=>{const M=se,q=ot,Y=oe,E=nt;return n(),c("div",Kt,[d("div",Jt,[d("span",Gt,T(e(ce)(A.comment.created_on)),1),d("div",Qt,[e(g).state.userLogined?i("",!0):(n(),c("div",Wt,[t(M,{size:"medium"},{default:a(()=>[t(e(re))]),_:1}),d("span",Xt,T(k.value),1)])),e(g).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(U,["stop"])},[t(M,{size:"medium"},{default:a(()=>[C.value?i("",!0):(n(),z(e(re),{key:0})),C.value?(n(),z(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",es,T(k.value),1)],8,Zt)):i("",!0),e(g).state.userLogined?i("",!0):(n(),c("div",ts,[t(M,{size:"medium"},{default:a(()=>[t(e(_e))]),_:1})])),e(g).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(s,["stop"])},[t(M,{size:"medium"},{default:a(()=>[f.value?i("",!0):(n(),z(e(_e),{key:0})),f.value?(n(),z(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,ss)):i("",!0),e(g).state.userLogined&&!w.value?(n(),c("span",{key:4,class:"show reply-btn",onClick:x[0]||(x[0]=N=>h(!0))}," 回复 ")):i("",!0),e(g).state.userLogined&&w.value?(n(),c("span",{key:5,class:"hide reply-btn",onClick:x[1]||(x[1]=N=>h(!1))}," 取消 ")):i("",!0)])]),w.value?(n(),c("div",os,[t(E,null,{default:a(()=>[t(q,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:r.atUsername?"@"+r.atUsername:"请输入回复内容..",maxlength:"100",value:S.value,"onUpdate:value":x[2]||(x[2]=N=>S.value=N),"show-count":"",clearable:""},null,8,["placeholder","value"]),t(Y,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:b},{default:a(()=>[I(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const as=te(ns,[["__scopeId","data-v-0f1721e2"]]),ls={class:"comment-item"},is={class:"nickname-wrap"},cs={class:"username-wrap"},us={class:"opt-wrap"},rs={class:"timestamp"},_s=["innerHTML"],ps={class:"reply-wrap"},ds=Q({__name:"comment-item",props:{comment:null},emits:["reload"],setup(A,{emit:O}){const l=A,r=ee(),g=Te(),y=u(0),w=u(""),S=u(),_=ae(()=>{let h=Object.assign({texts:[],imgs:[]},l.comment);return h.contents.map(b=>{(+b.type==1||+b.type==2)&&h.texts.push(b),+b.type==3&&h.imgs.push(b)}),h}),C=(h,b)=>{let $=h.target;if($.dataset.detail){const x=$.dataset.detail.split(":");x.length===2&&(r.commit("refresh"),x[0]==="tag"?window.$message.warning("评论内的无效话题"):g.push({name:"user",query:{username:x[1]}}))}},f=h=>{var b,$;y.value=h.user_id,w.value=((b=h.user)==null?void 0:b.username)||"",($=S.value)==null||$.switchReply(!0)},k=()=>{O("reload")},U=()=>{y.value=0,w.value=""},s=()=>{Oe({id:_.value.id}).then(h=>{window.$message.success("删除成功"),setTimeout(()=>{k()},50)}).catch(h=>{})};return(h,b)=>{const $=ve,x=de("router-link"),M=se,q=oe,Y=$e,E=Ie,N=as,L=Yt,D=Ce;return n(),c("div",ls,[t(D,{"content-indented":""},Ue({avatar:a(()=>[t($,{round:"",size:30,src:e(_).user.avatar},null,8,["src"])]),header:a(()=>[d("span",is,[t(x,{onClick:b[0]||(b[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(_).user.username}}},{default:a(()=>[I(T(e(_).user.nickname),1)]),_:1},8,["to"])]),d("span",cs," @"+T(e(_).user.username),1)]),"header-extra":a(()=>[d("div",us,[d("span",rs,T(e(_).ip_loc),1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(_).user.id?(n(),z(Y,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:s},{trigger:a(()=>[t(q,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(M,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[I(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:a(()=>[e(_).imgs.length>0?(n(),z(E,{key:0,imgs:e(_).imgs},null,8,["imgs"])):i("",!0),t(N,{ref_key:"replyComposeRef",ref:S,comment:e(_),"at-userid":y.value,"at-username":w.value,onReload:k,onReset:U},null,8,["comment","at-userid","at-username"]),d("div",ps,[(n(!0),c(le,null,ie(e(_).replies,o=>(n(),z(L,{key:o.id,reply:o,"tweet-id":e(_).post_id,onFocusReply:f,onReload:k},null,8,["reply","tweet-id"]))),128))])]),_:2},[e(_).texts.length>0?{name:"description",fn:a(()=>[(n(!0),c(le,null,ie(e(_).texts,o=>(n(),c("span",{key:o.id,class:"comment-text",onClick:b[1]||(b[1]=j(p=>C(p,e(_).id),["stop"])),innerHTML:e(fe)(o.content).content},null,8,_s))),128))]),key:"0"}:void 0]),1024)])}}});const ms=te(ds,[["__scopeId","data-v-f206d4d8"]]),vs=A=>(ge("data-v-ca3e6071"),A=A(),ye(),A),fs={key:0,class:"compose-wrap"},hs={class:"compose-line"},gs={class:"compose-user"},ys={class:"compose-line compose-options"},ks={class:"attachment"},ws={class:"submit-wrap"},bs={class:"attachment-list-wrap"},$s={key:1,class:"compose-wrap"},Cs=vs(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),xs={key:0,class:"login-only-wrap"},Is={key:1,class:"login-wrap"},Ts=Q({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(A,{emit:O}){const l=A,r=ee(),g=u([]),y=u(!1),w=u(!1),S=u(!1),_=u(""),C=u(),f=u("public/image"),k=u([]),U=u([]),s=u("true".toLowerCase()==="true"),h="/v1/attachment",b=u(),$=It.debounce(m=>{qe({k:m}).then(v=>{let P=[];v.suggest.map(R=>{P.push({label:R,value:R})}),g.value=P,w.value=!1}).catch(v=>{w.value=!1})},200),x=(m,v)=>{w.value||(w.value=!0,v==="@"&&$(m))},M=m=>{m.length>200||(_.value=m)},q=m=>{f.value=m},Y=m=>{k.value=m},E=async m=>{var v,P;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((v=m.file.file)==null?void 0:v.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((P=m.file.file)==null?void 0:P.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},N=({file:m,event:v})=>{var P;try{let R=JSON.parse((P=v.target)==null?void 0:P.response);R.code===0&&f.value==="public/image"&&U.value.push({id:m.id,content:R.data.content})}catch{window.$message.error("上传失败")}},L=({file:m,event:v})=>{var P;try{let R=JSON.parse((P=v.target)==null?void 0:P.response);if(R.code!==0){let H=R.msg||"上传失败";R.details&&R.details.length>0&&R.details.map(B=>{H+=":"+B}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},D=({file:m})=>{let v=U.value.findIndex(P=>P.id===m.id);v>-1&&U.value.splice(v,1)},o=()=>{y.value=!0},p=()=>{var m;y.value=!1,(m=C.value)==null||m.clear(),k.value=[],_.value="",U.value=[]},V=()=>{if(_.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:m}=fe(_.value);const v=[];let P=100;v.push({content:_.value,type:2,sort:P}),U.value.map(R=>{P++,v.push({content:R.content,type:3,sort:P})}),S.value=!0,Be({contents:v,post_id:l.postId,users:Array.from(new Set(m))}).then(R=>{window.$message.success("发布成功"),S.value=!1,O("post-success"),p()}).catch(R=>{S.value=!1})},K=m=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",m)};return me(()=>{b.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(m,v)=>{const P=ve,R=at,H=se,B=oe,W=lt,X=it,J=ct,ne=ut,pe=rt;return n(),c("div",null,[e(r).state.userInfo.id>0?(n(),c("div",fs,[d("div",hs,[d("div",gs,[t(P,{round:"",size:30,src:e(r).state.userInfo.avatar},null,8,["src"])]),t(R,{type:"textarea",size:"large",autosize:"",bordered:!1,options:g.value,prefix:["@"],loading:w.value,value:_.value,disabled:l.lock===1,"onUpdate:value":M,onSearch:x,onFocus:o,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(n(),z(pe,{key:0,ref_key:"uploadRef",ref:C,abstract:"","list-type":"image",multiple:!0,max:9,action:h,headers:{Authorization:b.value},data:{type:f.value},onBeforeUpload:E,onFinish:N,onError:L,onRemove:D,"onUpdate:fileList":Y},{default:a(()=>[d("div",ys,[d("div",ks,[t(W,{abstract:""},{default:a(({handleClick:G})=>[t(B,{disabled:k.value.length>0&&f.value==="public/video"||k.value.length===9,onClick:()=>{q("public/image"),G()},quaternary:"",circle:"",type:"primary"},{icon:a(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:a(()=>[t(e(Ge))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(J,{trigger:"hover",placement:"bottom"},{trigger:a(()=>[t(X,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:_.value.length/200*100},null,8,["percentage"])]),default:a(()=>[I(" "+T(_.value.length)+" / 200 ",1)]),_:1})]),d("div",ws,[t(B,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:p},{default:a(()=>[I(" 取消 ")]),_:1}),t(B,{loading:S.value,onClick:V,type:"primary",secondary:"",size:"small",round:""},{default:a(()=>[I(" 发布 ")]),_:1},8,["loading"])])]),d("div",bs,[t(ne)])]),_:1},8,["headers","data"])):i("",!0)])):(n(),c("div",$s,[Cs,s.value?i("",!0):(n(),c("div",xs,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=G=>K("signin"))},{default:a(()=>[I(" 登录 ")]),_:1})])),s.value?(n(),c("div",Is,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=G=>K("signin"))},{default:a(()=>[I(" 登录 ")]),_:1}),t(B,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=G=>K("signup"))},{default:a(()=>[I(" 注册 ")]),_:1})])):i("",!0)]))])}}});const zs=te(Ts,[["__scopeId","data-v-ca3e6071"]]),Us={class:"username-wrap"},Ps={key:0,class:"options"},Rs={key:0},Ss=["innerHTML"],Ls={class:"timestamp"},As={key:0},Ds={key:1},Ms={class:"opts-wrap"},Os=["onClick"],qs={class:"opt-item"},Bs=["onClick"],Es=["onClick"],Ns=Q({__name:"post-detail",props:{post:null},emits:["reload"],setup(A,{emit:O}){const l=A,r=ee(),g=Te(),y=u(!1),w=u(!1),S=u(!1),_=u(!1),C=u(!1),f=u(!1),k=u(!1),U=u(Z.PUBLIC),s=ae({get:()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return o.contents.map(p=>{(+p.type==1||+p.type==2)&&o.texts.push(p),+p.type==3&&o.imgs.push(p),+p.type==4&&o.videos.push(p),+p.type==6&&o.links.push(p),+p.type==7&&o.attachments.push(p),+p.type==8&&o.charge_attachments.push(p)}),o},set:o=>{l.post.upvote_count=o.upvote_count,l.post.comment_count=o.comment_count,l.post.collection_count=o.collection_count}}),h=ae(()=>{let o=[{label:"删除",key:"delete"}];return s.value.is_lock===0?o.push({label:"锁定",key:"lock"}):o.push({label:"解锁",key:"unlock"}),r.state.userInfo.is_admin&&(s.value.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"})),s.value.visibility===Z.PUBLIC?o.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):s.value.visibility===Z.PRIVATE?o.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):o.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),o}),b=o=>{g.push({name:"post",query:{id:o}})},$=(o,p)=>{if(o.target.dataset.detail){const V=o.target.dataset.detail.split(":");if(V.length===2){r.commit("refresh"),V[0]==="tag"?g.push({name:"home",query:{q:V[1],t:"tag"}}):g.push({name:"user",query:{username:V[1]}});return}}b(p)},x=o=>{switch(o){case"delete":S.value=!0;break;case"lock":case"unlock":_.value=!0;break;case"stick":case"unstick":C.value=!0;break;case"vpublic":U.value=0,f.value=!0;break;case"vprivate":U.value=1,f.value=!0;break;case"vfriend":U.value=2,f.value=!0;break}},M=()=>{je({id:s.value.id}).then(o=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{r.commit("refresh")},50)}).catch(o=>{k.value=!1})},q=()=>{Ve({id:s.value.id}).then(o=>{O("reload"),o.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(o=>{k.value=!1})},Y=()=>{He({id:s.value.id}).then(o=>{O("reload"),o.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(o=>{k.value=!1})},E=()=>{Fe({id:s.value.id,visibility:U.value}).then(o=>{O("reload"),window.$message.success("修改可见性成功")}).catch(o=>{k.value=!1})},N=()=>{Ye({id:s.value.id}).then(o=>{y.value=o.status,o.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(o=>{console.log(o)})},L=()=>{Ke({id:s.value.id}).then(o=>{w.value=o.status,o.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(o=>{console.log(o)})},D=()=>{Tt(`${window.location.origin}/#/post?id=${s.value.id}`),window.$message.success("链接已复制到剪贴板")};return me(()=>{r.state.userInfo.id>0&&(Ee({id:s.value.id}).then(o=>{y.value=o.status}).catch(o=>{console.log(o)}),Ne({id:s.value.id}).then(o=>{w.value=o.status}).catch(o=>{console.log(o)}))}),(o,p)=>{const V=ve,K=de("router-link"),m=_t,v=se,P=oe,R=pt,H=dt,B=wt,W=Ie,X=bt,J=$t,ne=mt,pe=xe,G=Ce;return n(),c("div",{class:"detail-item",onClick:p[6]||(p[6]=F=>b(e(s).id))},[t(G,null,{avatar:a(()=>[t(V,{round:"",size:30,src:e(s).user.avatar},null,8,["src"])]),header:a(()=>[t(K,{onClick:p[0]||(p[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(s).user.username}}},{default:a(()=>[I(T(e(s).user.nickname),1)]),_:1},8,["to"]),d("span",Us," @"+T(e(s).user.username),1),e(s).is_top?(n(),z(m,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:a(()=>[I(" 置顶 ")]),_:1})):i("",!0),e(s).visibility==e(Z).PRIVATE?(n(),z(m,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:a(()=>[I(" 私密 ")]),_:1})):i("",!0),e(s).visibility==e(Z).FRIEND?(n(),z(m,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:a(()=>[I(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":a(()=>[e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(s).user.id?(n(),c("div",Ps,[t(R,{placement:"bottom-end",trigger:"click",size:"small",options:e(h),onSelect:x},{default:a(()=>[t(P,{quaternary:"",circle:""},{icon:a(()=>[t(v,null,{default:a(()=>[t(e(Qe))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),t(H,{show:S.value,"onUpdate:show":p[1]||(p[1]=F=>S.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:M},null,8,["show"]),t(H,{show:_.value,"onUpdate:show":p[2]||(p[2]=F=>_.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:q},null,8,["show","content"]),t(H,{show:C.value,"onUpdate:show":p[3]||(p[3]=F=>C.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Y},null,8,["show","content"]),t(H,{show:f.value,"onUpdate:show":p[4]||(p[4]=F=>f.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(U.value==0?"公开":U.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:E},null,8,["show","content"])]),footer:a(()=>[t(B,{attachments:e(s).attachments},null,8,["attachments"]),t(B,{attachments:e(s).charge_attachments,price:e(s).attachment_price},null,8,["attachments","price"]),t(W,{imgs:e(s).imgs},null,8,["imgs"]),t(X,{videos:e(s).videos,full:!0},null,8,["videos"]),t(J,{links:e(s).links},null,8,["links"]),d("div",Ls,[I(" 发布于 "+T(e(ce)(e(s).created_on))+" ",1),e(s).ip_loc?(n(),c("span",As,[t(ne,{vertical:""}),I(" "+T(e(s).ip_loc),1)])):i("",!0),!e(r).state.collapsedLeft&&e(s).created_on!=e(s).latest_replied_on?(n(),c("span",Ds,[t(ne,{vertical:""}),I(" 最后回复 "+T(e(ce)(e(s).latest_replied_on)),1)])):i("",!0)])]),action:a(()=>[d("div",Ms,[t(pe,{justify:"space-between"},{default:a(()=>[d("div",{class:"opt-item hover",onClick:j(N,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[y.value?i("",!0):(n(),z(e(We),{key:0})),y.value?(n(),z(e(Xe),{key:1,color:"red"})):i("",!0)]),_:1}),I(" "+T(e(s).upvote_count),1)],8,Os),d("div",qs,[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(Ze))]),_:1}),I(" "+T(e(s).comment_count),1)]),d("div",{class:"opt-item hover",onClick:j(L,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[w.value?i("",!0):(n(),z(e(et),{key:0})),w.value?(n(),z(e(tt),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),I(" "+T(e(s).collection_count),1)],8,Bs),d("div",{class:"opt-item hover",onClick:j(D,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(st))]),_:1}),I(" "+T(e(s).share_count),1)],8,Es)]),_:1})])]),default:a(()=>[e(s).texts.length>0?(n(),c("div",Rs,[(n(!0),c(le,null,ie(e(s).texts,F=>(n(),c("span",{key:F.id,class:"post-text",onClick:p[5]||(p[5]=j(ze=>$(ze,e(s).id),["stop"])),innerHTML:e(fe)(F.content).content},null,8,Ss))),128))])):i("",!0)]),_:1})])}}});const js=A=>(ge("data-v-0d01659f"),A=A(),ye(),A),Vs={key:0,class:"detail-wrap"},Hs={key:1,class:"empty-wrap"},Fs={key:0,class:"comment-opts-wrap"},Ys=js(()=>d("span",{class:"comment-title-item"},"评论",-1)),Ks={key:2},Js={key:0,class:"skeleton-wrap"},Gs={key:1},Qs={key:0,class:"empty-wrap"},Ws={key:0,class:"load-more-spinner"},Xs={key:1,class:"load-more-spinner"},Zs={key:2,class:"load-more-spinner"},eo={key:3,class:"load-more-spinner"},to=Q({__name:"Post",setup(A){const O=Ct(),l=u({}),r=u(!1),g=u(!1),y=u([]),w=ae(()=>+O.query.id),S=u("default"),_=u(!0),C=20;let f={loading(){},loaded(){},complete(){},error(){}};const k=L=>{S.value=L,L==="default"&&(_.value=!0),E(f)},U=()=>{l.value={id:0},r.value=!0,Je({id:w.value}).then(L=>{r.value=!1,l.value=L,E(f)}).catch(L=>{r.value=!1})};let s=1;const h=u(!1),b=u([]),$=L=>{h.value||he({id:l.value.id,sort_strategy:"default",page:s,page_size:C}).then(D=>{L!==null&&(f=L),D.list.length0&&(s===1?b.value=D.list:b.value.push(...D.list),y.value=b.value),f.loaded(),g.value=!1}).catch(D=>{g.value=!1,f.error()})};let x=1,M=u(!1);const q=u([]),Y=L=>{M.value||he({id:l.value.id,sort_strategy:"newest",page:x,page_size:C}).then(D=>{L!==null&&(f=L),D.list.length0&&(x===1?q.value=D.list:q.value.push(...D.list),y.value=q.value),f.loaded(),g.value=!1}).catch(D=>{g.value=!1,f.error()})},E=L=>{w.value<1||(y.value.length===0&&(g.value=!0),S.value==="default"?(y.value=b.value,$(L)):(y.value=q.value,Y(L)),g.value=!1)},N=()=>{s=1,h.value=!1,b.value=[],x=1,M.value=!1,q.value=[],E(f)};return me(()=>{U()}),Pe(w,()=>{w.value>0&&O.name==="post"&&U()}),(L,D)=>{const o=zt,p=Ns,V=ft,K=ht,m=gt,v=yt,P=kt,R=zs,H=xt,B=ms,W=xe,X=vt;return n(),c("div",null,[t(o,{title:"泡泡详情",back:!0}),t(X,{class:"main-content-wrap",bordered:""},{default:a(()=>[t(m,null,{default:a(()=>[t(K,{show:r.value},{default:a(()=>[l.value.id>1?(n(),c("div",Vs,[t(p,{post:l.value,onReload:U},null,8,["post"])])):(n(),c("div",Hs,[t(V,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(n(),c("div",Fs,[t(P,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":k},{prefix:a(()=>[Ys]),default:a(()=>[t(v,{name:"default",tab:"默认"}),t(v,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(n(),z(m,{key:1},{default:a(()=>[t(R,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:N},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(n(),c("div",Ks,[g.value?(n(),c("div",Js,[t(H,{num:5})])):(n(),c("div",Gs,[y.value.length===0?(n(),c("div",Qs,[t(V,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(n(!0),c(le,null,ie(y.value,J=>(n(),z(m,{key:J.id},{default:a(()=>[t(B,{comment:J,onReload:N},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),y.value.length>=C?(n(),z(W,{key:3,justify:"center"},{default:a(()=>[t(e(Ut),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:E},{spinner:a(()=>[_.value&&h.value?(n(),c("span",Ws)):i("",!0),!_.value&&e(M)?(n(),c("span",Xs)):i("",!0),_.value&&!h.value?(n(),c("span",Zs,"加载评论")):i("",!0),!_.value&&!e(M)?(n(),c("span",eo,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const Do=te(to,[["__scopeId","data-v-0d01659f"]]);export{Do as default}; +import{d as Q,r as u,a1 as de,o as n,c,a as d,L as t,$ as a,e as I,M as T,K as z,O as i,Y as e,a0 as j,n as ae,a6 as Ue,F as le,a2 as ie,j as me,U as ge,V as ye,w as Pe}from"./@vue-ca177dbe.js";import{u as ee}from"./vuex-d28e9067.js";import{f as ce}from"./formatTime-000dbebb.js";import{t as Re,d as Se,e as Le,_ as te,f as Ae,h as De,i as Me,j as Oe,g as qe,k as Be,l as Ee,m as Ne,n as je,o as Ve,s as He,v as Fe,p as Ye,q as Ke,r as Je,u as he}from"./index-ddd65805.js";import{Y as ue,V as Z}from"./IEnum-a180d93e.js";import{T as ke,e as re,f as we,g as _e,h as be,I as Ge,i as Qe,j as We,k as Xe,l as Ze,m as et,n as tt,o as st}from"./@vicons-a45d17e4.js";import{j as se,e as oe,J as $e,b as ot,K as nt,o as ve,L as Ce,v as at,w as lt,x as it,y as ct,z as ut,B as rt,M as _t,O as pt,i as dt,P as mt,a as xe,F as vt,I as ft,k as ht,H as gt,f as yt,g as kt}from"./naive-ui-2035804c.js";import{p as fe,_ as Ie,a as wt,b as bt,c as $t}from"./content-13239b6c.js";import{u as Te,b as Ct}from"./vue-router-88cc84d1.js";import{_ as xt}from"./post-skeleton-a319fe06.js";import{l as It}from"./lodash-3329902d.js";import{a as Tt}from"./copy-to-clipboard-ca358197.js";import{_ as zt}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{K as Ut}from"./v3-infinite-loading-fcb59c38.js";import"./moment-b7869f98.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./nonesir-video-db921567.js";import"./toggle-selection-93f4ad84.js";const Pt={class:"reply-item"},Rt={class:"header-wrap"},St={class:"username"},Lt={class:"reply-name"},At={class:"timestamp"},Dt={class:"base-wrap"},Mt={class:"content"},Ot={class:"reply-switch"},qt={class:"time-item"},Bt={class:"actions"},Et={class:"upvote-count"},Nt=["onClick"],jt={class:"upvote-count"},Vt={key:2,class:"action-item"},Ht=["onClick"],Ft=Q({__name:"reply-item",props:{tweetId:null,reply:null},emits:["focusReply","reload"],setup(A,{emit:O}){const l=A,r=ee(),g=u(l.reply.is_thumbs_up==ue.YES),y=u(l.reply.is_thumbs_down==ue.YES),w=u(l.reply.thumbs_up_count),S=()=>{Re({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(k=>{g.value=!g.value,g.value?(w.value++,y.value=!1):w.value--}).catch(k=>{console.log(k)})},_=()=>{Se({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(k=>{y.value=!y.value,y.value&&g.value&&(w.value--,g.value=!1)}).catch(k=>{console.log(k)})},C=()=>{O("focusReply",l.reply)},f=()=>{Le({id:l.reply.id}).then(k=>{window.$message.success("删除成功"),setTimeout(()=>{O("reload")},50)}).catch(k=>{console.log(k)})};return(k,U)=>{const s=de("router-link"),h=se,b=oe,$=$e;return n(),c("div",Pt,[d("div",Rt,[d("div",St,[t(s,{class:"user-link",to:{name:"user",query:{username:l.reply.user.username}}},{default:a(()=>[I(T(l.reply.user.username),1)]),_:1},8,["to"]),d("span",Lt,T(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(n(),z(s,{key:0,class:"user-link",to:{name:"user",query:{username:l.reply.at_user.username}}},{default:a(()=>[I(T(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),d("div",At,[I(T(l.reply.ip_loc)+" ",1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===l.reply.user.id?(n(),z($,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:f},{trigger:a(()=>[t(b,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(h,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[I(" 是否确认删除? ")]),_:1})):i("",!0)])]),d("div",Dt,[d("div",Mt,T(l.reply.content),1),d("div",Ot,[d("span",qt,T(e(ce)(l.reply.created_on)),1),d("div",Bt,[e(r).state.userLogined?i("",!0):(n(),c("div",{key:0,class:"action-item",onClick:U[0]||(U[0]=j(()=>{},["stop"]))},[t(h,{size:"medium"},{default:a(()=>[t(e(re))]),_:1}),d("span",Et,T(w.value),1)])),e(r).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(S,["stop"])},[t(h,{size:"medium"},{default:a(()=>[g.value?i("",!0):(n(),z(e(re),{key:0})),g.value?(n(),z(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",jt,T(w.value),1)],8,Nt)):i("",!0),e(r).state.userLogined?i("",!0):(n(),c("div",Vt,[t(h,{size:"medium"},{default:a(()=>[t(e(_e))]),_:1})])),e(r).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(_,["stop"])},[t(h,{size:"medium"},{default:a(()=>[y.value?i("",!0):(n(),z(e(_e),{key:0})),y.value?(n(),z(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,Ht)):i("",!0),e(r).state.userLogined?(n(),c("span",{key:4,class:"show opacity-item reply-btn",onClick:C}," 回复 ")):i("",!0)])])])])}}});const Yt=te(Ft,[["__scopeId","data-v-783f5693"]]),Kt={class:"reply-compose-wrap"},Jt={class:"reply-switch"},Gt={class:"time-item"},Qt={class:"actions"},Wt={key:0,class:"action-item"},Xt={class:"upvote-count"},Zt=["onClick"],es={class:"upvote-count"},ts={key:2,class:"action-item"},ss=["onClick"],os={key:0,class:"reply-input-wrap"},ns=Q({__name:"compose-reply",props:{comment:null,atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(A,{expose:O,emit:l}){const r=A,g=ee(),y=u(),w=u(!1),S=u(""),_=u(!1),C=u(r.comment.is_thumbs_up==ue.YES),f=u(r.comment.is_thumbs_down==ue.YES),k=u(r.comment.thumbs_up_count),U=()=>{Ae({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then($=>{C.value=!C.value,C.value?(k.value++,f.value=!1):k.value--}).catch($=>{console.log($)})},s=()=>{De({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then($=>{f.value=!f.value,f.value&&C.value&&(k.value--,C.value=!1)}).catch($=>{console.log($)})},h=$=>{w.value=$,$?setTimeout(()=>{var x;(x=y.value)==null||x.focus()},10):(_.value=!1,S.value="",l("reset"))},b=()=>{_.value=!0,Me({comment_id:r.comment.id,at_user_id:r.atUserid,content:S.value}).then($=>{h(!1),window.$message.success("评论成功"),l("reload")}).catch($=>{_.value=!1})};return O({switchReply:h}),($,x)=>{const M=se,q=ot,Y=oe,E=nt;return n(),c("div",Kt,[d("div",Jt,[d("span",Gt,T(e(ce)(A.comment.created_on)),1),d("div",Qt,[e(g).state.userLogined?i("",!0):(n(),c("div",Wt,[t(M,{size:"medium"},{default:a(()=>[t(e(re))]),_:1}),d("span",Xt,T(k.value),1)])),e(g).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(U,["stop"])},[t(M,{size:"medium"},{default:a(()=>[C.value?i("",!0):(n(),z(e(re),{key:0})),C.value?(n(),z(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",es,T(k.value),1)],8,Zt)):i("",!0),e(g).state.userLogined?i("",!0):(n(),c("div",ts,[t(M,{size:"medium"},{default:a(()=>[t(e(_e))]),_:1})])),e(g).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(s,["stop"])},[t(M,{size:"medium"},{default:a(()=>[f.value?i("",!0):(n(),z(e(_e),{key:0})),f.value?(n(),z(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,ss)):i("",!0),e(g).state.userLogined&&!w.value?(n(),c("span",{key:4,class:"show reply-btn",onClick:x[0]||(x[0]=N=>h(!0))}," 回复 ")):i("",!0),e(g).state.userLogined&&w.value?(n(),c("span",{key:5,class:"hide reply-btn",onClick:x[1]||(x[1]=N=>h(!1))}," 取消 ")):i("",!0)])]),w.value?(n(),c("div",os,[t(E,null,{default:a(()=>[t(q,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:r.atUsername?"@"+r.atUsername:"请输入回复内容..",maxlength:"100",value:S.value,"onUpdate:value":x[2]||(x[2]=N=>S.value=N),"show-count":"",clearable:""},null,8,["placeholder","value"]),t(Y,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:b},{default:a(()=>[I(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const as=te(ns,[["__scopeId","data-v-0f1721e2"]]),ls={class:"comment-item"},is={class:"nickname-wrap"},cs={class:"username-wrap"},us={class:"opt-wrap"},rs={class:"timestamp"},_s=["innerHTML"],ps={class:"reply-wrap"},ds=Q({__name:"comment-item",props:{comment:null},emits:["reload"],setup(A,{emit:O}){const l=A,r=ee(),g=Te(),y=u(0),w=u(""),S=u(),_=ae(()=>{let h=Object.assign({texts:[],imgs:[]},l.comment);return h.contents.map(b=>{(+b.type==1||+b.type==2)&&h.texts.push(b),+b.type==3&&h.imgs.push(b)}),h}),C=(h,b)=>{let $=h.target;if($.dataset.detail){const x=$.dataset.detail.split(":");x.length===2&&(r.commit("refresh"),x[0]==="tag"?window.$message.warning("评论内的无效话题"):g.push({name:"user",query:{username:x[1]}}))}},f=h=>{var b,$;y.value=h.user_id,w.value=((b=h.user)==null?void 0:b.username)||"",($=S.value)==null||$.switchReply(!0)},k=()=>{O("reload")},U=()=>{y.value=0,w.value=""},s=()=>{Oe({id:_.value.id}).then(h=>{window.$message.success("删除成功"),setTimeout(()=>{k()},50)}).catch(h=>{})};return(h,b)=>{const $=ve,x=de("router-link"),M=se,q=oe,Y=$e,E=Ie,N=as,L=Yt,D=Ce;return n(),c("div",ls,[t(D,{"content-indented":""},Ue({avatar:a(()=>[t($,{round:"",size:30,src:e(_).user.avatar},null,8,["src"])]),header:a(()=>[d("span",is,[t(x,{onClick:b[0]||(b[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(_).user.username}}},{default:a(()=>[I(T(e(_).user.nickname),1)]),_:1},8,["to"])]),d("span",cs," @"+T(e(_).user.username),1)]),"header-extra":a(()=>[d("div",us,[d("span",rs,T(e(_).ip_loc),1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(_).user.id?(n(),z(Y,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:s},{trigger:a(()=>[t(q,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(M,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[I(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:a(()=>[e(_).imgs.length>0?(n(),z(E,{key:0,imgs:e(_).imgs},null,8,["imgs"])):i("",!0),t(N,{ref_key:"replyComposeRef",ref:S,comment:e(_),"at-userid":y.value,"at-username":w.value,onReload:k,onReset:U},null,8,["comment","at-userid","at-username"]),d("div",ps,[(n(!0),c(le,null,ie(e(_).replies,o=>(n(),z(L,{key:o.id,reply:o,"tweet-id":e(_).post_id,onFocusReply:f,onReload:k},null,8,["reply","tweet-id"]))),128))])]),_:2},[e(_).texts.length>0?{name:"description",fn:a(()=>[(n(!0),c(le,null,ie(e(_).texts,o=>(n(),c("span",{key:o.id,class:"comment-text",onClick:b[1]||(b[1]=j(p=>C(p,e(_).id),["stop"])),innerHTML:e(fe)(o.content).content},null,8,_s))),128))]),key:"0"}:void 0]),1024)])}}});const ms=te(ds,[["__scopeId","data-v-f206d4d8"]]),vs=A=>(ge("data-v-ca3e6071"),A=A(),ye(),A),fs={key:0,class:"compose-wrap"},hs={class:"compose-line"},gs={class:"compose-user"},ys={class:"compose-line compose-options"},ks={class:"attachment"},ws={class:"submit-wrap"},bs={class:"attachment-list-wrap"},$s={key:1,class:"compose-wrap"},Cs=vs(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),xs={key:0,class:"login-only-wrap"},Is={key:1,class:"login-wrap"},Ts=Q({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(A,{emit:O}){const l=A,r=ee(),g=u([]),y=u(!1),w=u(!1),S=u(!1),_=u(""),C=u(),f=u("public/image"),k=u([]),U=u([]),s=u("true".toLowerCase()==="true"),h="/v1/attachment",b=u(),$=It.debounce(m=>{qe({k:m}).then(v=>{let P=[];v.suggest.map(R=>{P.push({label:R,value:R})}),g.value=P,w.value=!1}).catch(v=>{w.value=!1})},200),x=(m,v)=>{w.value||(w.value=!0,v==="@"&&$(m))},M=m=>{m.length>200||(_.value=m)},q=m=>{f.value=m},Y=m=>{k.value=m},E=async m=>{var v,P;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((v=m.file.file)==null?void 0:v.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((P=m.file.file)==null?void 0:P.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},N=({file:m,event:v})=>{var P;try{let R=JSON.parse((P=v.target)==null?void 0:P.response);R.code===0&&f.value==="public/image"&&U.value.push({id:m.id,content:R.data.content})}catch{window.$message.error("上传失败")}},L=({file:m,event:v})=>{var P;try{let R=JSON.parse((P=v.target)==null?void 0:P.response);if(R.code!==0){let H=R.msg||"上传失败";R.details&&R.details.length>0&&R.details.map(B=>{H+=":"+B}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},D=({file:m})=>{let v=U.value.findIndex(P=>P.id===m.id);v>-1&&U.value.splice(v,1)},o=()=>{y.value=!0},p=()=>{var m;y.value=!1,(m=C.value)==null||m.clear(),k.value=[],_.value="",U.value=[]},V=()=>{if(_.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:m}=fe(_.value);const v=[];let P=100;v.push({content:_.value,type:2,sort:P}),U.value.map(R=>{P++,v.push({content:R.content,type:3,sort:P})}),S.value=!0,Be({contents:v,post_id:l.postId,users:Array.from(new Set(m))}).then(R=>{window.$message.success("发布成功"),S.value=!1,O("post-success"),p()}).catch(R=>{S.value=!1})},K=m=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",m)};return me(()=>{b.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(m,v)=>{const P=ve,R=at,H=se,B=oe,W=lt,X=it,J=ct,ne=ut,pe=rt;return n(),c("div",null,[e(r).state.userInfo.id>0?(n(),c("div",fs,[d("div",hs,[d("div",gs,[t(P,{round:"",size:30,src:e(r).state.userInfo.avatar},null,8,["src"])]),t(R,{type:"textarea",size:"large",autosize:"",bordered:!1,options:g.value,prefix:["@"],loading:w.value,value:_.value,disabled:l.lock===1,"onUpdate:value":M,onSearch:x,onFocus:o,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(n(),z(pe,{key:0,ref_key:"uploadRef",ref:C,abstract:"","list-type":"image",multiple:!0,max:9,action:h,headers:{Authorization:b.value},data:{type:f.value},onBeforeUpload:E,onFinish:N,onError:L,onRemove:D,"onUpdate:fileList":Y},{default:a(()=>[d("div",ys,[d("div",ks,[t(W,{abstract:""},{default:a(({handleClick:G})=>[t(B,{disabled:k.value.length>0&&f.value==="public/video"||k.value.length===9,onClick:()=>{q("public/image"),G()},quaternary:"",circle:"",type:"primary"},{icon:a(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:a(()=>[t(e(Ge))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(J,{trigger:"hover",placement:"bottom"},{trigger:a(()=>[t(X,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:_.value.length/200*100},null,8,["percentage"])]),default:a(()=>[I(" "+T(_.value.length)+" / 200 ",1)]),_:1})]),d("div",ws,[t(B,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:p},{default:a(()=>[I(" 取消 ")]),_:1}),t(B,{loading:S.value,onClick:V,type:"primary",secondary:"",size:"small",round:""},{default:a(()=>[I(" 发布 ")]),_:1},8,["loading"])])]),d("div",bs,[t(ne)])]),_:1},8,["headers","data"])):i("",!0)])):(n(),c("div",$s,[Cs,s.value?i("",!0):(n(),c("div",xs,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=G=>K("signin"))},{default:a(()=>[I(" 登录 ")]),_:1})])),s.value?(n(),c("div",Is,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=G=>K("signin"))},{default:a(()=>[I(" 登录 ")]),_:1}),t(B,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=G=>K("signup"))},{default:a(()=>[I(" 注册 ")]),_:1})])):i("",!0)]))])}}});const zs=te(Ts,[["__scopeId","data-v-ca3e6071"]]),Us={class:"username-wrap"},Ps={key:0,class:"options"},Rs={key:0},Ss=["innerHTML"],Ls={class:"timestamp"},As={key:0},Ds={key:1},Ms={class:"opts-wrap"},Os=["onClick"],qs={class:"opt-item"},Bs=["onClick"],Es=["onClick"],Ns=Q({__name:"post-detail",props:{post:null},emits:["reload"],setup(A,{emit:O}){const l=A,r=ee(),g=Te(),y=u(!1),w=u(!1),S=u(!1),_=u(!1),C=u(!1),f=u(!1),k=u(!1),U=u(Z.PUBLIC),s=ae({get:()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return o.contents.map(p=>{(+p.type==1||+p.type==2)&&o.texts.push(p),+p.type==3&&o.imgs.push(p),+p.type==4&&o.videos.push(p),+p.type==6&&o.links.push(p),+p.type==7&&o.attachments.push(p),+p.type==8&&o.charge_attachments.push(p)}),o},set:o=>{l.post.upvote_count=o.upvote_count,l.post.comment_count=o.comment_count,l.post.collection_count=o.collection_count}}),h=ae(()=>{let o=[{label:"删除",key:"delete"}];return s.value.is_lock===0?o.push({label:"锁定",key:"lock"}):o.push({label:"解锁",key:"unlock"}),r.state.userInfo.is_admin&&(s.value.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"})),s.value.visibility===Z.PUBLIC?o.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):s.value.visibility===Z.PRIVATE?o.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):o.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),o}),b=o=>{g.push({name:"post",query:{id:o}})},$=(o,p)=>{if(o.target.dataset.detail){const V=o.target.dataset.detail.split(":");if(V.length===2){r.commit("refresh"),V[0]==="tag"?g.push({name:"home",query:{q:V[1],t:"tag"}}):g.push({name:"user",query:{username:V[1]}});return}}b(p)},x=o=>{switch(o){case"delete":S.value=!0;break;case"lock":case"unlock":_.value=!0;break;case"stick":case"unstick":C.value=!0;break;case"vpublic":U.value=0,f.value=!0;break;case"vprivate":U.value=1,f.value=!0;break;case"vfriend":U.value=2,f.value=!0;break}},M=()=>{je({id:s.value.id}).then(o=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{r.commit("refresh")},50)}).catch(o=>{k.value=!1})},q=()=>{Ve({id:s.value.id}).then(o=>{O("reload"),o.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(o=>{k.value=!1})},Y=()=>{He({id:s.value.id}).then(o=>{O("reload"),o.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(o=>{k.value=!1})},E=()=>{Fe({id:s.value.id,visibility:U.value}).then(o=>{O("reload"),window.$message.success("修改可见性成功")}).catch(o=>{k.value=!1})},N=()=>{Ye({id:s.value.id}).then(o=>{y.value=o.status,o.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(o=>{console.log(o)})},L=()=>{Ke({id:s.value.id}).then(o=>{w.value=o.status,o.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(o=>{console.log(o)})},D=()=>{Tt(`${window.location.origin}/#/post?id=${s.value.id}`),window.$message.success("链接已复制到剪贴板")};return me(()=>{r.state.userInfo.id>0&&(Ee({id:s.value.id}).then(o=>{y.value=o.status}).catch(o=>{console.log(o)}),Ne({id:s.value.id}).then(o=>{w.value=o.status}).catch(o=>{console.log(o)}))}),(o,p)=>{const V=ve,K=de("router-link"),m=_t,v=se,P=oe,R=pt,H=dt,B=wt,W=Ie,X=bt,J=$t,ne=mt,pe=xe,G=Ce;return n(),c("div",{class:"detail-item",onClick:p[6]||(p[6]=F=>b(e(s).id))},[t(G,null,{avatar:a(()=>[t(V,{round:"",size:30,src:e(s).user.avatar},null,8,["src"])]),header:a(()=>[t(K,{onClick:p[0]||(p[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(s).user.username}}},{default:a(()=>[I(T(e(s).user.nickname),1)]),_:1},8,["to"]),d("span",Us," @"+T(e(s).user.username),1),e(s).is_top?(n(),z(m,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:a(()=>[I(" 置顶 ")]),_:1})):i("",!0),e(s).visibility==e(Z).PRIVATE?(n(),z(m,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:a(()=>[I(" 私密 ")]),_:1})):i("",!0),e(s).visibility==e(Z).FRIEND?(n(),z(m,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:a(()=>[I(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":a(()=>[e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(s).user.id?(n(),c("div",Ps,[t(R,{placement:"bottom-end",trigger:"click",size:"small",options:e(h),onSelect:x},{default:a(()=>[t(P,{quaternary:"",circle:""},{icon:a(()=>[t(v,null,{default:a(()=>[t(e(Qe))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),t(H,{show:S.value,"onUpdate:show":p[1]||(p[1]=F=>S.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:M},null,8,["show"]),t(H,{show:_.value,"onUpdate:show":p[2]||(p[2]=F=>_.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:q},null,8,["show","content"]),t(H,{show:C.value,"onUpdate:show":p[3]||(p[3]=F=>C.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Y},null,8,["show","content"]),t(H,{show:f.value,"onUpdate:show":p[4]||(p[4]=F=>f.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(U.value==0?"公开":U.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:E},null,8,["show","content"])]),footer:a(()=>[t(B,{attachments:e(s).attachments},null,8,["attachments"]),t(B,{attachments:e(s).charge_attachments,price:e(s).attachment_price},null,8,["attachments","price"]),t(W,{imgs:e(s).imgs},null,8,["imgs"]),t(X,{videos:e(s).videos,full:!0},null,8,["videos"]),t(J,{links:e(s).links},null,8,["links"]),d("div",Ls,[I(" 发布于 "+T(e(ce)(e(s).created_on))+" ",1),e(s).ip_loc?(n(),c("span",As,[t(ne,{vertical:""}),I(" "+T(e(s).ip_loc),1)])):i("",!0),!e(r).state.collapsedLeft&&e(s).created_on!=e(s).latest_replied_on?(n(),c("span",Ds,[t(ne,{vertical:""}),I(" 最后回复 "+T(e(ce)(e(s).latest_replied_on)),1)])):i("",!0)])]),action:a(()=>[d("div",Ms,[t(pe,{justify:"space-between"},{default:a(()=>[d("div",{class:"opt-item hover",onClick:j(N,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[y.value?i("",!0):(n(),z(e(We),{key:0})),y.value?(n(),z(e(Xe),{key:1,color:"red"})):i("",!0)]),_:1}),I(" "+T(e(s).upvote_count),1)],8,Os),d("div",qs,[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(Ze))]),_:1}),I(" "+T(e(s).comment_count),1)]),d("div",{class:"opt-item hover",onClick:j(L,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[w.value?i("",!0):(n(),z(e(et),{key:0})),w.value?(n(),z(e(tt),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),I(" "+T(e(s).collection_count),1)],8,Bs),d("div",{class:"opt-item hover",onClick:j(D,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(st))]),_:1}),I(" "+T(e(s).share_count),1)],8,Es)]),_:1})])]),default:a(()=>[e(s).texts.length>0?(n(),c("div",Rs,[(n(!0),c(le,null,ie(e(s).texts,F=>(n(),c("span",{key:F.id,class:"post-text",onClick:p[5]||(p[5]=j(ze=>$(ze,e(s).id),["stop"])),innerHTML:e(fe)(F.content).content},null,8,Ss))),128))])):i("",!0)]),_:1})])}}});const js=A=>(ge("data-v-0d01659f"),A=A(),ye(),A),Vs={key:0,class:"detail-wrap"},Hs={key:1,class:"empty-wrap"},Fs={key:0,class:"comment-opts-wrap"},Ys=js(()=>d("span",{class:"comment-title-item"},"评论",-1)),Ks={key:2},Js={key:0,class:"skeleton-wrap"},Gs={key:1},Qs={key:0,class:"empty-wrap"},Ws={key:0,class:"load-more-spinner"},Xs={key:1,class:"load-more-spinner"},Zs={key:2,class:"load-more-spinner"},eo={key:3,class:"load-more-spinner"},to=Q({__name:"Post",setup(A){const O=Ct(),l=u({}),r=u(!1),g=u(!1),y=u([]),w=ae(()=>+O.query.id),S=u("default"),_=u(!0),C=20;let f={loading(){},loaded(){},complete(){},error(){}};const k=L=>{S.value=L,L==="default"&&(_.value=!0),E(f)},U=()=>{l.value={id:0},r.value=!0,Je({id:w.value}).then(L=>{r.value=!1,l.value=L,E(f)}).catch(L=>{r.value=!1})};let s=1;const h=u(!1),b=u([]),$=L=>{h.value||he({id:l.value.id,sort_strategy:"default",page:s,page_size:C}).then(D=>{L!==null&&(f=L),D.list.length0&&(s===1?b.value=D.list:b.value.push(...D.list),y.value=b.value),f.loaded(),g.value=!1}).catch(D=>{g.value=!1,f.error()})};let x=1,M=u(!1);const q=u([]),Y=L=>{M.value||he({id:l.value.id,sort_strategy:"newest",page:x,page_size:C}).then(D=>{L!==null&&(f=L),D.list.length0&&(x===1?q.value=D.list:q.value.push(...D.list),y.value=q.value),f.loaded(),g.value=!1}).catch(D=>{g.value=!1,f.error()})},E=L=>{w.value<1||(y.value.length===0&&(g.value=!0),S.value==="default"?(y.value=b.value,$(L)):(y.value=q.value,Y(L)),g.value=!1)},N=()=>{s=1,h.value=!1,b.value=[],x=1,M.value=!1,q.value=[],E(f)};return me(()=>{U()}),Pe(w,()=>{w.value>0&&O.name==="post"&&U()}),(L,D)=>{const o=zt,p=Ns,V=ft,K=ht,m=gt,v=yt,P=kt,R=zs,H=xt,B=ms,W=xe,X=vt;return n(),c("div",null,[t(o,{title:"泡泡详情",back:!0}),t(X,{class:"main-content-wrap",bordered:""},{default:a(()=>[t(m,null,{default:a(()=>[t(K,{show:r.value},{default:a(()=>[l.value.id>1?(n(),c("div",Vs,[t(p,{post:l.value,onReload:U},null,8,["post"])])):(n(),c("div",Hs,[t(V,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(n(),c("div",Fs,[t(P,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":k},{prefix:a(()=>[Ys]),default:a(()=>[t(v,{name:"default",tab:"默认"}),t(v,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(n(),z(m,{key:1},{default:a(()=>[t(R,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:N},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(n(),c("div",Ks,[g.value?(n(),c("div",Js,[t(H,{num:5})])):(n(),c("div",Gs,[y.value.length===0?(n(),c("div",Qs,[t(V,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(n(!0),c(le,null,ie(y.value,J=>(n(),z(m,{key:J.id},{default:a(()=>[t(B,{comment:J,onReload:N},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),y.value.length>=C?(n(),z(W,{key:3,justify:"center"},{default:a(()=>[t(e(Ut),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:E},{spinner:a(()=>[_.value&&h.value?(n(),c("span",Ws)):i("",!0),!_.value&&e(M)?(n(),c("span",Xs)):i("",!0),_.value&&!h.value?(n(),c("span",Zs,"加载评论")):i("",!0),!_.value&&!e(M)?(n(),c("span",eo,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const Do=te(to,[["__scopeId","data-v-0d01659f"]]);export{Do as default}; diff --git a/web/dist/assets/Profile-20bcef92.js b/web/dist/assets/Profile-373e91c0.js similarity index 84% rename from web/dist/assets/Profile-20bcef92.js rename to web/dist/assets/Profile-373e91c0.js index 52fa29e9..e42cce5c 100644 --- a/web/dist/assets/Profile-20bcef92.js +++ b/web/dist/assets/Profile-373e91c0.js @@ -1 +1 @@ -import{_ as M}from"./post-item.vue_vue_type_style_index_0_lang-2d543dae.js";import{_ as N}from"./post-skeleton-ce689406.js";import{_ as S}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{u as U}from"./vuex-d28e9067.js";import{b as V}from"./vue-router-88cc84d1.js";import{A as D,_ as L}from"./index-71725d26.js";import{d as R,r,j,c as a,L as t,Y as _,K as h,$ as u,O as d,o as e,a as s,M as f,F as q,a2 as A}from"./@vue-ca177dbe.js";import{F as E,G,o as H,f as K,g as O,I as T,H as Y}from"./naive-ui-2035804c.js";import"./content-be850479.js";import"./@vicons-a45d17e4.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const J={class:"profile-baseinfo"},Q={class:"avatar"},W={class:"base-info"},X={class:"username"},Z={class:"uid"},tt={key:0,class:"skeleton-wrap"},et={key:1},ot={key:0,class:"empty-wrap"},st={key:1,class:"pagination-wrap"},nt=R({__name:"Profile",setup(at){const o=U(),k=V(),i=r(!1),p=r([]),l=r(+k.query.p||1),c=r(20),m=r(0),g=()=>{i.value=!0,D({username:o.state.userInfo.username,page:l.value,page_size:c.value}).then(n=>{i.value=!1,p.value=n.list,m.value=Math.ceil(n.pager.total_rows/c.value),window.scrollTo(0,0)}).catch(n=>{i.value=!1})},y=n=>{l.value=n,g()};return j(()=>{g()}),(n,_t)=>{const w=S,I=H,b=K,P=O,x=N,z=T,B=M,$=Y,C=E,F=G;return e(),a("div",null,[t(w,{title:"主页"}),_(o).state.userInfo.id>0?(e(),h(C,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:u(()=>[s("div",J,[s("div",Q,[t(I,{size:"large",src:_(o).state.userInfo.avatar},null,8,["src"])]),s("div",W,[s("div",X,[s("strong",null,f(_(o).state.userInfo.nickname),1),s("span",null," @"+f(_(o).state.userInfo.username),1)]),s("div",Z,"UID. "+f(_(o).state.userInfo.id),1)])]),t(P,{class:"profile-tabs-wrap",animated:""},{default:u(()=>[t(b,{name:"post",tab:"泡泡"})]),_:1}),i.value?(e(),a("div",tt,[t(x,{num:c.value},null,8,["num"])])):(e(),a("div",et,[p.value.length===0?(e(),a("div",ot,[t(z,{size:"large",description:"暂无数据"})])):d("",!0),(e(!0),a(q,null,A(p.value,v=>(e(),h($,{key:v.id},{default:u(()=>[t(B,{post:v},null,8,["post"])]),_:2},1024))),128))]))]),_:1})):d("",!0),m.value>0?(e(),a("div",st,[t(F,{page:l.value,"onUpdate:page":y,"page-slot":_(o).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):d("",!0)])}}});const Lt=L(nt,[["__scopeId","data-v-1d87d974"]]);export{Lt as default}; +import{_ as M}from"./post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js";import{_ as N}from"./post-skeleton-a319fe06.js";import{_ as S}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{u as U}from"./vuex-d28e9067.js";import{b as V}from"./vue-router-88cc84d1.js";import{A as D,_ as L}from"./index-ddd65805.js";import{d as R,r,j,c as a,L as t,Y as _,K as h,$ as u,O as d,o as e,a as s,M as f,F as q,a2 as A}from"./@vue-ca177dbe.js";import{F as E,G,o as H,f as K,g as O,I as T,H as Y}from"./naive-ui-2035804c.js";import"./content-13239b6c.js";import"./@vicons-a45d17e4.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const J={class:"profile-baseinfo"},Q={class:"avatar"},W={class:"base-info"},X={class:"username"},Z={class:"uid"},tt={key:0,class:"skeleton-wrap"},et={key:1},ot={key:0,class:"empty-wrap"},st={key:1,class:"pagination-wrap"},nt=R({__name:"Profile",setup(at){const o=U(),k=V(),i=r(!1),p=r([]),l=r(+k.query.p||1),c=r(20),m=r(0),g=()=>{i.value=!0,D({username:o.state.userInfo.username,page:l.value,page_size:c.value}).then(n=>{i.value=!1,p.value=n.list,m.value=Math.ceil(n.pager.total_rows/c.value),window.scrollTo(0,0)}).catch(n=>{i.value=!1})},y=n=>{l.value=n,g()};return j(()=>{g()}),(n,_t)=>{const w=S,I=H,b=K,P=O,x=N,z=T,B=M,$=Y,C=E,F=G;return e(),a("div",null,[t(w,{title:"主页"}),_(o).state.userInfo.id>0?(e(),h(C,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:u(()=>[s("div",J,[s("div",Q,[t(I,{size:"large",src:_(o).state.userInfo.avatar},null,8,["src"])]),s("div",W,[s("div",X,[s("strong",null,f(_(o).state.userInfo.nickname),1),s("span",null," @"+f(_(o).state.userInfo.username),1)]),s("div",Z,"UID. "+f(_(o).state.userInfo.id),1)])]),t(P,{class:"profile-tabs-wrap",animated:""},{default:u(()=>[t(b,{name:"post",tab:"泡泡"})]),_:1}),i.value?(e(),a("div",tt,[t(x,{num:c.value},null,8,["num"])])):(e(),a("div",et,[p.value.length===0?(e(),a("div",ot,[t(z,{size:"large",description:"暂无数据"})])):d("",!0),(e(!0),a(q,null,A(p.value,v=>(e(),h($,{key:v.id},{default:u(()=>[t(B,{post:v},null,8,["post"])]),_:2},1024))),128))]))]),_:1})):d("",!0),m.value>0?(e(),a("div",st,[t(F,{page:l.value,"onUpdate:page":y,"page-slot":_(o).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):d("",!0)])}}});const Lt=L(nt,[["__scopeId","data-v-1d87d974"]]);export{Lt as default}; diff --git a/web/dist/assets/Setting-b9175f11.js b/web/dist/assets/Setting-62b2e199.js similarity index 97% rename from web/dist/assets/Setting-b9175f11.js rename to web/dist/assets/Setting-62b2e199.js index fcc83cb3..d9123edf 100644 --- a/web/dist/assets/Setting-b9175f11.js +++ b/web/dist/assets/Setting-62b2e199.js @@ -1 +1 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{d as ye,r as d,D as Q,j as ke,c as g,L as t,$ as s,K as b,O as _,o as r,a as m,Y as u,e as c,M as R,z as be,v as Ce,P as q,a0 as B,U as Ie,V as $e}from"./@vue-ca177dbe.js";import{u as Pe}from"./vuex-d28e9067.js";import{S as Z,T as Ue,U as Se,V as Re,W as qe,X as Be,Y as Ae,_ as ze}from"./index-71725d26.js";import{y as Ke}from"./@vicons-a45d17e4.js";import{h as Ne,o as De,e as xe,B as Fe,b as Ve,j as Te,S as je,$ as Oe,K as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-2035804c.js";import"./vue-router-88cc84d1.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const V=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),Ye={class:"base-line avatar"},Ge={class:"base-line"},Je=V(()=>m("span",{class:"base-label"},"昵称",-1)),Xe={key:0},He={class:"base-line"},Qe=V(()=>m("span",{class:"base-label"},"用户名",-1)),Ze={key:0},et={key:1},tt=V(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=V(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(A){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),z=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),K=d(!1),N=d(!1),M=d(),W=d(),C=d(!1),D=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),Y=d(),G=d(),J=d(),X=d(),a=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Q({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return z.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):z.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&z.value==="public/avatar"&&Ue({avatar:f.data.content}).then(p=>{var x;window.$message.success("头像更新成功"),(x=M.value)==null||x.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=X.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(D.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=Y.value)==null||e.validate(v=>{v||(K.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{K.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{K.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(N.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{N.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{N.value=!1,f.code===20012&&j()}))})},T=()=>{Z().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Z().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Be({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&S.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Ae({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{S.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,S.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&T(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=W.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=we,f=De,p=xe,x=Fe,h=Ve,ge=Te,F=Ne,H=je,w=Oe,he=Ee,O=Le,E=Me,L=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ye,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(x,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:z.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[Je,C.value?_("",!0):(r(),g("div",Xe,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:ce,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(p,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(Ke))]),_:1})]),_:1})):_("",!0)]),m("div",He,[Qe,c(" @"+R(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",Ze,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(H,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:Y,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:T},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(p,{type:"primary",ghost:"",disabled:S.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&S.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(H,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(L,{ref_key:"activateFormRef",ref:G,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:j},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:N.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),U.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:J,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:re,onKeydown:e[18]||(e[18]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:X,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:D.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=ze(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; +import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{d as ye,r as d,D as Q,j as ke,c as g,L as t,$ as s,K as b,O as _,o as r,a as m,Y as u,e as c,M as R,z as be,v as Ce,P as q,a0 as B,U as Ie,V as $e}from"./@vue-ca177dbe.js";import{u as Pe}from"./vuex-d28e9067.js";import{S as Z,T as Ue,U as Se,V as Re,W as qe,X as Be,Y as Ae,_ as ze}from"./index-ddd65805.js";import{y as Ke}from"./@vicons-a45d17e4.js";import{h as Ne,o as De,e as xe,B as Fe,b as Ve,j as Te,S as je,$ as Oe,K as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-2035804c.js";import"./vue-router-88cc84d1.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const V=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),Ye={class:"base-line avatar"},Ge={class:"base-line"},Je=V(()=>m("span",{class:"base-label"},"昵称",-1)),Xe={key:0},He={class:"base-line"},Qe=V(()=>m("span",{class:"base-label"},"用户名",-1)),Ze={key:0},et={key:1},tt=V(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=V(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(A){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),z=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),K=d(!1),N=d(!1),M=d(),W=d(),C=d(!1),D=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),Y=d(),G=d(),J=d(),X=d(),a=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Q({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return z.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):z.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&z.value==="public/avatar"&&Ue({avatar:f.data.content}).then(p=>{var x;window.$message.success("头像更新成功"),(x=M.value)==null||x.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=X.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(D.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=Y.value)==null||e.validate(v=>{v||(K.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{K.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{K.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(N.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{N.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{N.value=!1,f.code===20012&&j()}))})},T=()=>{Z().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Z().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Be({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&S.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Ae({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{S.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,S.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&T(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=W.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=we,f=De,p=xe,x=Fe,h=Ve,ge=Te,F=Ne,H=je,w=Oe,he=Ee,O=Le,E=Me,L=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ye,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(x,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:z.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[Je,C.value?_("",!0):(r(),g("div",Xe,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:ce,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(p,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(Ke))]),_:1})]),_:1})):_("",!0)]),m("div",He,[Qe,c(" @"+R(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",Ze,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(H,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:Y,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:T},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(p,{type:"primary",ghost:"",disabled:S.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&S.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(H,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(L,{ref_key:"activateFormRef",ref:G,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:j},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:N.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),U.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:J,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:re,onKeydown:e[18]||(e[18]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:X,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:D.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=ze(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; diff --git a/web/dist/assets/Topic-69ad069c.js b/web/dist/assets/Topic-70be769e.js similarity index 97% rename from web/dist/assets/Topic-69ad069c.js rename to web/dist/assets/Topic-70be769e.js index 518ddf70..fb5d9361 100644 --- a/web/dist/assets/Topic-69ad069c.js +++ b/web/dist/assets/Topic-70be769e.js @@ -1 +1 @@ -import{w as x,x as S,y as z,z as I,_ as j}from"./index-71725d26.js";import{p as E}from"./@vicons-a45d17e4.js";import{d as F,r as _,n as $,j as q,a1 as U,o as l,c as u,L as n,$ as a,K as T,e as A,M as w,O as m,Y as r,w as D,a6 as K,F as Y,a2 as G}from"./@vue-ca177dbe.js";import{o as H,M as L,j as J,e as P,O as Q,L as R,F as W,f as X,g as Z,a as tt,k as et}from"./naive-ui-2035804c.js";import{_ as ot}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{u as nt}from"./vuex-d28e9067.js";import"./vue-router-88cc84d1.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const st={key:0,class:"tag-item"},at={key:0,class:"tag-quote"},ct={key:1,class:"tag-quote tag-follow"},lt={key:0,class:"options"},it=F({__name:"tag-item",props:{tag:null,showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(s){const e=s,g=_(!1),d=$(()=>{let o=[];return e.tag.is_following===0?o.push({label:"关注",key:"follow"}):(e.tag.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"}),o.push({label:"取消关注",key:"unfollow"})),o}),i=o=>{switch(o){case"follow":z({topic_id:e.tag.id}).then(t=>{e.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":S({topic_id:e.tag.id}).then(t=>{e.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return q(()=>{g.value=!1}),(o,t)=>{const k=U("router-link"),f=H,v=L,c=J,h=P,y=Q,p=R;return!s.checkFollowing||s.checkFollowing&&s.tag.is_following===1?(l(),u("div",st,[n(p,null,{header:a(()=>[(l(),T(v,{type:"success",size:"large",round:"",key:s.tag.id},{avatar:a(()=>[n(f,{src:s.tag.user.avatar},null,8,["src"])]),default:a(()=>[n(k,{class:"hash-link",to:{name:"home",query:{q:s.tag.tag,t:"tag"}}},{default:a(()=>[A(" #"+w(s.tag.tag),1)]),_:1},8,["to"]),s.showAction?m("",!0):(l(),u("span",at,"("+w(s.tag.quote_num)+")",1)),s.showAction?(l(),u("span",ct,"("+w(s.tag.quote_num)+")",1)):m("",!0)]),_:1}))]),"header-extra":a(()=>[s.showAction?(l(),u("div",lt,[n(y,{placement:"bottom-end",trigger:"click",size:"small",options:r(d),onSelect:i},{default:a(()=>[n(h,{type:"success",quaternary:"",circle:"",block:""},{icon:a(()=>[n(c,null,{default:a(()=>[n(r(E))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)]),_:1})])):m("",!0)}}});const _t=F({__name:"Topic",setup(s){const e=nt(),g=_([]),d=_("hot"),i=_(!1),o=_(!1),t=_(!1);D(o,()=>{o.value||(window.$message.success("保存成功"),e.commit("refreshTopicFollow"))});const k=$({get:()=>{let c="编辑";return o.value&&(c="保存"),c},set:c=>{}}),f=()=>{i.value=!0,I({type:d.value,num:50}).then(c=>{g.value=c.topics,i.value=!1}).catch(c=>{console.log(c),i.value=!1})},v=c=>{d.value=c,c=="follow"?t.value=!0:t.value=!1,f()};return q(()=>{f()}),(c,h)=>{const y=ot,p=X,B=L,C=Z,V=it,M=tt,N=et,O=W;return l(),u("div",null,[n(y,{title:"话题"}),n(O,{class:"main-content-wrap tags-wrap",bordered:""},{default:a(()=>[n(C,{type:"line",animated:"","onUpdate:value":v},K({default:a(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),r(e).state.userLogined?(l(),T(p,{key:0,name:"follow",tab:"关注"})):m("",!0)]),_:2},[r(e).state.userLogined?{name:"suffix",fn:a(()=>[n(B,{checked:o.value,"onUpdate:checked":h[0]||(h[0]=b=>o.value=b),checkable:""},{default:a(()=>[A(w(r(k)),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:a(()=>[n(M,null,{default:a(()=>[(l(!0),u(Y,null,G(g.value,b=>(l(),T(V,{tag:b,showAction:r(e).state.userLogined&&o.value,checkFollowing:t.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Vt=j(_t,[["__scopeId","data-v-15794a53"]]);export{Vt as default}; +import{w as x,x as S,y as z,z as I,_ as j}from"./index-ddd65805.js";import{p as E}from"./@vicons-a45d17e4.js";import{d as F,r as _,n as $,j as q,a1 as U,o as l,c as u,L as n,$ as a,K as T,e as A,M as w,O as m,Y as r,w as D,a6 as K,F as Y,a2 as G}from"./@vue-ca177dbe.js";import{o as H,M as L,j as J,e as P,O as Q,L as R,F as W,f as X,g as Z,a as tt,k as et}from"./naive-ui-2035804c.js";import{_ as ot}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{u as nt}from"./vuex-d28e9067.js";import"./vue-router-88cc84d1.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const st={key:0,class:"tag-item"},at={key:0,class:"tag-quote"},ct={key:1,class:"tag-quote tag-follow"},lt={key:0,class:"options"},it=F({__name:"tag-item",props:{tag:null,showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(s){const e=s,g=_(!1),d=$(()=>{let o=[];return e.tag.is_following===0?o.push({label:"关注",key:"follow"}):(e.tag.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"}),o.push({label:"取消关注",key:"unfollow"})),o}),i=o=>{switch(o){case"follow":z({topic_id:e.tag.id}).then(t=>{e.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":S({topic_id:e.tag.id}).then(t=>{e.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return q(()=>{g.value=!1}),(o,t)=>{const k=U("router-link"),f=H,v=L,c=J,h=P,y=Q,p=R;return!s.checkFollowing||s.checkFollowing&&s.tag.is_following===1?(l(),u("div",st,[n(p,null,{header:a(()=>[(l(),T(v,{type:"success",size:"large",round:"",key:s.tag.id},{avatar:a(()=>[n(f,{src:s.tag.user.avatar},null,8,["src"])]),default:a(()=>[n(k,{class:"hash-link",to:{name:"home",query:{q:s.tag.tag,t:"tag"}}},{default:a(()=>[A(" #"+w(s.tag.tag),1)]),_:1},8,["to"]),s.showAction?m("",!0):(l(),u("span",at,"("+w(s.tag.quote_num)+")",1)),s.showAction?(l(),u("span",ct,"("+w(s.tag.quote_num)+")",1)):m("",!0)]),_:1}))]),"header-extra":a(()=>[s.showAction?(l(),u("div",lt,[n(y,{placement:"bottom-end",trigger:"click",size:"small",options:r(d),onSelect:i},{default:a(()=>[n(h,{type:"success",quaternary:"",circle:"",block:""},{icon:a(()=>[n(c,null,{default:a(()=>[n(r(E))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)]),_:1})])):m("",!0)}}});const _t=F({__name:"Topic",setup(s){const e=nt(),g=_([]),d=_("hot"),i=_(!1),o=_(!1),t=_(!1);D(o,()=>{o.value||(window.$message.success("保存成功"),e.commit("refreshTopicFollow"))});const k=$({get:()=>{let c="编辑";return o.value&&(c="保存"),c},set:c=>{}}),f=()=>{i.value=!0,I({type:d.value,num:50}).then(c=>{g.value=c.topics,i.value=!1}).catch(c=>{console.log(c),i.value=!1})},v=c=>{d.value=c,c=="follow"?t.value=!0:t.value=!1,f()};return q(()=>{f()}),(c,h)=>{const y=ot,p=X,B=L,C=Z,V=it,M=tt,N=et,O=W;return l(),u("div",null,[n(y,{title:"话题"}),n(O,{class:"main-content-wrap tags-wrap",bordered:""},{default:a(()=>[n(C,{type:"line",animated:"","onUpdate:value":v},K({default:a(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),r(e).state.userLogined?(l(),T(p,{key:0,name:"follow",tab:"关注"})):m("",!0)]),_:2},[r(e).state.userLogined?{name:"suffix",fn:a(()=>[n(B,{checked:o.value,"onUpdate:checked":h[0]||(h[0]=b=>o.value=b),checkable:""},{default:a(()=>[A(w(r(k)),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:a(()=>[n(M,null,{default:a(()=>[(l(!0),u(Y,null,G(g.value,b=>(l(),T(V,{tag:b,showAction:r(e).state.userLogined&&o.value,checkFollowing:t.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Vt=j(_t,[["__scopeId","data-v-15794a53"]]);export{Vt as default}; diff --git a/web/dist/assets/User-b8b6d21c.js b/web/dist/assets/User-556bdfe3.js similarity index 96% rename from web/dist/assets/User-b8b6d21c.js rename to web/dist/assets/User-556bdfe3.js index 46f6e718..19d61d99 100644 --- a/web/dist/assets/User-b8b6d21c.js +++ b/web/dist/assets/User-556bdfe3.js @@ -1 +1 @@ -import{_ as _e}from"./post-item.vue_vue_type_style_index_0_lang-2d543dae.js";import{_ as re}from"./post-skeleton-ce689406.js";import{B as ue,_ as I,C as pe,D as de,A as me,E as he,F as ve}from"./index-71725d26.js";import{Q as B,R as P,S as R,b as T,e as S,i as A,u as fe,T as ge,F as we,G as ye,o as ke,M as be,j as xe,O as $e,k as Ue,f as Fe,g as ze,I as Ie,H as Se}from"./naive-ui-2035804c.js";import{d as q,r as c,o as i,K as z,$ as t,a as _,L as n,e as h,M as $,D as qe,n as We,w as Ce,j as Me,c as m,Y as x,O as F,F as Be,a2 as Pe}from"./@vue-ca177dbe.js";import{_ as Re}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{u as Te}from"./vuex-d28e9067.js";import{b as Ae}from"./vue-router-88cc84d1.js";import{i as De}from"./@vicons-a45d17e4.js";import"./content-be850479.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Ne={class:"whisper-wrap"},Ve={class:"whisper-line"},Le={class:"whisper-line send-wrap"},Oe=q({__name:"whisper",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,ue({user_id:u.user.id,content:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=B,f=P,g=R,w=T,y=S,k=A;return i(),z(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ne,[n(g,{"show-icon":!1},{default:t(()=>[h(" 即将发送私信给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ve,[n(w,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"200","show-count":""},null,8,["value"])]),_("div",Le,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const je=I(Oe,[["__scopeId","data-v-0cbfe47c"]]),Ee={class:"whisper-wrap"},He={class:"whisper-line"},Ge={class:"whisper-line send-wrap"},Ke=q({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,pe({user_id:u.user.id,greetings:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=B,f=P,g=R,w=T,y=S,k=A;return i(),z(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ee,[n(g,{"show-icon":!1},{default:t(()=>[h(" 发送添加朋友申请给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",He,[n(w,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Ge,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Qe=I(Ke,[["__scopeId","data-v-60be56a2"]]),Ye={key:0,class:"profile-baseinfo"},Je={class:"avatar"},Xe={class:"base-info"},Ze={class:"username"},es={class:"uid"},ss={key:0,class:"user-opts"},ns={key:0,class:"skeleton-wrap"},ts={key:1},as={key:0,class:"empty-wrap"},os={key:0,class:"pagination-wrap"},ls=q({__name:"User",setup(r){fe();const U=ge(),u=Te(),a=Ae(),o=c(!1),e=qe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),l=c(!1),p=c(!1),d=c(!1),v=c([]),f=c(a.query.username||""),g=c(+a.query.p||1),w=c(20),y=c(0),k=()=>{o.value=!0,me({username:f.value,page:g.value,page_size:w.value}).then(s=>{o.value=!1,v.value=s.list,y.value=Math.ceil(s.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(s=>{o.value=!1})},b=()=>{l.value=!0,de({username:f.value}).then(s=>{l.value=!1,e.id=s.id,e.avatar=s.avatar,e.username=s.username,e.nickname=s.nickname,e.is_admin=s.is_admin,e.is_friend=s.is_friend,e.status=s.status,k()}).catch(s=>{l.value=!1,console.log(s)})},D=s=>{g.value=s,k()},N=()=>{p.value=!0},V=()=>{d.value=!0},L=()=>{p.value=!1},O=()=>{d.value=!1},j=We(()=>{let s=[{label:"私信",key:"whisper"}];return u.state.userInfo.is_admin&&(e.status===1?s.push({label:"禁言",key:"banned"}):s.push({label:"解封",key:"deblocking"})),e.is_friend?s.push({label:"删除好友",key:"delete"}):s.push({label:"添加朋友",key:"requesting"}),s}),E=s=>{switch(s){case"whisper":N();break;case"delete":H();break;case"requesting":V();break;case"banned":case"deblocking":G();break}},H=()=>{U.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,he({user_id:e.id}).then(s=>{l.value=!1,e.is_friend=!1,k()}).catch(s=>{l.value=!1,console.log(s)})}})},G=()=>{U.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,ve({id:e.id,status:e.status===1?2:1}).then(s=>{l.value=!1,b()}).catch(s=>{l.value=!1,console.log(s)})}})};return Ce(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(f.value=a.query.username||"",b())}),Me(()=>{b()}),(s,W)=>{const K=Re,Q=ke,C=be,Y=xe,J=S,X=$e,Z=je,ee=Ue,se=Fe,ne=ze,te=re,ae=Ie,oe=_e,le=Se,ie=we,ce=ye;return i(),m("div",null,[n(K,{title:"用户详情"}),n(ie,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(ee,{show:l.value},{default:t(()=>[e.id>0?(i(),m("div",Ye,[_("div",Je,[n(Q,{size:"large",src:e.avatar},null,8,["src"])]),_("div",Xe,[_("div",Ze,[_("strong",null,$(e.nickname),1),_("span",null," @"+$(e.username),1),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username&&e.is_friend?(i(),z(C,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[h(" 好友 ")]),_:1})):F("",!0),e.is_admin?(i(),z(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[h(" 管理员 ")]),_:1})):F("",!0)]),_("div",es,"UID. "+$(e.id),1)]),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username?(i(),m("div",ss,[n(X,{placement:"bottom-end",trigger:"click",size:"small",options:x(j),onSelect:E},{default:t(()=>[n(J,{quaternary:"",circle:""},{icon:t(()=>[n(Y,null,{default:t(()=>[n(x(De))]),_:1})]),_:1})]),_:1},8,["options"])])):F("",!0)])):F("",!0),n(Z,{show:p.value,user:e,onSuccess:L},null,8,["show","user"]),n(Qe,{show:d.value,user:e,onSuccess:O},null,8,["show","user"])]),_:1},8,["show"]),n(ne,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(se,{name:"post",tab:"泡泡"})]),_:1}),o.value?(i(),m("div",ns,[n(te,{num:w.value},null,8,["num"])])):(i(),m("div",ts,[v.value.length===0?(i(),m("div",as,[n(ae,{size:"large",description:"暂无数据"})])):F("",!0),(i(!0),m(Be,null,Pe(v.value,M=>(i(),z(le,{key:M.id},{default:t(()=>[n(oe,{post:M},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),y.value>0?(i(),m("div",os,[n(ce,{page:g.value,"onUpdate:page":D,"page-slot":x(u).state.collapsedRight?5:8,"page-count":y.value},null,8,["page","page-slot","page-count"])])):F("",!0)])}}});const Ts=I(ls,[["__scopeId","data-v-46a0183a"]]);export{Ts as default}; +import{_ as _e}from"./post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js";import{_ as re}from"./post-skeleton-a319fe06.js";import{B as ue,_ as I,C as pe,D as de,A as me,E as he,F as ve}from"./index-ddd65805.js";import{Q as B,R as P,S as R,b as T,e as S,i as A,u as fe,T as ge,F as we,G as ye,o as ke,M as be,j as xe,O as $e,k as Ue,f as Fe,g as ze,I as Ie,H as Se}from"./naive-ui-2035804c.js";import{d as q,r as c,o as i,K as z,$ as t,a as _,L as n,e as h,M as $,D as qe,n as We,w as Ce,j as Me,c as m,Y as x,O as F,F as Be,a2 as Pe}from"./@vue-ca177dbe.js";import{_ as Re}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{u as Te}from"./vuex-d28e9067.js";import{b as Ae}from"./vue-router-88cc84d1.js";import{i as De}from"./@vicons-a45d17e4.js";import"./content-13239b6c.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Ne={class:"whisper-wrap"},Ve={class:"whisper-line"},Le={class:"whisper-line send-wrap"},Oe=q({__name:"whisper",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,ue({user_id:u.user.id,content:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=B,f=P,g=R,w=T,y=S,k=A;return i(),z(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ne,[n(g,{"show-icon":!1},{default:t(()=>[h(" 即将发送私信给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ve,[n(w,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"200","show-count":""},null,8,["value"])]),_("div",Le,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const je=I(Oe,[["__scopeId","data-v-0cbfe47c"]]),Ee={class:"whisper-wrap"},He={class:"whisper-line"},Ge={class:"whisper-line send-wrap"},Ke=q({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,pe({user_id:u.user.id,greetings:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=B,f=P,g=R,w=T,y=S,k=A;return i(),z(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ee,[n(g,{"show-icon":!1},{default:t(()=>[h(" 发送添加朋友申请给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",He,[n(w,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Ge,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Qe=I(Ke,[["__scopeId","data-v-60be56a2"]]),Ye={key:0,class:"profile-baseinfo"},Je={class:"avatar"},Xe={class:"base-info"},Ze={class:"username"},es={class:"uid"},ss={key:0,class:"user-opts"},ns={key:0,class:"skeleton-wrap"},ts={key:1},as={key:0,class:"empty-wrap"},os={key:0,class:"pagination-wrap"},ls=q({__name:"User",setup(r){fe();const U=ge(),u=Te(),a=Ae(),o=c(!1),e=qe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),l=c(!1),p=c(!1),d=c(!1),v=c([]),f=c(a.query.username||""),g=c(+a.query.p||1),w=c(20),y=c(0),k=()=>{o.value=!0,me({username:f.value,page:g.value,page_size:w.value}).then(s=>{o.value=!1,v.value=s.list,y.value=Math.ceil(s.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(s=>{o.value=!1})},b=()=>{l.value=!0,de({username:f.value}).then(s=>{l.value=!1,e.id=s.id,e.avatar=s.avatar,e.username=s.username,e.nickname=s.nickname,e.is_admin=s.is_admin,e.is_friend=s.is_friend,e.status=s.status,k()}).catch(s=>{l.value=!1,console.log(s)})},D=s=>{g.value=s,k()},N=()=>{p.value=!0},V=()=>{d.value=!0},L=()=>{p.value=!1},O=()=>{d.value=!1},j=We(()=>{let s=[{label:"私信",key:"whisper"}];return u.state.userInfo.is_admin&&(e.status===1?s.push({label:"禁言",key:"banned"}):s.push({label:"解封",key:"deblocking"})),e.is_friend?s.push({label:"删除好友",key:"delete"}):s.push({label:"添加朋友",key:"requesting"}),s}),E=s=>{switch(s){case"whisper":N();break;case"delete":H();break;case"requesting":V();break;case"banned":case"deblocking":G();break}},H=()=>{U.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,he({user_id:e.id}).then(s=>{l.value=!1,e.is_friend=!1,k()}).catch(s=>{l.value=!1,console.log(s)})}})},G=()=>{U.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,ve({id:e.id,status:e.status===1?2:1}).then(s=>{l.value=!1,b()}).catch(s=>{l.value=!1,console.log(s)})}})};return Ce(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(f.value=a.query.username||"",b())}),Me(()=>{b()}),(s,W)=>{const K=Re,Q=ke,C=be,Y=xe,J=S,X=$e,Z=je,ee=Ue,se=Fe,ne=ze,te=re,ae=Ie,oe=_e,le=Se,ie=we,ce=ye;return i(),m("div",null,[n(K,{title:"用户详情"}),n(ie,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(ee,{show:l.value},{default:t(()=>[e.id>0?(i(),m("div",Ye,[_("div",Je,[n(Q,{size:"large",src:e.avatar},null,8,["src"])]),_("div",Xe,[_("div",Ze,[_("strong",null,$(e.nickname),1),_("span",null," @"+$(e.username),1),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username&&e.is_friend?(i(),z(C,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[h(" 好友 ")]),_:1})):F("",!0),e.is_admin?(i(),z(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[h(" 管理员 ")]),_:1})):F("",!0)]),_("div",es,"UID. "+$(e.id),1)]),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username?(i(),m("div",ss,[n(X,{placement:"bottom-end",trigger:"click",size:"small",options:x(j),onSelect:E},{default:t(()=>[n(J,{quaternary:"",circle:""},{icon:t(()=>[n(Y,null,{default:t(()=>[n(x(De))]),_:1})]),_:1})]),_:1},8,["options"])])):F("",!0)])):F("",!0),n(Z,{show:p.value,user:e,onSuccess:L},null,8,["show","user"]),n(Qe,{show:d.value,user:e,onSuccess:O},null,8,["show","user"])]),_:1},8,["show"]),n(ne,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(se,{name:"post",tab:"泡泡"})]),_:1}),o.value?(i(),m("div",ns,[n(te,{num:w.value},null,8,["num"])])):(i(),m("div",ts,[v.value.length===0?(i(),m("div",as,[n(ae,{size:"large",description:"暂无数据"})])):F("",!0),(i(!0),m(Be,null,Pe(v.value,M=>(i(),z(le,{key:M.id},{default:t(()=>[n(oe,{post:M},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),y.value>0?(i(),m("div",os,[n(ce,{page:g.value,"onUpdate:page":D,"page-slot":x(u).state.collapsedRight?5:8,"page-count":y.value},null,8,["page","page-slot","page-count"])])):F("",!0)])}}});const Ts=I(ls,[["__scopeId","data-v-46a0183a"]]);export{Ts as default}; diff --git a/web/dist/assets/Wallet-cef6a923.js b/web/dist/assets/Wallet-9f12aaf1.js similarity index 96% rename from web/dist/assets/Wallet-cef6a923.js rename to web/dist/assets/Wallet-9f12aaf1.js index bf8ed2b2..eed90efa 100644 --- a/web/dist/assets/Wallet-cef6a923.js +++ b/web/dist/assets/Wallet-9f12aaf1.js @@ -1 +1 @@ -import{_ as H}from"./post-skeleton-ce689406.js";import{_ as Z}from"./main-nav.vue_vue_type_style_index_0_lang-8c788975.js";import{d as J,r as c,j as X,c as _,L as e,$ as o,o as n,Y as y,O as w,a,e as k,F as $,a2 as N,z as ee,v as te,M as r,K as q,a4 as oe,a0 as ae,U as ne,V as se}from"./@vue-ca177dbe.js";import{u as le}from"./vuex-d28e9067.js";import{b as ce}from"./vue-router-88cc84d1.js";import{b as ie}from"./qrcode-23069ad7.js";import{O as _e,P as re,Q as ue,R as pe,_ as me}from"./index-71725d26.js";import{a as de}from"./formatTime-000dbebb.js";import{x as ge}from"./@vicons-a45d17e4.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,G as be,I as xe,j as Ce,l as Ie,h as Se,H as Re}from"./naive-ui-2035804c.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-59d11638.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";const O=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},$e={class:"balance-opts"},Ne={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Oe={key:1},Pe={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},Ue=O(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},We={class:"pay-sub-tips"},Ee=O(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Me=J({__name:"Wallet",setup(d){const i=le(),P=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+P.query.p||1),C=c(20),I=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,I.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},F=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},L=()=>{g.value=!0},T=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const S=setInterval(()=>{pe({id:l.id}).then(m=>{m.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(m=>{console.log(m)})},2e3)}).catch(l=>{v.value=!1})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Z,m=fe,V=ye,f=we,z=ke,W=be,E=H,M=xe,D=Re,j=ve,K=Ce,Q=Ie,Y=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",Ne,[e(W,{page:x.value,"onUpdate:page":F,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(V,{label:"账户余额 (元)"},{default:o(()=>[e(m,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["from","to"])]),_:1}),a("div",$e,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:L},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",Oe,[b.value.length===0?(n(),_("div",Pe,[e(M,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_($,null,N(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Be,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Fe,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_($,null,N(B.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(De=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:T},{icon:o(()=>[e(K,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Te,[Ue,a("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",We,[e(Q,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=me(Me,[["__scopeId","data-v-870bd246"]]);export{yt as default}; +import{_ as H}from"./post-skeleton-a319fe06.js";import{_ as Z}from"./main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js";import{d as J,r as c,j as X,c as _,L as e,$ as o,o as n,Y as y,O as w,a,e as k,F as $,a2 as N,z as ee,v as te,M as r,K as q,a4 as oe,a0 as ae,U as ne,V as se}from"./@vue-ca177dbe.js";import{u as le}from"./vuex-d28e9067.js";import{b as ce}from"./vue-router-88cc84d1.js";import{b as ie}from"./qrcode-23069ad7.js";import{O as _e,P as re,Q as ue,R as pe,_ as me}from"./index-ddd65805.js";import{a as de}from"./formatTime-000dbebb.js";import{x as ge}from"./@vicons-a45d17e4.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,G as be,I as xe,j as Ce,l as Ie,h as Se,H as Re}from"./naive-ui-2035804c.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-59d11638.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-b7869f98.js";const O=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},$e={class:"balance-opts"},Ne={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Oe={key:1},Pe={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},Ue=O(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},We={class:"pay-sub-tips"},Ee=O(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Me=J({__name:"Wallet",setup(d){const i=le(),P=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+P.query.p||1),C=c(20),I=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,I.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},F=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},L=()=>{g.value=!0},T=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const S=setInterval(()=>{pe({id:l.id}).then(m=>{m.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(m=>{console.log(m)})},2e3)}).catch(l=>{v.value=!1})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Z,m=fe,V=ye,f=we,z=ke,W=be,E=H,M=xe,D=Re,j=ve,K=Ce,Q=Ie,Y=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",Ne,[e(W,{page:x.value,"onUpdate:page":F,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(V,{label:"账户余额 (元)"},{default:o(()=>[e(m,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["from","to"])]),_:1}),a("div",$e,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:L},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",Oe,[b.value.length===0?(n(),_("div",Pe,[e(M,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_($,null,N(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Be,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Fe,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_($,null,N(B.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(De=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:T},{icon:o(()=>[e(K,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Te,[Ue,a("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",We,[e(Q,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=me(Me,[["__scopeId","data-v-870bd246"]]);export{yt as default}; diff --git a/web/dist/assets/content-be850479.js b/web/dist/assets/content-13239b6c.js similarity index 99% rename from web/dist/assets/content-be850479.js rename to web/dist/assets/content-13239b6c.js index 609c5a42..031521f5 100644 --- a/web/dist/assets/content-be850479.js +++ b/web/dist/assets/content-13239b6c.js @@ -1 +1 @@ -import{d as h,o as e,c as r,F as a,a2 as m,L as s,$ as o,Y as c,a as j,M as $,a0 as k,K as _,O as g,r as C,e as B,s as b}from"./@vue-ca177dbe.js";import{v as D,w as L}from"./@vicons-a45d17e4.js";import{j as I,V as N,W as V,m as M,X as z,e as F,i as O}from"./naive-ui-2035804c.js";import{_ as A,L as T,M as U}from"./index-71725d26.js";import{N as P}from"./nonesir-video-db921567.js";const R={class:"link-wrap"},K=["href"],S={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(D))]),_:1}),j("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[j("span",S,$(n.content),1)],8,K)]))),128))])}}});const nt=A(W,[["__scopeId","data-v-6c4d1eb6"]]),X={key:0},ot=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=N,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:y.full?1:5},{default:o(()=>[s(x,{span:y.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),_(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},st=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=M,d=N,f=V,w=z;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),_(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),_(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),_(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),_(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),_(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),_(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),_(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),_(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},q=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=C(!1),u=C(""),x=C(0),n=d=>{p.value=!0,x.value=d.id,u.value="这是一个免费附件,您可以直接下载?",d.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),T({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{U({id:x.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,f)=>{const w=I,t=F,i=O;return e(),r("div",Z,[(e(!0),r(a,null,m(y.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(G=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(L))]),_:1})]),default:o(()=>[B(" "+$(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const rt=A(q,[["__scopeId","data-v-22563084"]]),lt=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{st as _,rt as a,ot as b,nt as c,lt as p}; +import{d as h,o as e,c as r,F as a,a2 as m,L as s,$ as o,Y as c,a as j,M as $,a0 as k,K as _,O as g,r as C,e as B,s as b}from"./@vue-ca177dbe.js";import{v as D,w as L}from"./@vicons-a45d17e4.js";import{j as I,V as N,W as V,m as M,X as z,e as F,i as O}from"./naive-ui-2035804c.js";import{_ as A,L as T,M as U}from"./index-ddd65805.js";import{N as P}from"./nonesir-video-db921567.js";const R={class:"link-wrap"},K=["href"],S={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(D))]),_:1}),j("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[j("span",S,$(n.content),1)],8,K)]))),128))])}}});const nt=A(W,[["__scopeId","data-v-6c4d1eb6"]]),X={key:0},ot=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=N,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:y.full?1:5},{default:o(()=>[s(x,{span:y.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),_(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},st=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=M,d=N,f=V,w=z;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),_(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),_(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),_(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),_(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),_(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),_(d,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),_(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),_(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),_(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),_(d,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},q=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=C(!1),u=C(""),x=C(0),n=d=>{p.value=!0,x.value=d.id,u.value="这是一个免费附件,您可以直接下载?",d.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),T({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{U({id:x.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,f)=>{const w=I,t=F,i=O;return e(),r("div",Z,[(e(!0),r(a,null,m(y.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(G=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(L))]),_:1})]),default:o(()=>[B(" "+$(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const rt=A(q,[["__scopeId","data-v-22563084"]]),lt=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{st as _,rt as a,ot as b,nt as c,lt as p}; diff --git a/web/dist/assets/index-71725d26.js b/web/dist/assets/index-ddd65805.js similarity index 90% rename from web/dist/assets/index-71725d26.js rename to web/dist/assets/index-ddd65805.js index 2e947972..408b5cbc 100644 --- a/web/dist/assets/index-71725d26.js +++ b/web/dist/assets/index-ddd65805.js @@ -1 +1 @@ -import{d as z,r as R,D as Y,j,o as v,K as D,$ as a,a as k,L as o,c as T,e as S,P as K,a0 as q,O as M,Y as m,n as Q,w as H,a1 as ae,F as J,a2 as X,M as I,s as P,a3 as he,Q as Z,a4 as ge,a5 as fe}from"./@vue-ca177dbe.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-88cc84d1.js";import{c as ke,u as B}from"./vuex-d28e9067.js";import{a as be}from"./axios-707ed124.js";import{_ as Pe,N as Oe,a as ue,b as ce,c as Le,d as Ae,e as ie,f as Te,g as Re,h as de,i as Ce,j as x,k as Ee,u as $e,l as Ie,m as Se,n as Me,o as Ue,p as Ke,q as qe,r as De,s as Ne,t as xe}from"./naive-ui-2035804c.js";import{S as Fe,M as Ve,L as ze,C as Be,B as We,P as He,W as je,a as Qe,H as ee,b as te,c as oe}from"./@vicons-a45d17e4.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const n of c)if(n.type==="childList")for(const h of n.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function l(c){const n={};return c.integrity&&(n.integrity=c.integrity),c.referrerPolicy&&(n.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?n.credentials="include":c.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(c){if(c.ep)return;c.ep=!0;const n=l(c);fetch(c.href,n)}})();const Ge="modulepreload",Ye=function(e){return"/"+e},se={},A=function(t,l,i){if(!l||l.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Ye(n),n in se)return;se[n]=!0;const h=n.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const _=c[b];if(_.href===n&&(!h||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":Ge,h||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),h)return new Promise((b,_)=>{g.addEventListener("load",b),g.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Je=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-635b1403.js"),["assets/Home-635b1403.js","assets/post-item.vue_vue_type_style_index_0_lang-2d543dae.js","assets/content-be850479.js","assets/@vue-ca177dbe.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-ce689406.js","assets/post-skeleton-f1900002.css","assets/lodash-3329902d.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Home-47eb20e2.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"话题详情"},component:()=>A(()=>import("./Post-9fdb3280.js"),["assets/Post-9fdb3280.js","assets/@vue-ca177dbe.js","assets/vuex-d28e9067.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/IEnum-a180d93e.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-be850479.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vue-router-88cc84d1.js","assets/post-skeleton-ce689406.js","assets/post-skeleton-f1900002.css","assets/lodash-3329902d.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/main-nav-3ef9bae6.css","assets/v3-infinite-loading-fcb59c38.js","assets/v3-infinite-loading-7d241236.css","assets/axios-707ed124.js","assets/Post-d4d1dd23.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-69ad069c.js"),["assets/Topic-69ad069c.js","assets/@vicons-a45d17e4.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Topic-8dbcebb5.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>A(()=>import("./Anouncement-5bb39360.js"),["assets/Anouncement-5bb39360.js","assets/post-skeleton-ce689406.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-a45d17e4.js","assets/main-nav-3ef9bae6.css","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-707ed124.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>A(()=>import("./Profile-20bcef92.js"),["assets/Profile-20bcef92.js","assets/post-item.vue_vue_type_style_index_0_lang-2d543dae.js","assets/content-be850479.js","assets/@vue-ca177dbe.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-ce689406.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Profile-5d71a5c2.css","assets/vfonts-7afd136d.css"])},{path:"/user",name:"user",meta:{title:"用户详情"},component:()=>A(()=>import("./User-b8b6d21c.js"),["assets/User-b8b6d21c.js","assets/post-item.vue_vue_type_style_index_0_lang-2d543dae.js","assets/content-be850479.js","assets/@vue-ca177dbe.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-ce689406.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/User-4f525d0f.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>A(()=>import("./Messages-f3f6acae.js"),["assets/Messages-f3f6acae.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/vuex-d28e9067.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Messages-7ed31ecd.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>A(()=>import("./Collection-c3a6d815.js"),["assets/Collection-c3a6d815.js","assets/post-item.vue_vue_type_style_index_0_lang-2d543dae.js","assets/content-be850479.js","assets/@vue-ca177dbe.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-ce689406.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Collection-e1365ea0.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>A(()=>import("./Contacts-774b9ff5.js"),["assets/Contacts-774b9ff5.js","assets/vue-router-88cc84d1.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-ce689406.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/vuex-d28e9067.js","assets/@vicons-a45d17e4.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Contacts-b60e5e0d.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>A(()=>import("./Wallet-cef6a923.js"),["assets/Wallet-cef6a923.js","assets/post-skeleton-ce689406.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-a45d17e4.js","assets/main-nav-3ef9bae6.css","assets/qrcode-23069ad7.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-59d11638.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-707ed124.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>A(()=>import("./Setting-b9175f11.js"),["assets/Setting-b9175f11.js","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>A(()=>import("./404-55fd2878.js"),["assets/404-55fd2878.js","assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],pe=ve({history:we(),routes:Je});pe.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Xe=ke({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",userLogined:!1,userInfo:{id:0,username:"",nickname:""}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:""},e.userLogined=!1}},actions:{},modules:{}}),G=be.create({baseURL:"",timeout:3e4});G.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));G.interceptors.response.use(e=>{const{data:t={},code:l=0}=(e==null?void 0:e.data)||{};if(+l==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var l;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((l=t==null?void 0:t.data)==null?void 0:l.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function s(e){return G(e)}const ne=e=>s({method:"post",url:"/v1/auth/login",data:e}),Ze=e=>s({method:"post",url:"/v1/auth/register",data:e}),W=(e="")=>s({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=z({__name:"auth",setup(e){const t=R("true".toLowerCase()==="true"),l=B(),i=R(!1),c=R(),n=Y({username:"",password:""}),h=R(),d=Y({username:"",password:"",repassword:""}),U={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=c.value)==null||u.validate(O=>{O||(i.value=!0,ne({username:n.username,password:n.password}).then(p=>{const r=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",r),W(r)}).then(p=>{window.$message.success("登录成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),l.commit("refresh"),n.username="",n.password=""}).catch(p=>{i.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=h.value)==null||u.validate(O=>{O||(i.value=!0,Ze({username:d.username,password:d.password}).then(p=>ne({username:d.username,password:d.password})).then(p=>{const r=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",r),W(r)}).then(p=>{window.$message.success("注册成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{i.value=!1}))})};return j(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?W(_).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(_,u)=>{const O=Pe,p=Oe,r=ue,y=ce,L=Le,w=Ae,E=ie,$=Te,N=Re,F=de,V=Ce;return v(),D(V,{show:m(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=f=>m(l).state.authModalShow=f),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[k("div",et,[o(F,{bordered:!1},{default:a(()=>[t.value?M("",!0):(v(),T("div",tt,[o(r,{justify:"center"},{default:a(()=>[o(p,null,{default:a(()=>[o(O,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),o(w,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(L,{label:"账户",path:"username"},{default:a(()=>[o(y,{value:n.username,"onUpdate:value":u[0]||(u[0]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(L,{label:"密码",path:"password"},{default:a(()=>[o(y,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),D(N,{key:1,"default-value":m(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[o($,{name:"signin",tab:"登录"},{default:a(()=>[o(w,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(L,{label:"账户",path:"username"},{default:a(()=>[o(y,{value:n.username,"onUpdate:value":u[2]||(u[2]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(L,{label:"密码",path:"password"},{default:a(()=>[o(y,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),o($,{name:"signup",tab:"注册"},{default:a(()=>[o(w,{ref_key:"registerRef",ref:h,model:d,rules:U},{default:a(()=>[o(L,{label:"用户名",path:"username"},{default:a(()=>[o(y,{value:d.username,"onUpdate:value":u[4]||(u[4]=f=>d.username=f),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),o(L,{label:"密码",path:"password"},{default:a(()=>[o(y,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=f=>d.password=f),onKeyup:K(q(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(L,{label:"重复密码",path:"repassword"},{default:a(()=>[o(y,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=f=>d.repassword=f),onKeyup:K(q(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:b},{default:a(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const me=(e,t)=>{const l=e.__vccOpts||e;for(const[i,c]of t)l[i]=c;return l},st=me(ot,[["__scopeId","data-v-053dfa44"]]),Jt=e=>s({method:"get",url:"/v1/posts",params:e}),nt=e=>s({method:"get",url:"/v1/tags",params:e}),Xt=e=>s({method:"get",url:"/v1/post",params:e}),Zt=e=>s({method:"get",url:"/v1/post/star",params:e}),eo=e=>s({method:"post",url:"/v1/post/star",data:e}),to=e=>s({method:"get",url:"/v1/post/collection",params:e}),oo=e=>s({method:"post",url:"/v1/post/collection",data:e}),so=e=>s({method:"get",url:"/v1/post/comments",params:e}),no=e=>s({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>s({method:"post",url:"/v1/post",data:e}),ao=e=>s({method:"delete",url:"/v1/post",data:e}),lo=e=>s({method:"post",url:"/v1/post/lock",data:e}),uo=e=>s({method:"post",url:"/v1/post/stick",data:e}),co=e=>s({method:"post",url:"/v1/post/visibility",data:e}),io=e=>s({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),po=e=>s({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),mo=e=>s({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),_o=e=>s({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),ho=e=>s({method:"post",url:"/v1/post/comment",data:e}),go=e=>s({method:"delete",url:"/v1/post/comment",data:e}),fo=e=>s({method:"post",url:"/v1/post/comment/reply",data:e}),vo=e=>s({method:"delete",url:"/v1/post/comment/reply",data:e}),wo=e=>s({method:"post",url:"/v1/topic/stick",data:e}),yo=e=>s({method:"post",url:"/v1/topic/follow",data:e}),ko=e=>s({method:"post",url:"/v1/topic/unfollow",data:e}),rt={key:0,class:"rightbar-wrap"},at={class:"search-wrap"},lt={class:"post-num"},ut={class:"post-num"},ct={class:"copyright"},it=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=R([]),l=R([]),i=R(!1),c=R(""),n=B(),h=le(),d="2023 paopao.info",U="Roc's Me",g="",b="泡泡(PaoPao)开源社区",_="https://www.paopao.info",u=+"6",O=+"12",p=()=>{i.value=!0,nt({type:"hot_extral",num:O,extral_num:u}).then(w=>{t.value=w.topics,l.value=w.extral_topics??[],L.value=!0,i.value=!1}).catch(w=>{i.value=!1})},r=w=>w>=1e3?(w/1e3).toFixed(1)+"k":w,y=()=>{h.push({name:"home",query:{q:c.value}})},L=Q({get:()=>n.state.userLogined&&l.value.length!==0,set:w=>{}});return H(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(w,E)=>{(w.refreshTopicFollow!==E.refreshTopicFollow||w.userLogined)&&p()}),j(()=>{p()}),(w,E)=>{const $=x,N=ce,F=ae("router-link"),V=Ee,f=de,_e=ue;return m(n).state.collapsedRight?M("",!0):(v(),T("div",rt,[k("div",at,[o(N,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":E[0]||(E[0]=C=>c.value=C),onKeyup:K(q(y,["prevent"]),["enter"])},{prefix:a(()=>[o($,{component:m(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),m(L)?(v(),D(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(l.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(F,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",lt,I(r(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),o(f,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(t.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(F,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",ut,I(r(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),o(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",ct,"© "+I(m(d)),1),k("div",null,[o(_e,null,{default:a(()=>[k("a",{href:m(g),target:"_blank",class:"hash-link"},I(m(U)),9,it),k("a",{href:m(_),target:"_blank",class:"hash-link"},I(m(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=me(pt,[["__scopeId","data-v-f4a84024"]]),bo=(e={})=>s({method:"get",url:"/v1/captcha",params:e}),Po=e=>s({method:"post",url:"/v1/captcha",data:e}),Oo=e=>s({method:"post",url:"/v1/user/whisper",data:e}),Lo=e=>s({method:"post",url:"/v1/friend/requesting",data:e}),Ao=e=>s({method:"post",url:"/v1/friend/add",data:e}),To=e=>s({method:"post",url:"/v1/friend/reject",data:e}),Ro=e=>s({method:"post",url:"/v1/friend/delete",data:e}),Co=e=>s({method:"post",url:"/v1/user/phone",data:e}),Eo=e=>s({method:"post",url:"/v1/user/activate",data:e}),$o=e=>s({method:"post",url:"/v1/user/password",data:e}),Io=e=>s({method:"post",url:"/v1/user/nickname",data:e}),So=e=>s({method:"post",url:"/v1/user/avatar",data:e}),re=(e={})=>s({method:"get",url:"/v1/user/msgcount/unread",params:e}),Mo=e=>s({method:"get",url:"/v1/user/messages",params:e}),Uo=e=>s({method:"post",url:"/v1/user/message/read",data:e}),Ko=e=>s({method:"get",url:"/v1/user/collections",params:e}),qo=e=>s({method:"get",url:"/v1/user/profile",params:e}),Do=e=>s({method:"get",url:"/v1/user/posts",params:e}),No=e=>s({method:"get",url:"/v1/user/wallet/bills",params:e}),xo=e=>s({method:"post",url:"/v1/user/recharge",data:e}),Fo=e=>s({method:"get",url:"/v1/user/recharge",params:e}),Vo=e=>s({method:"get",url:"/v1/suggest/users",params:e}),zo=e=>s({method:"get",url:"/v1/suggest/tags",params:e}),Bo=e=>s({method:"get",url:"/v1/attachment/precheck",params:e}),Wo=e=>s({method:"get",url:"/v1/attachment",params:e}),Ho=e=>s({method:"post",url:"/v1/admin/user/status",data:e}),_t="/assets/logo-52afee68.png",ht={class:"sidebar-wrap"},gt={class:"logo-wrap"},ft={key:0,class:"user-wrap"},vt={class:"user-info"},wt={class:"nickname"},yt={class:"nickname-txt"},kt={class:"username"},bt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Ot={key:0,class:"login-only-wrap"},Lt={key:1,class:"login-wrap"},At=z({__name:"sidebar",setup(e){const t=B(),l=ye(),i=le(),c=R(!1),n=R(l.name||""),h=R(),d=R("true".toLowerCase()==="true");H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?h.value||(re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)}),h.value=setInterval(()=>{re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)})},5e3)):h.value&&clearInterval(h.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const U=Q(()=>{const r=[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}];return"false".toLowerCase()==="true"&&r.push({label:"公告",key:"anouncement",icon:()=>P(Ve),href:"/anouncement"}),r.push({label:"主页",key:"profile",icon:()=>P(ze),href:"/profile"}),r.push({label:"消息",key:"messages",icon:()=>P(Be),href:"/messages"}),r.push({label:"收藏",key:"collection",icon:()=>P(We),href:"/collection"}),r.push({label:"好友",key:"contacts",icon:()=>P(He),href:"/contacts"}),"false".toLocaleLowerCase()==="true"&&r.push({label:"钱包",key:"wallet",icon:()=>P(je),href:"/wallet"}),r.push({label:"设置",key:"setting",icon:()=>P(Qe),href:"/setting"}),t.state.userInfo.id>0?r:[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}]}),g=r=>"href"in r?P("div",{},r.label):r.label,b=r=>r.key==="messages"?P(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>P(x,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(x,null,{default:r.icon}),_=(r,y={})=>{n.value=r,i.push({name:r})},u=()=>{l.path==="/"&&t.commit("refresh"),_("home")},O=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},p=()=>{t.commit("userLogout"),t.commit("refresh"),u()};return window.$store=t,window.$message=$e(),(r,y)=>{const L=Se,w=Me,E=Ue,$=ie;return v(),T("div",ht,[k("div",gt,[o(L,{class:"logo-img",width:"36",src:m(_t),"preview-disabled":!0,onClick:u},null,8,["src"])]),o(w,{accordion:!0,"icon-size":24,options:m(U),"render-label":g,"render-icon":b,value:n.value,"onUpdate:value":_},null,8,["options","value"]),m(t).state.userInfo.id>0?(v(),T("div",ft,[o(E,{class:"user-avatar",round:"",size:34,src:m(t).state.userInfo.avatar},null,8,["src"]),k("div",vt,[k("div",wt,[k("span",yt,I(m(t).state.userInfo.nickname),1),o($,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:p},{icon:a(()=>[o(m(x),null,{default:a(()=>[o(m(oe))]),_:1})]),_:1})]),k("div",kt,"@"+I(m(t).state.userInfo.username),1)]),k("div",bt,[o($,{class:"logout",quaternary:"",circle:"",onClick:p},{icon:a(()=>[o(m(x),{size:24},{default:a(()=>[o(m(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?M("",!0):(v(),T("div",Ot,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:y[0]||(y[0]=N=>O("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Lt,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:y[1]||(y[1]=N=>O("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),o($,{strong:"",secondary:"",round:"",type:"info",onClick:y[2]||(y[2]=N=>O("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):M("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Rt={key:0},Ct={class:"content-wrap"},Et=z({__name:"App",setup(e){const t=B(),l=Q(()=>t.state.theme==="dark"?qe:null);return(i,c)=>{const n=At,h=ae("router-view"),d=mt,U=st,g=De,b=Ne,_=xe,u=Ke;return v(),D(u,{theme:m(l)},{default:a(()=>[o(b,null,{default:a(()=>[o(g,null,{default:a(()=>{var O;return[k("div",{class:ge(["app-container",{dark:((O=m(l))==null?void 0:O.name)==="dark",mobile:!m(t).state.desktopModelShow}])},[k("div",Tt,[m(t).state.desktopModelShow?(v(),T("div",Rt,[o(n)])):M("",!0),k("div",Ct,[o(h,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),D(he,null,[i.$route.meta.keepAlive?(v(),D(Z(p),{key:0})):M("",!0)],1024)),i.$route.meta.keepAlive?M("",!0):(v(),D(Z(p),{key:0}))]),_:1})]),o(d)]),o(U)],2)]}),_:1})]),_:1}),o(_)]),_:1},8,["theme"])}}});fe(Et).use(pe).use(Xe).mount("#app");export{Do as A,Oo as B,Lo as C,qo as D,Ro as E,Ho as F,Ao as G,To as H,Uo as I,Mo as J,Ko as K,Bo as L,Wo as M,no as N,W as O,No as P,xo as Q,Fo as R,bo as S,So as T,$o as U,Co as V,Eo as W,Io as X,Po as Y,At as Z,me as _,zo as a,Jt as b,ro as c,_o as d,vo as e,io as f,Vo as g,po as h,fo as i,go as j,ho as k,Zt as l,to as m,ao as n,lo as o,eo as p,oo as q,Xt as r,uo as s,mo as t,so as u,co as v,wo as w,ko as x,yo as y,nt as z}; +import{d as z,r as R,D as Y,j,o as v,K as D,$ as a,a as k,L as o,c as T,e as S,P as K,a0 as q,O as M,Y as m,n as Q,w as H,a1 as ae,F as J,a2 as X,M as I,s as P,a3 as he,Q as Z,a4 as ge,a5 as fe}from"./@vue-ca177dbe.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-88cc84d1.js";import{c as ke,u as B}from"./vuex-d28e9067.js";import{a as be}from"./axios-707ed124.js";import{_ as Pe,N as Oe,a as ue,b as ce,c as Le,d as Ae,e as ie,f as Te,g as Re,h as de,i as Ce,j as x,k as Ee,u as $e,l as Ie,m as Se,n as Me,o as Ue,p as Ke,q as qe,r as De,s as Ne,t as xe}from"./naive-ui-2035804c.js";import{S as Fe,M as Ve,L as ze,C as Be,B as We,P as He,W as je,a as Qe,H as ee,b as te,c as oe}from"./@vicons-a45d17e4.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const n of c)if(n.type==="childList")for(const h of n.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function l(c){const n={};return c.integrity&&(n.integrity=c.integrity),c.referrerPolicy&&(n.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?n.credentials="include":c.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(c){if(c.ep)return;c.ep=!0;const n=l(c);fetch(c.href,n)}})();const Ge="modulepreload",Ye=function(e){return"/"+e},se={},A=function(t,l,i){if(!l||l.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Ye(n),n in se)return;se[n]=!0;const h=n.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const _=c[b];if(_.href===n&&(!h||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":Ge,h||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),h)return new Promise((b,_)=>{g.addEventListener("load",b),g.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Je=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-842a0689.js"),["assets/Home-842a0689.js","assets/post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js","assets/content-13239b6c.js","assets/@vue-ca177dbe.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-a319fe06.js","assets/post-skeleton-f1900002.css","assets/lodash-3329902d.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Home-47eb20e2.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"话题详情"},component:()=>A(()=>import("./Post-ad38db7b.js"),["assets/Post-ad38db7b.js","assets/@vue-ca177dbe.js","assets/vuex-d28e9067.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/IEnum-a180d93e.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-13239b6c.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vue-router-88cc84d1.js","assets/post-skeleton-a319fe06.js","assets/post-skeleton-f1900002.css","assets/lodash-3329902d.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/main-nav-3ef9bae6.css","assets/v3-infinite-loading-fcb59c38.js","assets/v3-infinite-loading-7d241236.css","assets/axios-707ed124.js","assets/Post-d4d1dd23.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-70be769e.js"),["assets/Topic-70be769e.js","assets/@vicons-a45d17e4.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Topic-8dbcebb5.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>A(()=>import("./Anouncement-38edf4be.js"),["assets/Anouncement-38edf4be.js","assets/post-skeleton-a319fe06.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-a45d17e4.js","assets/main-nav-3ef9bae6.css","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-707ed124.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>A(()=>import("./Profile-373e91c0.js"),["assets/Profile-373e91c0.js","assets/post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js","assets/content-13239b6c.js","assets/@vue-ca177dbe.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-a319fe06.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Profile-5d71a5c2.css","assets/vfonts-7afd136d.css"])},{path:"/user",name:"user",meta:{title:"用户详情"},component:()=>A(()=>import("./User-556bdfe3.js"),["assets/User-556bdfe3.js","assets/post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js","assets/content-13239b6c.js","assets/@vue-ca177dbe.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-a319fe06.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/User-4f525d0f.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>A(()=>import("./Messages-b7a5e991.js"),["assets/Messages-b7a5e991.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/vuex-d28e9067.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Messages-7ed31ecd.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>A(()=>import("./Collection-9c6b07e0.js"),["assets/Collection-9c6b07e0.js","assets/post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js","assets/content-13239b6c.js","assets/@vue-ca177dbe.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-ca358197.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-a319fe06.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Collection-e1365ea0.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>A(()=>import("./Contacts-e7ae0ddf.js"),["assets/Contacts-e7ae0ddf.js","assets/vue-router-88cc84d1.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-a319fe06.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/vuex-d28e9067.js","assets/@vicons-a45d17e4.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Contacts-b60e5e0d.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>A(()=>import("./Wallet-9f12aaf1.js"),["assets/Wallet-9f12aaf1.js","assets/post-skeleton-a319fe06.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-a45d17e4.js","assets/main-nav-3ef9bae6.css","assets/qrcode-23069ad7.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-59d11638.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-707ed124.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>A(()=>import("./Setting-62b2e199.js"),["assets/Setting-62b2e199.js","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>A(()=>import("./404-adce0e88.js"),["assets/404-adce0e88.js","assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-a45d17e4.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-3ef9bae6.css","assets/axios-707ed124.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],pe=ve({history:we(),routes:Je});pe.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Xe=ke({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",userLogined:!1,userInfo:{id:0,username:"",nickname:""}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:""},e.userLogined=!1}},actions:{},modules:{}}),G=be.create({baseURL:"",timeout:3e4});G.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));G.interceptors.response.use(e=>{const{data:t={},code:l=0}=(e==null?void 0:e.data)||{};if(+l==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var l;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((l=t==null?void 0:t.data)==null?void 0:l.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function s(e){return G(e)}const ne=e=>s({method:"post",url:"/v1/auth/login",data:e}),Ze=e=>s({method:"post",url:"/v1/auth/register",data:e}),W=(e="")=>s({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=z({__name:"auth",setup(e){const t=R("true".toLowerCase()==="true"),l=B(),i=R(!1),c=R(),n=Y({username:"",password:""}),h=R(),d=Y({username:"",password:"",repassword:""}),U={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=c.value)==null||u.validate(O=>{O||(i.value=!0,ne({username:n.username,password:n.password}).then(p=>{const r=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",r),W(r)}).then(p=>{window.$message.success("登录成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),l.commit("refresh"),n.username="",n.password=""}).catch(p=>{i.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=h.value)==null||u.validate(O=>{O||(i.value=!0,Ze({username:d.username,password:d.password}).then(p=>ne({username:d.username,password:d.password})).then(p=>{const r=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",r),W(r)}).then(p=>{window.$message.success("注册成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{i.value=!1}))})};return j(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?W(_).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(_,u)=>{const O=Pe,p=Oe,r=ue,y=ce,L=Le,w=Ae,E=ie,$=Te,N=Re,F=de,V=Ce;return v(),D(V,{show:m(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=f=>m(l).state.authModalShow=f),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[k("div",et,[o(F,{bordered:!1},{default:a(()=>[t.value?M("",!0):(v(),T("div",tt,[o(r,{justify:"center"},{default:a(()=>[o(p,null,{default:a(()=>[o(O,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),o(w,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(L,{label:"账户",path:"username"},{default:a(()=>[o(y,{value:n.username,"onUpdate:value":u[0]||(u[0]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(L,{label:"密码",path:"password"},{default:a(()=>[o(y,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),D(N,{key:1,"default-value":m(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[o($,{name:"signin",tab:"登录"},{default:a(()=>[o(w,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(L,{label:"账户",path:"username"},{default:a(()=>[o(y,{value:n.username,"onUpdate:value":u[2]||(u[2]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(L,{label:"密码",path:"password"},{default:a(()=>[o(y,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:K(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),o($,{name:"signup",tab:"注册"},{default:a(()=>[o(w,{ref_key:"registerRef",ref:h,model:d,rules:U},{default:a(()=>[o(L,{label:"用户名",path:"username"},{default:a(()=>[o(y,{value:d.username,"onUpdate:value":u[4]||(u[4]=f=>d.username=f),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),o(L,{label:"密码",path:"password"},{default:a(()=>[o(y,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=f=>d.password=f),onKeyup:K(q(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(L,{label:"重复密码",path:"repassword"},{default:a(()=>[o(y,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=f=>d.repassword=f),onKeyup:K(q(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:b},{default:a(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const me=(e,t)=>{const l=e.__vccOpts||e;for(const[i,c]of t)l[i]=c;return l},st=me(ot,[["__scopeId","data-v-053dfa44"]]),Jt=e=>s({method:"get",url:"/v1/posts",params:e}),nt=e=>s({method:"get",url:"/v1/tags",params:e}),Xt=e=>s({method:"get",url:"/v1/post",params:e}),Zt=e=>s({method:"get",url:"/v1/post/star",params:e}),eo=e=>s({method:"post",url:"/v1/post/star",data:e}),to=e=>s({method:"get",url:"/v1/post/collection",params:e}),oo=e=>s({method:"post",url:"/v1/post/collection",data:e}),so=e=>s({method:"get",url:"/v1/post/comments",params:e}),no=e=>s({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>s({method:"post",url:"/v1/post",data:e}),ao=e=>s({method:"delete",url:"/v1/post",data:e}),lo=e=>s({method:"post",url:"/v1/post/lock",data:e}),uo=e=>s({method:"post",url:"/v1/post/stick",data:e}),co=e=>s({method:"post",url:"/v1/post/visibility",data:e}),io=e=>s({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),po=e=>s({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),mo=e=>s({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),_o=e=>s({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),ho=e=>s({method:"post",url:"/v1/post/comment",data:e}),go=e=>s({method:"delete",url:"/v1/post/comment",data:e}),fo=e=>s({method:"post",url:"/v1/post/comment/reply",data:e}),vo=e=>s({method:"delete",url:"/v1/post/comment/reply",data:e}),wo=e=>s({method:"post",url:"/v1/topic/stick",data:e}),yo=e=>s({method:"post",url:"/v1/topic/follow",data:e}),ko=e=>s({method:"post",url:"/v1/topic/unfollow",data:e}),rt={key:0,class:"rightbar-wrap"},at={class:"search-wrap"},lt={class:"post-num"},ut={class:"post-num"},ct={class:"copyright"},it=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=R([]),l=R([]),i=R(!1),c=R(""),n=B(),h=le(),d="2023 paopao.info",U="Roc's Me",g="",b="泡泡(PaoPao)开源社区",_="https://www.paopao.info",u=+"6",O=+"12",p=()=>{i.value=!0,nt({type:"hot_extral",num:O,extral_num:u}).then(w=>{t.value=w.topics,l.value=w.extral_topics??[],L.value=!0,i.value=!1}).catch(w=>{i.value=!1})},r=w=>w>=1e3?(w/1e3).toFixed(1)+"k":w,y=()=>{h.push({name:"home",query:{q:c.value}})},L=Q({get:()=>n.state.userLogined&&l.value.length!==0,set:w=>{}});return H(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(w,E)=>{(w.refreshTopicFollow!==E.refreshTopicFollow||w.userLogined)&&p()}),j(()=>{p()}),(w,E)=>{const $=x,N=ce,F=ae("router-link"),V=Ee,f=de,_e=ue;return m(n).state.collapsedRight?M("",!0):(v(),T("div",rt,[k("div",at,[o(N,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":E[0]||(E[0]=C=>c.value=C),onKeyup:K(q(y,["prevent"]),["enter"])},{prefix:a(()=>[o($,{component:m(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),m(L)?(v(),D(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(l.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(F,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",lt,I(r(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),o(f,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(t.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(F,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",ut,I(r(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),o(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",ct,"© "+I(m(d)),1),k("div",null,[o(_e,null,{default:a(()=>[k("a",{href:m(g),target:"_blank",class:"hash-link"},I(m(U)),9,it),k("a",{href:m(_),target:"_blank",class:"hash-link"},I(m(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=me(pt,[["__scopeId","data-v-f4a84024"]]),bo=(e={})=>s({method:"get",url:"/v1/captcha",params:e}),Po=e=>s({method:"post",url:"/v1/captcha",data:e}),Oo=e=>s({method:"post",url:"/v1/user/whisper",data:e}),Lo=e=>s({method:"post",url:"/v1/friend/requesting",data:e}),Ao=e=>s({method:"post",url:"/v1/friend/add",data:e}),To=e=>s({method:"post",url:"/v1/friend/reject",data:e}),Ro=e=>s({method:"post",url:"/v1/friend/delete",data:e}),Co=e=>s({method:"post",url:"/v1/user/phone",data:e}),Eo=e=>s({method:"post",url:"/v1/user/activate",data:e}),$o=e=>s({method:"post",url:"/v1/user/password",data:e}),Io=e=>s({method:"post",url:"/v1/user/nickname",data:e}),So=e=>s({method:"post",url:"/v1/user/avatar",data:e}),re=(e={})=>s({method:"get",url:"/v1/user/msgcount/unread",params:e}),Mo=e=>s({method:"get",url:"/v1/user/messages",params:e}),Uo=e=>s({method:"post",url:"/v1/user/message/read",data:e}),Ko=e=>s({method:"get",url:"/v1/user/collections",params:e}),qo=e=>s({method:"get",url:"/v1/user/profile",params:e}),Do=e=>s({method:"get",url:"/v1/user/posts",params:e}),No=e=>s({method:"get",url:"/v1/user/wallet/bills",params:e}),xo=e=>s({method:"post",url:"/v1/user/recharge",data:e}),Fo=e=>s({method:"get",url:"/v1/user/recharge",params:e}),Vo=e=>s({method:"get",url:"/v1/suggest/users",params:e}),zo=e=>s({method:"get",url:"/v1/suggest/tags",params:e}),Bo=e=>s({method:"get",url:"/v1/attachment/precheck",params:e}),Wo=e=>s({method:"get",url:"/v1/attachment",params:e}),Ho=e=>s({method:"post",url:"/v1/admin/user/status",data:e}),_t="/assets/logo-52afee68.png",ht={class:"sidebar-wrap"},gt={class:"logo-wrap"},ft={key:0,class:"user-wrap"},vt={class:"user-info"},wt={class:"nickname"},yt={class:"nickname-txt"},kt={class:"username"},bt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Ot={key:0,class:"login-only-wrap"},Lt={key:1,class:"login-wrap"},At=z({__name:"sidebar",setup(e){const t=B(),l=ye(),i=le(),c=R(!1),n=R(l.name||""),h=R(),d=R("true".toLowerCase()==="true");H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?h.value||(re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)}),h.value=setInterval(()=>{re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)})},5e3)):h.value&&clearInterval(h.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const U=Q(()=>{const r=[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}];return"false".toLowerCase()==="true"&&r.push({label:"公告",key:"anouncement",icon:()=>P(Ve),href:"/anouncement"}),r.push({label:"主页",key:"profile",icon:()=>P(ze),href:"/profile"}),r.push({label:"消息",key:"messages",icon:()=>P(Be),href:"/messages"}),r.push({label:"收藏",key:"collection",icon:()=>P(We),href:"/collection"}),r.push({label:"好友",key:"contacts",icon:()=>P(He),href:"/contacts"}),"false".toLocaleLowerCase()==="true"&&r.push({label:"钱包",key:"wallet",icon:()=>P(je),href:"/wallet"}),r.push({label:"设置",key:"setting",icon:()=>P(Qe),href:"/setting"}),t.state.userInfo.id>0?r:[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}]}),g=r=>"href"in r?P("div",{},r.label):r.label,b=r=>r.key==="messages"?P(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>P(x,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(x,null,{default:r.icon}),_=(r,y={})=>{n.value=r,i.push({name:r})},u=()=>{l.path==="/"&&t.commit("refresh"),_("home")},O=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},p=()=>{t.commit("userLogout"),t.commit("refresh"),u()};return window.$store=t,window.$message=$e(),(r,y)=>{const L=Se,w=Me,E=Ue,$=ie;return v(),T("div",ht,[k("div",gt,[o(L,{class:"logo-img",width:"36",src:m(_t),"preview-disabled":!0,onClick:u},null,8,["src"])]),o(w,{accordion:!0,"icon-size":24,options:m(U),"render-label":g,"render-icon":b,value:n.value,"onUpdate:value":_},null,8,["options","value"]),m(t).state.userInfo.id>0?(v(),T("div",ft,[o(E,{class:"user-avatar",round:"",size:34,src:m(t).state.userInfo.avatar},null,8,["src"]),k("div",vt,[k("div",wt,[k("span",yt,I(m(t).state.userInfo.nickname),1),o($,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:p},{icon:a(()=>[o(m(x),null,{default:a(()=>[o(m(oe))]),_:1})]),_:1})]),k("div",kt,"@"+I(m(t).state.userInfo.username),1)]),k("div",bt,[o($,{class:"logout",quaternary:"",circle:"",onClick:p},{icon:a(()=>[o(m(x),{size:24},{default:a(()=>[o(m(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?M("",!0):(v(),T("div",Ot,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:y[0]||(y[0]=N=>O("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Lt,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:y[1]||(y[1]=N=>O("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),o($,{strong:"",secondary:"",round:"",type:"info",onClick:y[2]||(y[2]=N=>O("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):M("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Rt={key:0},Ct={class:"content-wrap"},Et=z({__name:"App",setup(e){const t=B(),l=Q(()=>t.state.theme==="dark"?qe:null);return(i,c)=>{const n=At,h=ae("router-view"),d=mt,U=st,g=De,b=Ne,_=xe,u=Ke;return v(),D(u,{theme:m(l)},{default:a(()=>[o(b,null,{default:a(()=>[o(g,null,{default:a(()=>{var O;return[k("div",{class:ge(["app-container",{dark:((O=m(l))==null?void 0:O.name)==="dark",mobile:!m(t).state.desktopModelShow}])},[k("div",Tt,[m(t).state.desktopModelShow?(v(),T("div",Rt,[o(n)])):M("",!0),k("div",Ct,[o(h,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),D(he,null,[i.$route.meta.keepAlive?(v(),D(Z(p),{key:0})):M("",!0)],1024)),i.$route.meta.keepAlive?M("",!0):(v(),D(Z(p),{key:0}))]),_:1})]),o(d)]),o(U)],2)]}),_:1})]),_:1}),o(_)]),_:1},8,["theme"])}}});fe(Et).use(pe).use(Xe).mount("#app");export{Do as A,Oo as B,Lo as C,qo as D,Ro as E,Ho as F,Ao as G,To as H,Uo as I,Mo as J,Ko as K,Bo as L,Wo as M,no as N,W as O,No as P,xo as Q,Fo as R,bo as S,So as T,$o as U,Co as V,Eo as W,Io as X,Po as Y,At as Z,me as _,zo as a,Jt as b,ro as c,_o as d,vo as e,io as f,Vo as g,po as h,fo as i,go as j,ho as k,Zt as l,to as m,ao as n,lo as o,eo as p,oo as q,Xt as r,uo as s,mo as t,so as u,co as v,wo as w,ko as x,yo as y,nt as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js index 43150874..e946c996 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-8c788975.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-b750d9b8.js @@ -1 +1 @@ -import{Z as B}from"./index-71725d26.js";import{u as E}from"./vuex-d28e9067.js";import{u as S}from"./vue-router-88cc84d1.js";import{j as A}from"./vooks-2c48c2b5.js";import{D as C,z as D,F as N,G as P}from"./@vicons-a45d17e4.js";import{a3 as x,a4 as R,j as I,e as V,a5 as j,h as F}from"./naive-ui-2035804c.js";import{d as H,r as f,j as L,o as a,c as g,Y as o,L as e,$ as t,O as c,a as $,K as _,e as q,M as U,F as G}from"./@vue-ca177dbe.js";const K={key:0},Y={class:"navbar"},oe=H({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(r){const i=r,n=E(),m=S(),l=f(!1),k=f("left"),u=d=>{d?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return L(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(d,p)=>{const y=B,b=x,O=R,s=I,h=V,M=j,T=F;return a(),g(G,null,[o(n).state.drawerModelShow?(a(),g("div",K,[e(O,{show:l.value,"onUpdate:show":p[0]||(p[0]=z=>l.value=z),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[$("div",Y,[o(n).state.drawerModelShow&&!r.back?(a(),_(h,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),r.back?(a(),_(h,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(D))]),_:1})]),_:1})):c("",!0),q(" "+U(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(s,{component:o(N)},null,8,["component"])]),"unchecked-icon":t(()=>[e(s,{component:o(P)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; +import{Z as B}from"./index-ddd65805.js";import{u as E}from"./vuex-d28e9067.js";import{u as S}from"./vue-router-88cc84d1.js";import{j as A}from"./vooks-2c48c2b5.js";import{D as C,z as D,F as N,G as P}from"./@vicons-a45d17e4.js";import{a3 as x,a4 as R,j as I,e as V,a5 as j,h as F}from"./naive-ui-2035804c.js";import{d as H,r as f,j as L,o as a,c as g,Y as o,L as e,$ as t,O as c,a as $,K as _,e as q,M as U,F as G}from"./@vue-ca177dbe.js";const K={key:0},Y={class:"navbar"},oe=H({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(r){const i=r,n=E(),m=S(),l=f(!1),k=f("left"),u=d=>{d?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return L(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(d,p)=>{const y=B,b=x,O=R,s=I,h=V,M=j,T=F;return a(),g(G,null,[o(n).state.drawerModelShow?(a(),g("div",K,[e(O,{show:l.value,"onUpdate:show":p[0]||(p[0]=z=>l.value=z),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[$("div",Y,[o(n).state.drawerModelShow&&!r.back?(a(),_(h,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),r.back?(a(),_(h,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(D))]),_:1})]),_:1})):c("",!0),q(" "+U(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(s,{component:o(N)},null,8,["component"])]),"unchecked-icon":t(()=>[e(s,{component:o(P)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-2d543dae.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-2d543dae.js deleted file mode 100644 index 2d9d561b..00000000 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-2d543dae.js +++ /dev/null @@ -1 +0,0 @@ -import{p as F,a as H,_ as P,b as I,c as R}from"./content-be850479.js";import{d as A,n as b,a1 as E,o as i,c as u,L as a,a6 as K,Y as t,$ as n,a as p,F as Y,a2 as G,a0 as v,e as _,M as c,K as l,O as r}from"./@vue-ca177dbe.js";import{u as J}from"./vuex-d28e9067.js";import{b as Q,u as U}from"./vue-router-88cc84d1.js";import{b as x}from"./formatTime-000dbebb.js";import{a as W}from"./copy-to-clipboard-ca358197.js";import{u as X,j as Z,l as tt,m as et}from"./@vicons-a45d17e4.js";import{o as st,M as ot,j as nt,e as at,O as it,a as rt,L as ct}from"./naive-ui-2035804c.js";const pt={class:"post-item"},lt={class:"nickname-wrap"},_t={class:"username-wrap"},mt={key:3},ut={class:"timestamp-mobile"},dt={class:"item-header-extra"},ht={key:0,class:"timestamp"},gt=["innerHTML"],kt={class:"opt-item"},ft={class:"opt-item"},zt=A({__name:"post-item",props:{post:null},setup(C){const $=C;Q();const g=U(),k=J(),T=b(()=>[{label:"复制链接",key:"copyTweetLink"}]),z=o=>{switch(o){case"copyTweetLink":W(`${window.location.origin}/#/post?id=${e.value.id}`),window.$message.success("链接已复制到剪贴板");break}},e=b(()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},$.post);return o.contents.map(s=>{(+s.type==1||+s.type==2)&&o.texts.push(s),+s.type==3&&o.imgs.push(s),+s.type==4&&o.videos.push(s),+s.type==6&&o.links.push(s),+s.type==7&&o.attachments.push(s),+s.type==8&&o.charge_attachments.push(s)}),o}),f=o=>{g.push({name:"post",query:{id:o}})},M=(o,s)=>{if(o.target.dataset.detail){const m=o.target.dataset.detail.split(":");if(m.length===2){k.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{username:m[1]}});return}}f(s)};return(o,s)=>{const m=st,L=E("router-link"),y=ot,d=nt,O=at,q=it,w=H,S=P,B=I,N=R,V=rt,j=ct;return i(),u("div",pt,[a(j,{"content-indented":""},K({avatar:n(()=>[a(m,{round:"",size:30,src:t(e).user.avatar},null,8,["src"])]),header:n(()=>[p("span",lt,[a(L,{onClick:s[0]||(s[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(e).user.username}}},{default:n(()=>[_(c(t(e).user.nickname),1)]),_:1},8,["to"])]),p("span",_t," @"+c(t(e).user.username),1),t(e).is_top?(i(),l(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[_(" 置顶 ")]),_:1})):r("",!0),t(e).visibility==1?(i(),l(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[_(" 私密 ")]),_:1})):r("",!0),t(e).visibility==2?(i(),l(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[_(" 好友可见 ")]),_:1})):r("",!0),t(k).state.desktopModelShow?r("",!0):(i(),u("div",mt,[p("span",ut,c(t(x)(t(e).created_on))+" "+c(t(e).ip_loc),1)]))]),"header-extra":n(()=>[p("div",dt,[t(k).state.desktopModelShow?(i(),u("span",ht,c(t(e).ip_loc?t(e).ip_loc+" · ":t(e).ip_loc)+" "+c(t(x)(t(e).created_on)),1)):r("",!0),a(q,{placement:"bottom-end",trigger:"click",size:"small",options:t(T),onSelect:z},{default:n(()=>[a(O,{quaternary:"",circle:""},{icon:n(()=>[a(d,null,{default:n(()=>[a(t(X))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[t(e).attachments.length>0?(i(),l(w,{key:0,attachments:t(e).attachments},null,8,["attachments"])):r("",!0),t(e).charge_attachments.length>0?(i(),l(w,{key:1,attachments:t(e).charge_attachments,price:t(e).attachment_price},null,8,["attachments","price"])):r("",!0),t(e).imgs.length>0?(i(),l(S,{key:2,imgs:t(e).imgs},null,8,["imgs"])):r("",!0),t(e).videos.length>0?(i(),l(B,{key:3,videos:t(e).videos},null,8,["videos"])):r("",!0),t(e).links.length>0?(i(),l(N,{key:4,links:t(e).links},null,8,["links"])):r("",!0)]),action:n(()=>[a(V,{justify:"space-between"},{default:n(()=>[p("div",kt,[a(d,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(Z))]),_:1}),_(" "+c(t(e).upvote_count),1)]),p("div",{class:"opt-item",onClick:s[3]||(s[3]=v(h=>f(t(e).id),["stop"]))},[a(d,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(tt))]),_:1}),_(" "+c(t(e).comment_count),1)]),p("div",ft,[a(d,{size:"18",class:"opt-item-icon"},{default:n(()=>[a(t(et))]),_:1}),_(" "+c(t(e).collection_count),1)])]),_:1})]),_:2},[t(e).texts.length>0?{name:"description",fn:n(()=>[p("div",{onClick:s[2]||(s[2]=h=>f(t(e).id))},[(i(!0),u(Y,null,G(t(e).texts,h=>(i(),u("span",{key:h.id,class:"post-text",onClick:s[1]||(s[1]=v(D=>M(D,t(e).id),["stop"])),innerHTML:t(F)(h.content).content},null,8,gt))),128))])]),key:"0"}:void 0]),1024)])}}});export{zt as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js new file mode 100644 index 00000000..0f23c7a1 --- /dev/null +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-8a5b4cf2.js @@ -0,0 +1 @@ +import{p as F,a as H,_ as P,b as I,c as R}from"./content-13239b6c.js";import{d as A,n as b,a1 as E,o as a,c as u,L as i,a6 as K,Y as t,$ as n,a as l,F as Y,a2 as G,a0 as v,e as _,M as c,K as p,O as r}from"./@vue-ca177dbe.js";import{u as J}from"./vuex-d28e9067.js";import{b as Q,u as U}from"./vue-router-88cc84d1.js";import{b as x}from"./formatTime-000dbebb.js";import{a as W}from"./copy-to-clipboard-ca358197.js";import{u as X,j as Z,l as tt,m as et}from"./@vicons-a45d17e4.js";import{o as st,M as ot,j as nt,e as at,O as it,a as rt,L as ct}from"./naive-ui-2035804c.js";const pt={class:"post-item"},lt={class:"nickname-wrap"},_t={class:"username-wrap"},mt={key:3},ut={class:"timestamp-mobile"},dt={class:"item-header-extra"},ht={key:0,class:"timestamp"},gt=["innerHTML"],kt={class:"opt-item"},ft={class:"opt-item"},Tt=A({__name:"post-item",props:{post:null},setup(C){const $=C;Q();const k=U(),d=J(),M=b(()=>[{label:"复制链接",key:"copyTweetLink"}]),T=o=>{switch(o){case"copyTweetLink":W(`${window.location.origin}/#/post?id=${e.value.id}`),window.$message.success("链接已复制到剪贴板");break}},e=b(()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},$.post);return o.contents.map(s=>{(+s.type==1||+s.type==2)&&o.texts.push(s),+s.type==3&&o.imgs.push(s),+s.type==4&&o.videos.push(s),+s.type==6&&o.links.push(s),+s.type==7&&o.attachments.push(s),+s.type==8&&o.charge_attachments.push(s)}),o}),f=o=>{k.push({name:"post",query:{id:o}})},z=(o,s)=>{if(o.target.dataset.detail){const m=o.target.dataset.detail.split(":");if(m.length===2){d.commit("refresh"),m[0]==="tag"?k.push({name:"home",query:{q:m[1],t:"tag"}}):k.push({name:"user",query:{username:m[1]}});return}}f(s)};return(o,s)=>{const m=st,L=E("router-link"),y=ot,h=nt,O=at,S=it,w=H,q=P,B=I,N=R,V=rt,j=ct;return a(),u("div",pt,[i(j,{"content-indented":""},K({avatar:n(()=>[i(m,{round:"",size:30,src:t(e).user.avatar},null,8,["src"])]),header:n(()=>[l("span",lt,[i(L,{onClick:s[0]||(s[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(e).user.username}}},{default:n(()=>[_(c(t(e).user.nickname),1)]),_:1},8,["to"])]),l("span",_t," @"+c(t(e).user.username),1),t(e).is_top?(a(),p(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[_(" 置顶 ")]),_:1})):r("",!0),t(e).visibility==1?(a(),p(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[_(" 私密 ")]),_:1})):r("",!0),t(e).visibility==2?(a(),p(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[_(" 好友可见 ")]),_:1})):r("",!0),t(d).state.desktopModelShow?r("",!0):(a(),u("div",mt,[l("span",ut,c(t(x)(t(e).created_on))+" "+c(t(e).ip_loc),1)]))]),"header-extra":n(()=>[l("div",dt,[t(d).state.desktopModelShow?(a(),u("span",ht,c(t(e).ip_loc?t(e).ip_loc+" · ":t(e).ip_loc)+" "+c(t(x)(t(e).created_on)),1)):r("",!0),t(d).state.desktopModelShow?r("",!0):(a(),p(S,{key:1,placement:"bottom-end",trigger:"click",size:"small",options:t(M),onSelect:T},{default:n(()=>[i(O,{quaternary:"",circle:""},{icon:n(()=>[i(h,null,{default:n(()=>[i(t(X))]),_:1})]),_:1})]),_:1},8,["options"]))])]),footer:n(()=>[t(e).attachments.length>0?(a(),p(w,{key:0,attachments:t(e).attachments},null,8,["attachments"])):r("",!0),t(e).charge_attachments.length>0?(a(),p(w,{key:1,attachments:t(e).charge_attachments,price:t(e).attachment_price},null,8,["attachments","price"])):r("",!0),t(e).imgs.length>0?(a(),p(q,{key:2,imgs:t(e).imgs},null,8,["imgs"])):r("",!0),t(e).videos.length>0?(a(),p(B,{key:3,videos:t(e).videos},null,8,["videos"])):r("",!0),t(e).links.length>0?(a(),p(N,{key:4,links:t(e).links},null,8,["links"])):r("",!0)]),action:n(()=>[i(V,{justify:"space-between"},{default:n(()=>[l("div",kt,[i(h,{size:"18",class:"opt-item-icon"},{default:n(()=>[i(t(Z))]),_:1}),_(" "+c(t(e).upvote_count),1)]),l("div",{class:"opt-item",onClick:s[3]||(s[3]=v(g=>f(t(e).id),["stop"]))},[i(h,{size:"18",class:"opt-item-icon"},{default:n(()=>[i(t(tt))]),_:1}),_(" "+c(t(e).comment_count),1)]),l("div",ft,[i(h,{size:"18",class:"opt-item-icon"},{default:n(()=>[i(t(et))]),_:1}),_(" "+c(t(e).collection_count),1)])]),_:1})]),_:2},[t(e).texts.length>0?{name:"description",fn:n(()=>[l("div",{onClick:s[2]||(s[2]=g=>f(t(e).id))},[(a(!0),u(Y,null,G(t(e).texts,g=>(a(),u("span",{key:g.id,class:"post-text",onClick:s[1]||(s[1]=v(D=>z(D,t(e).id),["stop"])),innerHTML:t(F)(g.content).content},null,8,gt))),128))])]),key:"0"}:void 0]),1024)])}}});export{Tt as _}; diff --git a/web/dist/assets/post-skeleton-ce689406.js b/web/dist/assets/post-skeleton-a319fe06.js similarity index 88% rename from web/dist/assets/post-skeleton-ce689406.js rename to web/dist/assets/post-skeleton-a319fe06.js index 7697d940..07023fad 100644 --- a/web/dist/assets/post-skeleton-ce689406.js +++ b/web/dist/assets/post-skeleton-a319fe06.js @@ -1 +1 @@ -import{U as c}from"./naive-ui-2035804c.js";import{d as r,o as s,c as n,a2 as l,a as o,L as t,F as p}from"./@vue-ca177dbe.js";import{_ as i}from"./index-71725d26.js";const m={class:"user"},d={class:"content"},u=r({__name:"post-skeleton",props:{num:{default:1}},setup(_){return(f,k)=>{const e=c;return s(!0),n(p,null,l(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; +import{U as c}from"./naive-ui-2035804c.js";import{d as r,o as s,c as n,a2 as l,a as o,L as t,F as p}from"./@vue-ca177dbe.js";import{_ as i}from"./index-ddd65805.js";const m={class:"user"},d={class:"content"},u=r({__name:"post-skeleton",props:{num:{default:1}},setup(_){return(f,k)=>{const e=c;return s(!0),n(p,null,l(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/index.html b/web/dist/index.html index d102227f..e46a8524 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/components/post-item.vue b/web/src/components/post-item.vue index e7d4752e..bfb802a8 100644 --- a/web/src/components/post-item.vue +++ b/web/src/components/post-item.vue @@ -57,7 +57,7 @@ {{ post.ip_loc ? post.ip_loc + ' · ' : post.ip_loc }} {{ formatPrettyDate(post.created_on) }} -